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

Admob does not display banners

Open digitaledge opened this issue 8 years ago • 2 comments

Issue

Admob banners do not render when using real appid and unit ids.

This happens with the types "BANNER", "FULL_BANNER", "LARGE_BANNER", "LEADERBOARD" and "SMART_BANNER". Just the "MEDIUM_RECTANGLE" works.

Weird is.. it always works with using admob test ids and about 1 of 100 times it works with the real ones. But when it works with real ids, then it will stop with the next render.

I did double check my Admob settings, theres no frequency capping set for those units. So i believe this must be a bug with this lib.

My code looks like: ` firebase.admob().initialize('ca-app-pub-**********************'); <<=== in the main component

const Banner = firebase.admob.Banner; const AdRequest = firebase.admob.AdRequest; const request = new AdRequest(); request.addKeyword('somekeyword'); request.addKeyword('anotherkeyword');

export const SearchBanner = () => { return ( <Banner unitId='ca-app-pub-************************' size={"LARGE_BANNER"} request={request.build()} onAdLoaded={() => { // some custom functions here, this is never triggered }} /> ); } `

Environment

Android & iOS (Dev & Release)

  1. Application Target Platform:

macOS HighSierra

  1. Development Operating System:

Xcode and Android Studio

  1. React Native version:

0.53.0

  1. RNFirebase Version:

3.2.2

  1. Firebase Module:

Admob

digitaledge avatar Feb 15 '18 01:02 digitaledge

Does onAdFailedToLoad get called at all?

Ehesp avatar Feb 28 '18 21:02 Ehesp

I did not notice that there is a onAdFailedToLoad prop, thanks for this hint.

We can close this issue, because the returned error is: "Error: The ad request was successful, but no ad was returned due to lack of ad inventory."

It seems that admob has not that much inventory for the banner formats.

digitaledge avatar Mar 01 '18 02:03 digitaledge