React-native-admob: Implement interstitial support for iOS

Created on 26 Feb 2016  ·  13Comments  ·  Source: sbugert/react-native-admob

Hi sbugert,

I tried to add react-native-admob into my app (Android work perfectly), Banner on iOS is good but Admob Interstitial did not work on iOS.

Is that function is still fixing?

Thanks for your support

enhancement help wanted

Most helpful comment

Hi magicvn,

Unfortunately, Interstitial support for iOS is not yet implemented.
I'm pretty busy these days though so I can't do it until mid march, maybe sooner.

Hope that works for you!

All 13 comments

Hi magicvn,

Unfortunately, Interstitial support for iOS is not yet implemented.
I'm pretty busy these days though so I can't do it until mid march, maybe sooner.

Hope that works for you!

Hi, @sbugert

I'm so interesting in this project, should I know when do you plan to implement the Interstitial Ads.

I think the Interstitial should prepare first and then display to user. :-)

Hi @xing-zheng
It's nice to hear that you are interested in this project :-)

I had planned that it would already be done by now, but I will take care of it real soon.

That's exactly how I want to implement and how I wrote it in this PR.

@sbugert Great!

@sbugert looking forward to it! Thank you!

So I finally got around to finish the iOS version in commit 68616843fb086e.

It's still the simple "Try to show and forget" API but at least the android and iOS versions are now on a par.
I have not yet come to a conclusion what the new API should be like. Any ideas and help are appreciated!

What I had in mind:
the interstitial is a singleton because only one can be shown at a time anyway

  • setAdUnitId(adUnitId) – set the Ad Unit ID for the interstitial
  • setTestDeviceId(testDeviceId)
  • requestAd(callback) – request the ad, callback gets called when the ad is loaded
  • isReady() – returns the state of the ad (whether the ad is already loaded)
  • showAd(callback) – immediately shows the interstitial, but only if it is ready. The callback gets called when the user dismisses the interstitial

I think of this as a low level api. In javascript we could then build on top it (e.g. it immediately starts loading a new interstitial after the old one gets dismissed)

Any opinions? Did I miss a use case which can't be done with this api?
I would like this to be a community thing because I don't have enough experience with admob to decide this on my own. :-)

Sorry, I made a mistake in the last commit, should be working now!

Thank you! @sbugert

Hi sbugert,

Is AdMobInterstitial on iOS working now? Can't wait to test it. 👍

It very cool,

Thanks sbugert again!

screen shot 2016-04-18 at 10 30 57 am

I'm glad that it works for you!

I will put some more thoughts into the new API and report back.
AdMobInterstitial.tryShowNewInterstitial() method will probably be deprecated then because it will be as simple as AdMobInterstitial.requestAd(() => AdMobInterstitial.showAd()) with the new API if you really need it.
I guess the more common use case (and recommended in the google docs) is to tie it to a specific user action like navigating to another view or closing a menu.

Working great for me!! Thanks @sbugert !!

I just published the new intestitials API, some feedback would be great! 👍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kanekotic picture kanekotic  ·  6Comments

MohsinTariq10 picture MohsinTariq10  ·  6Comments

talaikis picture talaikis  ·  3Comments

lydongray picture lydongray  ·  4Comments

danvass picture danvass  ·  6Comments