Test Ad Does Not Show
This is my first RN app and I wanted to use the Admob library to monetize my app. However, I cannot see ANY ads (yes, including the test ad) in my emulator. I am using RN -v 0.60.5. Any help is appreciated since I am just starting with RN!
Steps taken:
- added this line to my podfile:
pod 'Google-Mobile-Ads-SDK'
- ran inside ios folder
pod install --repo-update
-
created admob account for iOS app
-
added to info.plist (with my app id)
<key> GADApplicationIdentifier </key> <string>ca-app-pub-3940256099942544~1458002511</string>
- added the lines in AppDelegate.m (with the same app id):
@import GoogleMobileAds; [GADMobileAds configureWithApplicationID:@"ca-app-pub-3940256099942544~1458002511"];
- ran:
npm install react-native-admob
- cd into ios folder and ran:
pod install
- put into my welcome screen:
import {AdMobBanner} from 'react-native-admob'; <AdMobBanner
adSize="fullBanner"
adUnitId="ca-app-pub-3940256099942544/2934735716" //test app unit id
onAdFailedToLoad={error => console.log(error)}
testDevices={[AdMobBanner.simulatorId]}></AdMobBanner>
- ran:
react-native run-ios
- Got a banner at the bottom but no ad and an error: "Error: Cannot determine request type. Is your ad unit id correct?"
I believe that if you create the account and test immediately after that you receive an error because the account isn't completely known yet. Maybe try after a day?
I'm not sure if this also applies to the test apps because you use a different adUnitId. With my test (a day or two after creating the adMob account) the testcode worked inmediatly with just copying the code from the example.
Same things happening for me, @madelinemckune did you come up with a solution for this?
you should change adUnitId to adUnitID.