react-native-admob icon indicating copy to clipboard operation
react-native-admob copied to clipboard

Test Ad Does Not Show

Open madelinemckune opened this issue 6 years ago • 3 comments

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:

  1. added this line to my podfile:

pod 'Google-Mobile-Ads-SDK'

  1. ran inside ios folder

pod install --repo-update

  1. created admob account for iOS app

  2. added to info.plist (with my app id)

<key> GADApplicationIdentifier </key> <string>ca-app-pub-3940256099942544~1458002511</string>

  1. added the lines in AppDelegate.m (with the same app id):

@import GoogleMobileAds; [GADMobileAds configureWithApplicationID:@"ca-app-pub-3940256099942544~1458002511"];

  1. ran:

npm install react-native-admob

  1. cd into ios folder and ran:

pod install

  1. 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>
  1. ran:

react-native run-ios

  1. Got a banner at the bottom but no ad and an error: "Error: Cannot determine request type. Is your ad unit id correct?"

madelinemckune avatar Jan 09 '20 02:01 madelinemckune

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.

Tinmania2018 avatar Jan 09 '20 06:01 Tinmania2018

Same things happening for me, @madelinemckune did you come up with a solution for this?

joshsiegl1 avatar Apr 23 '20 04:04 joshsiegl1

you should change adUnitId to adUnitID.

deokgiyun avatar May 25 '20 06:05 deokgiyun