[Admob] Calling an Interstitial close my app

Hi,

I’m trying to integrate Admob to my app. For the full banner there’s no problem but the interstital close my app when my timeOut trigger.

import {
  AdMobBanner,
  AdMobInterstitial,
  PublisherBanner,
  AdMobRewarded
} from 'expo';

AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id
AdMobInterstitial.setTestDeviceID('EMULATOR');

class Home extends React.Component {
    componentDidMount() {
    setTimeout(() => {
      AdMobInterstitial.requestAdAsync();
      AdMobInterstitial.showAdAsync();
    }, 3000);
  }
}

If i put an await before request ad and show add I got an error : await is a reserved word

Thanks for your time

Hey @hotgeart,

You need to change it to setTimeout(async () =>.

Cheers,

Adam

@adamjnav same result

  componentDidMount() {
    setTimeout(async () => {
      await AdMobInterstitial.requestAdAsync();
      await AdMobInterstitial.showAdAsync();
    }, 3000);
  }

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.