Package detail

expo-ads-admob

expo8.9kMIT13.0.0

Provides support for the Google AdMob SDK (https://www.google.com/admob/) for mobile advertising. This module is largely based of the react-native-admob (https://github.com/sbugert/react-native-admob) module, as the documentation and questions surrounding

admob, ads, react-native, expo

readme

expo-ads-admob

Provides support for the Google AdMob SDK (https://www.google.com/admob/) for mobile advertising. This module is largely based of the react-native-admob (https://github.com/sbugert/react-native-admob) module, as the documentation and questions surrounding that module may prove helpful. A simple example implementing AdMob SDK can be found at https://github.com/deadcoder0904/expo-google-admob.

API documentation

Installation in managed Expo projects

For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release.

Installation in bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

expo install expo-ads-admob

Configure for iOS

Run npx pod-install after installing the npm package.

In your app's Info.plist file, add a GADApplicationIdentifier key with a string value of your AdMob app ID, as shown in Google's Mobile Ads SDK iOS docs.

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string>

Add NSUserTrackingUsageDescription key to your Info.plist:

<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>

Add the required SKAdNetworkIdentifier items to your Info.plist: Google SKAdNetwork.

Configure for Android

Ensure that there is a meta-data element inside the application node inside AndroidManifest.xml file (located typically under /android/app/src/main/AndroidManifest.xml) with android:name of "com.google.android.gms.ads.APPLICATION_ID" and a value of your AdMob App ID. Google's Mobile Ads SDK documentation shows precisely how to do this here. In the end your AndroidManifest.xml should look more or less like this:

<manifest>
  <application>
    ...
    <!-- Ensure that tag with this name and proper value is inside application -->
    <meta-data
      android:name="com.google.android.gms.ads.APPLICATION_ID"
      android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/> <!-- App ID -->
    <!-- You can find your App ID in the AdMob UI -->
    ...
  </application>
</manifest>

This package automatically adds the INTERNET permission. It's required to interact with Google's service.

<manifest>
  <!-- Added permissions -->
  <uses-permission android:name="android.permission.INTERNET" />
</manifest>

Contributing

Contributions are very welcome! Please refer to guidelines described in the contributing guide.

changelog

Changelog

Unpublished

🛠 Breaking changes

🎉 New features

🐛 Bug fixes

💡 Others

13.0.0 — 2022-04-18

🛠 Breaking changes

  • Removed AdMobBanner#onAdViewWillLeaveApplication, AdMobInterstitial#interstitialWillLeaveApplication and PublisherBanner#onAdViewWillLeaveApplication callbacks as they are no longer exposed by the native libraries. (#17002 by @bbarthec)

🐛 Bug fixes

  • Fix a crash on startup by setting GADIsAdManagerApp in Info.plist to true. (#16438 by @giautm)

💡 Others

⚠️ Notices

  • On iOS bumped Google-Mobile-Ads-SDK@7.69.0 ➡️ 8.13.0. (#17002 by @bbarthec)
  • On Android bumped com.google.android.gms:play-services-ads:19.4.0 ➡️ 20.5.0. (#17002 by @bbarthec)
  • On Android bump compileSdkVersion to 31, targetSdkVersion to 31 and Java version to 11. (#16941 by @bbarthec)

12.0.1 - 2022-02-01

🐛 Bug fixes

  • Fix Plugin with id 'maven' not found build error from Android Gradle 7. (#16080 by @kudo)

12.0.0 — 2021-12-03

🛠 Breaking changes

  • Remove deprecated setTestDeviceID method. (#15091 by @Simek)

11.0.1 — 2021-10-01

This version does not introduce any user-facing changes.

11.0.0 — 2021-09-28

🛠 Breaking changes

🎉 New features

🐛 Bug fixes

  • Fix building errors from use_frameworks! in Podfile. (#14523 by @kudo)

💡 Others

10.1.0 — 2021-06-16

🎉 New features

🐛 Bug fixes

  • Updated BannerView on Android to not create a new ad request on every layout change. (#12599 by @cruzach)
  • Enable kotlin in all modules. (#12716 by @wschurman)

💡 Others

  • Build Android code using Java 8 to fix Android instrumented test build error. (#12939 by @kudo)
  • Migrated from unimodules-permissions-interface to expo-modules-core. (#12961 by @tsapeta)

10.0.4 — 2021-04-13

This version does not introduce any user-facing changes.

10.0.3 — 2021-03-31

This version does not introduce any user-facing changes.

10.0.2 — 2021-03-30

🎉 New features

10.0.1 — 2021-03-23

🎉 New features

10.0.0 — 2021-03-10

📚 native library updates

  • Updated Google-Mobile-Ads-SDK from 7.55.1 to 7.69.0 on iOS and com.google.android.gms:play-services-ads from 17.2.1 to 19.4.0 on Android. (#12125 by @bbarthec)

🛠 Breaking changes

  • Removed the rewardedVideoWillLeaveApplication event (use AppState instead). (#12125 by @bbarthec)
  • Removed following events: rewardedVideoDidRewardUser, rewardedVideoDidOpen, rewardedVideoDidComplete, rewardedVideoDidClose, rewardedVideoDidStart and introduced: rewardedVideoUserDidEarnReward, rewardedVideoDidPresent, rewardedVideoDidFailToPresent, rewardedVideoDidDismiss. (#12125 by @bbarthec)

🎉 New features

  • Updated Android build configuration to target Android 11 (added support for Android SDK 30). (#11647 by @bbarthec)

🐛 Bug fixes

9.0.0 — 2021-01-15

🛠 Breaking changes

🎉 New features

8.4.0 — 2020-11-17

This version does not introduce any user-facing changes.

8.3.0 — 2020-08-18

🎉 New features

8.2.1 — 2020-05-29

This version does not introduce any user-facing changes.

8.2.0 — 2020-05-27

This version does not introduce any user-facing changes.