Skip to content

Commit 66625a2

Browse files
authored
feat: v3.4 (#273)
* chore: bump libs iOS pod 11.4 iOS min bumps to 13 Android Bom 33.5.1 Android min bumps to 21 * chore(ios): bump pod * chore: 3.4.0-alpha.1
1 parent 7712c1b commit 66625a2

File tree

91 files changed

+2302
-711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2302
-711
lines changed

apps/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@nativescript/firebase-performance": "file:../../packages/firebase-performance",
2222
"@nativescript/firebase-remote-config": "file:../../packages/firebase-remote-config",
2323
"@nativescript/firebase-storage": "file:../../packages/firebase-storage",
24-
"@nativescript/google-signin": "^1.0.0-alpha.9",
24+
"@nativescript/google-signin": "~2.1.0",
2525
"@nativescript/firebase-app-check-debug": "file:../../packages/firebase-app-check-debug",
2626
"@nativescript/firebase-messaging-core": "file:../../packages/firebase-messaging-core",
2727
"@nativescript/firebase-ui": "file:../../packages/firebase-ui"

nx.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,11 @@
2121
"inputs": ["production", "^production"],
2222
"cache": true
2323
},
24-
"lint": {
25-
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
26-
"cache": true
27-
},
2824
"build.all": {
2925
"cache": true
3026
},
31-
"test": {
32-
"cache": true
33-
},
34-
"e2e": {
27+
"@nx/eslint:lint": {
28+
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
3529
"cache": true
3630
}
3731
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plugins",
3-
"version": "3.3.2",
3+
"version": "3.4.0-alpha.1",
44
"license": "MIT",
55
"scripts": {
66
"postinstall": "husky && npx ts-patch install",

packages/firebase-admob/index.ios.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,12 +566,12 @@ export class Admob implements IAdmob {
566566

567567
if (typeof requestConfiguration?.tagForChildDirectedTreatment === 'boolean') {
568568
this._requestConfiguration.tagForChildDirectedTreatment = requestConfiguration.tagForChildDirectedTreatment;
569-
GADMobileAds.sharedInstance().requestConfiguration.tagForChildDirectedTreatment(requestConfiguration.tagForChildDirectedTreatment);
569+
GADMobileAds.sharedInstance().requestConfiguration.tagForChildDirectedTreatment = Number(requestConfiguration.tagForChildDirectedTreatment);
570570
}
571571

572572
if (typeof requestConfiguration?.tagForUnderAgeOfConsent === 'boolean') {
573573
this._requestConfiguration.tagForUnderAgeOfConsent = requestConfiguration.tagForUnderAgeOfConsent;
574-
GADMobileAds.sharedInstance().requestConfiguration.tagForUnderAgeOfConsent(requestConfiguration.tagForUnderAgeOfConsent);
574+
GADMobileAds.sharedInstance().requestConfiguration.tagForUnderAgeOfConsent = Number(requestConfiguration.tagForUnderAgeOfConsent);
575575
}
576576

577577
if (Array.isArray(requestConfiguration?.testDevices)) {

packages/firebase-admob/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript/firebase-admob",
3-
"version": "3.3.2",
3+
"version": "3.4.0-alpha.1",
44
"description": "NativeScript Firebase - Admob",
55
"main": "index",
66
"typings": "index.d.ts",
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dependencies {
2-
implementation 'com.google.android.gms:play-services-ads:21.5.0'
2+
implementation 'com.google.android.gms:play-services-ads:23.5.0'
33
implementation 'com.google.android.ump:user-messaging-platform:2.0.0'
44
implementation 'androidx.core:core-ktx:1.6.0'
55
}

packages/firebase-admob/platforms/android/java/org/nativescript/firebase/admob/FirebaseAdmob.kt

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ package org.nativescript.firebase.admob
33
import android.app.Activity
44
import android.content.Context
55
import android.graphics.Bitmap
6-
import android.graphics.BitmapFactory
7-
import android.graphics.drawable.BitmapDrawable
86
import android.graphics.drawable.Drawable
9-
import android.location.Location
107
import android.os.Bundle
118
import android.os.Handler
129
import android.os.Looper
@@ -16,7 +13,6 @@ import com.google.ads.mediation.admob.AdMobAdapter
1613
import com.google.android.gms.ads.*
1714
import com.google.android.gms.ads.admanager.AdManagerAdRequest
1815
import com.google.android.gms.ads.formats.AdManagerAdViewOptions
19-
import com.google.android.gms.ads.formats.ShouldDelayBannerRenderingListener
2016
import com.google.android.gms.ads.initialization.AdapterStatus
2117
import com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback
2218
import com.google.android.gms.ads.nativead.NativeAdOptions
@@ -446,14 +442,14 @@ class FirebaseAdmob {
446442
)
447443
}
448444

449-
if (it.has(AD_MANAGER_AD_VIEW_OPTIONS_SHOULD_DELAY_BANNER_RENDERING_KEY)) {
450-
options.setShouldDelayBannerRenderingListener(object :
451-
ShouldDelayBannerRenderingListener {
452-
override fun shouldDelayBannerRendering(p0: Runnable): Boolean {
453-
return it.getBoolean(AD_MANAGER_AD_VIEW_OPTIONS_SHOULD_DELAY_BANNER_RENDERING_KEY)
454-
}
455-
})
456-
}
445+
// if (it.has(AD_MANAGER_AD_VIEW_OPTIONS_SHOULD_DELAY_BANNER_RENDERING_KEY)) {
446+
// options.setShouldDelayBannerRenderingListener(object :
447+
// ShouldDelayBannerRenderingListener {
448+
// override fun shouldDelayBannerRendering(p0: Runnable): Boolean {
449+
// return it.getBoolean(AD_MANAGER_AD_VIEW_OPTIONS_SHOULD_DELAY_BANNER_RENDERING_KEY)
450+
// }
451+
// })
452+
// }
457453
adLoader.withAdManagerAdViewOptions(options.build())
458454

459455
}
@@ -825,10 +821,50 @@ class FirebaseAdmob {
825821
}
826822
}
827823

824+
private fun buildManagerRequest(adRequest: AdManagerAdRequest.Builder, request: String) {
825+
try {
826+
val json = JSONObject(request)
827+
if (json.has(CONTENT_URL_KEY)) {
828+
adRequest.setContentUrl(
829+
json.getString(CONTENT_URL_KEY)
830+
)
831+
}
832+
833+
json.optJSONArray(KEYWORDS_KEY)?.let {
834+
for (i in 0 until it.length()) {
835+
adRequest.addKeyword(it.getString(i))
836+
}
837+
}
838+
839+
val extras = Bundle()
840+
841+
842+
if (json.has(REQUEST_NON_PERSONALIZED_ADS_ONLY_KEY)) {
843+
extras.putString("npa", "1")
844+
}
845+
846+
json.optJSONObject(NETWORK_EXTRAS_KEY)?.let {
847+
for (key in it.keys()) {
848+
extras.putString(
849+
key, it.getString(key)
850+
)
851+
}
852+
}
853+
854+
adRequest.addNetworkExtrasBundle(AdMobAdapter::class.java, extras)
855+
856+
if (json.has(REQUEST_AGENT_KEY)) {
857+
adRequest.setRequestAgent(json.getString(REQUEST_AGENT_KEY))
858+
}
859+
860+
} catch (e: Exception) {
861+
}
862+
}
863+
828864
private fun buildAdManagerRequest(request: String): AdManagerAdRequest {
829865
val adRequest = AdManagerAdRequest.Builder()
830866

831-
buildRequest(adRequest, request)
867+
buildManagerRequest(adRequest, request)
832868
try {
833869
val json = JSONObject(request)
834870

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
use_frameworks!
2-
pod 'Google-Mobile-Ads-SDK', '~> 10.2.0'
2+
platform :ios, '12.0'
3+
pod 'Google-Mobile-Ads-SDK', '~> 11.12.0'

0 commit comments

Comments
 (0)