invertase/react-native-google-mobile-ads
关于
React Native Google Mobile Ads 可让你通过 AdMob 实现应用变现。
网站与应用开发实测星标增长
- 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.
探索相关项目
加载中…