sbugert / react-native-admob

A react-native component for Google AdMob banners
BSD 2-Clause "Simplified" License
1.13k stars 530 forks source link

(Solution) React Native App Stops Working after Install Admod Firebase #529

Open TheR20 opened 4 years ago

TheR20 commented 4 years ago

Sometimes when you add the library from Admod Firebase your app crash well here is the solution:

1- You did not create your firebase.js file. Solution: Create in the root the file firebase.js and add the next information.

//Change the XXXXXX With the ID u get from admod (you can delete the android or IOS in case you will not use it) "react-native": { "admob_android_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx", "admob_ios_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx" }

2- Your proyect can find the ApplicationID or AdmodApplicationID or FirebaseApplicationID Solution: Go to -> ./node_module/@react-native-firebase/admod/android/src/main/AndroidManifest.xml here you have a tag for meta-data change ir for:

<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="[FirebaseAppID}"/> <- the ID from Admod you have <meta-data

change to.

    <meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value="ca-app-pub-999996863233~999999283982739"/> <- the ID from Admod you have
  <meta-data

Hope it helps.

ahmad923245 commented 3 years ago

Sometimes when you add the library from Admod Firebase your app crash well here is the solution:

1- You did not create your firebase.js file. Solution: Create in the root the file firebase.js and add the next information.

//Change the XXXXXX With the ID u get from admod (you can delete the android or IOS in case you will not use it) "react-native": { "admob_android_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx", "admob_ios_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx" }

2- Your proyect can find the ApplicationID or AdmodApplicationID or FirebaseApplicationID Solution: Go to -> ./node_module/@react-native-firebase/admod/android/src/main/AndroidManifest.xml here you have a tag for meta-data change ir for:

<- the ID from Admod you have <meta-data

change to.

    <meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value="ca-app-pub-999996863233~999999283982739"/> <- the ID from Admod you have
  <meta-data

Hope it helps.

after install react-native-firebase/admob application not running

NinjaAniket commented 3 years ago

No Mate it does not work still the application crashes.

Abdullahkhan1996 commented 3 years ago

No Mate it does not work still the application crashes.

hi did you resolve this issue beacuse i am also facing same issue