概要
React Native Google Mobile Adsを使うと、AdMobでアプリを収益化できます。
Web・アプリ開発計測したスター増加
- 24時間
- 0
- 7日間
- +1
- 15日間
- 0
- 1か月
- +3
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルReact Native Google Mobile Ads
React Native Google Mobile Ads lets you monetize your app with Google AdMob or Google Ad Manager. It wraps the native Google Mobile Ads SDKs for iOS and Android.
[!IMPORTANT] Use React Native 0.86 or newer with the New Architecture turned on. If the New Architecture is off, the native install fails. A missing app ID crashes startup or fails the build. The package has native code, so Expo Go cannot run it. Check out Prerequisites for more information.
Install
Prompt your agent:
Read https://docs.page/invertase/react-native-google-mobile-ads/prerequisites.md, then https://docs.page/invertase/react-native-google-mobile-ads/installation/expo.md (use …/installation/react-native.md for bare RN CLI), then https://docs.page/invertase/react-native-google-mobile-ads/consent-basics.md, https://docs.page/invertase/react-native-google-mobile-ads/initialization.md, and https://docs.page/invertase/react-native-google-mobile-ads/first-ad.md. After install, read node_modules/react-native-google-mobile-ads/AGENTS.md. React Native 0.86 or newer. New Architecture required. Consent before initialize. Test ad units until the integration is verified.
Or set it up yourself with Expo:
Install the package. This also installs the development client.
npx expo install react-native-google-mobile-ads expo-dev-clientAdd your AdMob app IDs to the config plugin in
app.json, then create a development build. The module does not run in Expo Go.{ "expo": { "plugins": [ [ "react-native-google-mobile-ads", { "androidAppId": "ca-app-pub-xxxxxxxx~xxxxxxxx", "iosAppId": "ca-app-pub-xxxxxxxx~xxxxxxxx" } ] ] } }Gather consent, initialize the SDK, and show your first ad. Getting Started is that path.
Bare React Native CLI projects start at Install with React Native CLI.
Consent and test ads
Before you initialize, gather consent. The Consent and privacy page and the Initialize the software development kit page describe that order.
Until you verify the integration, use test ad units. The Test ads page shows a test unit for one format.
Native implementation status
Every surface below works on the New Architecture. Surfaces marked To-Do still run through React Native's interoperability layer and have not yet been ported to a native Turbo Module or Fabric component. The port does not change the JavaScript API.
| Platform | Feature | Status |
|---|---|---|
| iOS | Mobile Ads SDK Methods (Turbo Native Module) | ✅ Complete |
| iOS | Banners (Fabric Native Component) | ✅ Complete |
| iOS | Full Screen Ads (Turbo Native Module) | ✅ Complete |
| iOS | Native Ads (Turbo Native Module, Fabric Native Component) | ✅ Complete |
| iOS | User Messaging Platform (Turbo Native Module) | ✅ Complete |
| iOS | EventEmitter (Turbo Native Module) | ⏳ To-Do |
| Android | Mobile Ads SDK Methods (Turbo Native Module) | ⏳ To-Do |
| Android | Banners (Fabric Native Component) | 🟡 Partial: multi-format banner ported, standard banner To-Do |
| Android | Full Screen Ads (Turbo Native Module) | ⏳ To-Do |
| Android | Native Ads (Turbo Native Module, Fabric Native Component) | ✅ Complete |
| Android | User Messaging Platform (Turbo Native Module) | ✅ Complete |
| Android | EventEmitter (Turbo Native Module) | ⏳ To-Do |
More information
- Ad formats to understand each format.
- Migrating to v17 to upgrade from an older release.
- Reference API to read the generated reference.
Contributing
License
Apache-2.0. The terms are in the LICENSE file.
関連プロジェクトを探す
読み込み中…