From 032c1b9847fa2ef49330c0f997f47e1c3154e421 Mon Sep 17 00:00:00 2001 From: ehesp Date: Fri, 20 Sep 2019 15:09:47 +0100 Subject: [PATCH] Break out android/ios admob keys --- docs/admob/quick-start.md | 5 +++-- packages/admob/android/build.gradle | 2 +- packages/admob/lib/index.d.ts | 17 +++++++++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/docs/admob/quick-start.md b/docs/admob/quick-start.md index 111e2f78..bf476c68 100644 --- a/docs/admob/quick-start.md +++ b/docs/admob/quick-start.md @@ -50,7 +50,8 @@ Add the ID to your root level `firebase.json` file under the `react-native` obje ```json { "react-native": { - "admob_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx" + "admob_app_id_android": "ca-app-pub-xxxxxxxx~xxxxxxxx", + "admob_app_id_ios": "ca-app-pub-xxxxxxxx~xxxxxxxx" } } ``` @@ -172,6 +173,6 @@ import { InterstitialAd, TestIds } from '@react-native-firebase/admob'; // Create a new instance const interstitialAd = InterstitialAd.createForAdRequest(TestIds.INTERSTITIAL, { requestNonPersonalizedAdsOnly: true, - keywords: ['fashion', 'clothing'] + keywords: ['fashion', 'clothing'], }); ``` diff --git a/packages/admob/android/build.gradle b/packages/admob/android/build.gradle index 882dbd7c..99d96bfc 100644 --- a/packages/admob/android/build.gradle +++ b/packages/admob/android/build.gradle @@ -41,7 +41,7 @@ def firebaseJSONAdmobAppIDString = "" def firebaseJSONAdmobDelayAppMeasurementInitBool = false if (rootProject.ext.firebaseJson) { - firebaseJSONAdmobAppIDString = rootProject.ext.firebaseJson.getStringValue("admob_app_id", "") + firebaseJSONAdmobAppIDString = rootProject.ext.firebaseJson.getStringValue("admob_app_id_android", "") firebaseJSONAdmobDelayAppMeasurementInitBool = rootProject.ext.firebaseJson.isFlagEnabled("admob_delay_app_measurement_init") } diff --git a/packages/admob/lib/index.d.ts b/packages/admob/lib/index.d.ts index 837b0197..a386b58d 100644 --- a/packages/admob/lib/index.d.ts +++ b/packages/admob/lib/index.d.ts @@ -1205,13 +1205,26 @@ declare module '@react-native-firebase/app' { namespace ReactNativeFirebase { interface FirebaseJsonConfig { /** - * The Google AdMob application App ID. + * The Google AdMob application App ID for Android. * * This can be found under: Apps > App settings > App ID on the Google AdMob dashboard. * * For testing purposes, use the App ID: `ca-app-pub-3940256099942544~3347511713`. + * + * @android */ - admob_app_id: string; + admob_app_id_android: string; + + /** + * The Google AdMob application App ID for iOS. + * + * This can be found under: Apps > App settings > App ID on the Google AdMob dashboard. + * + * For testing purposes, use the App ID: `ca-app-pub-3940256099942544~1458002511`. + * + * @ios + */ + admob_app_id_ios: string; /** * By default, the Google Mobile Ads SDK initializes app measurement and begins sending user-level event data to