Expo

Documentation

Admob

Expo includes support for the Google AdMob SDK for mobile advertising. This module is largely based of the react-native-admob module, as the documentation and questions surrounding that module may prove helpful. A simple example implementing AdMob SDK can be found here.
Platform Compatibility
Android DeviceAndroid EmulatoriOS DeviceiOS SimulatorWeb

For managed apps, you'll need to run expo install expo-ads-admob. To use it in a bare React Native app, follow its installation instructions.

For the module to attribute interactions with ads to your AdMob app properly you will need to add a googleMobileAdsAppId property to app.json under [platform].config. More info on where to find the app ID can be found in this Google Support answer. A sample valid app.json would look like:
{
  "expo": {
    "name": "Ads Showcase",
    // ...
    "android": {
      // ...
      "config": {
        // ...
        "googleMobileAdsAppId": "ca-app-pub-3940256099942544~3347511713" // sample id, replace with your own
      }
    },
    "ios": {
      // ...
      "config": {
        // ...
        "googleMobileAdsAppId": "ca-app-pub-3940256099942544~1458002511" // sample id, replace with your own
      }
    }
  }
}

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

// Display a banner
<AdMobBanner
  bannerSize="fullBanner"
  adUnitID="ca-app-pub-3940256099942544/6300978111" // Test ID, Replace with your-admob-unit-id
  testDeviceID="EMULATOR"
  servePersonalizedAds // true or false
  onDidFailToReceiveAdWithError={this.bannerError} />

// Display a DFP Publisher banner
<PublisherBanner
  bannerSize="fullBanner"
  adUnitID="ca-app-pub-3940256099942544/6300978111" // Test ID, Replace with your-admob-unit-id
  testDeviceID="EMULATOR"
  onDidFailToReceiveAdWithError={this.bannerError}
  onAdMobDispatchAppEvent={this.adMobEvent} />

// Display an interstitial
AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id
AdMobInterstitial.setTestDeviceID('EMULATOR');
await AdMobInterstitial.requestAdAsync({ servePersonalizedAds: true});
await AdMobInterstitial.showAdAsync();

// Display a rewarded ad
AdMobRewarded.setAdUnitID('ca-app-pub-3940256099942544/5224354917'); // Test ID, Replace with your-admob-unit-id
AdMobRewarded.setTestDeviceID('EMULATOR');
await AdMobRewarded.requestAdAsync();
await AdMobRewarded.showAdAsync();

The default behavior of the Google Mobile Ads SDK is to serve personalized ads. If a user has consented to receive only non-personalized ads, you can configure the view to specify that only non-personalized ads should be requested. Adding servePersonalizedAds property causes non-personalized ads to be requested regardless of whether or not the user is in the EEA. The default is false — ads won't be personalized.

Prop valueDescriptionSize
bannerStandard Banner for Phones and Tablets320x50
largeBannerLarge Banner for Phones and Tablets320x100
mediumRectangleIAB Medium Rectangle for Phones and Tablets300x250
fullBannerIAB Full-Size Banner for Tablet468x60
leaderboardIAB Leaderboard for Tablets728x90
smartBannerPortraitSmart Banner for Phones and Tablets (default)Screen width x 32
smartBannerLandscapeSmart Banner for Phones and TabletsScreen width x 32
Note: There is no smartBannerPortrait and smartBannerLandscape on Android. Both prop values will map to smartBanner

Prop
onAdViewDidReceiveAd()
onDidFailToReceiveAdWithError(errorDescription: string)
onAdViewWillPresentScreen()
onAdViewWillDismissScreen()
onAdViewDidDismissScreen()
onAdViewWillLeaveApplication()

NameDescription
setAdUnitID(adUnitID)sets the AdUnit ID for all future ad requests.
setTestDeviceID(deviceID)sets the test device ID
requestAdAsync(options)requests an interstitial and resolves when interstitialDidLoad or interstitialDidFailToLoad event fires. An optional options object argument may specify servePersonalizedAds: true value — then ads will be personalized.
showAdAsync()shows an interstitial if it is ready and resolves when interstitialDidOpen event fires
getIsReadyAsync()resolves with boolean whether interstitial is ready to be shown
For simulators/emulators you can use 'EMULATOR' for the test device ID.

Unfortunately, events are not consistent across iOS and Android. To have one unified API, new event names are introduced for pairs that are roughly equivalent.
iOSthis libraryAndroid
interstitialDidReceiveAdinterstitialDidLoadonAdLoaded
interstitial:didFailToReceiveAdWithErrorinterstitialDidFailToLoadonAdFailedToLoad
interstitialWillPresentScreeninterstitialDidOpenonAdOpened
interstitialDidFailToPresentScreen
interstitialWillDismissScreen
interstitialDidDismissScreeninterstitialDidCloseonAdClosed
interstitialWillLeaveApplicationinterstitialWillLeaveApplicationonAdLeftApplication
Note that interstitialWillLeaveApplication and onAdLeftApplication are not exactly the same but share one event in this library.

Opens a rewarded AdMob ad.

NameDescription
setAdUnitID(adUnitID: string)sets the AdUnit ID for all future ad requests.
setTestDeviceID(testDeviceID: string)sets the test device ID
requestAdAsync(options)(async) requests a rewarded ad. An optional options object argument may specify servePersonalizedAds: true value — then ad will be personalized.
showAdAsync()(async) shows a rewarded if it is ready (async)

iOSthis libraryAndroid
rewardBasedVideoAd:didRewardUserWithRewardrewardedVideoDidRewardUseronRewarded
rewardBasedVideoAdDidReceiveAdrewardedVideoDidLoadonRewardedVideoAdLoaded
rewardBasedVideoAd:didFailToLoadWithErrorrewardedVideoDidFailToLoadonRewardedVideoAdFailedToLoad
rewardBasedVideoAdDidOpenrewardedVideoDidOpenonRewardedVideoAdOpened
rewardedVideoDidCompleteonRewardedVideoCompleted
rewardBasedVideoAdDidCloserewardedVideoDidCloseonRewardedVideoAdClosed
rewardBasedVideoAdWillLeaveApplicationrewardedVideoWillLeaveApplicationonRewardedVideoAdLeftApplication
rewardBasedVideoAdDidStartPlayingrewardedVideoDidStartonRewardedVideoStarted