sbugert / react-native-admob

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

PublisherBanner not show with real AdUnitID #523

Closed fernandopascoalbr closed 4 years ago

fernandopascoalbr commented 4 years ago

This library work beatutiful with test AdManager but not show with real id. I have another app with Swift and Java and work with this ID. I may have forgotten something.

      <PublisherBanner
        style={sizeOfPublicity}
        adSize="banner"
        validAdSizes={['banner']}
        adUnitID={publicidade[currentApp]}
        testDevices={[PublisherBanner.simulatorId]}
        didFailToReceiveAdWithError={e => {
          setSizeOfPublicity(defaultSizes);
          console.log('Banner:onAdFailedToLoad', e);
        }}
        onAdLoaded={({width, height}) => {
          setSizeOfPublicity({height, width});
          console.log('Banner:onAdLoaded');
        }}
        onAdFailedToLoad={e => {
          setSizeOfPublicity(defaultSizes);
          console.log('Banner:onAdFailedToLoad', e);
        }}
        onAdOpened={() => console.log('Banner:onAdOpened')}
        onAdClosed={() => console.log('Banner:onAdClosed')}
        onAdLeftApplication={() => console.log('Banner:onAdLeftApplication')}
        onAppEvent={event => console.log('Banner:onAppEvent', event)}
      />
fernandopascoalbr commented 4 years ago

the wrong ID was the problem. I'm received this message:

The ad request was successful, but no ad was returned due to lack of ad inventory.

After insert correct ID works fine.