Break out android/ios admob keys

This commit is contained in:
ehesp
2019-09-20 15:09:47 +01:00
parent 1a2d15fc52
commit 032c1b9847
3 changed files with 19 additions and 5 deletions

View File

@@ -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'],
});
```

View File

@@ -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")
}

View File

@@ -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