AMOS React Native AdMob
AdMob paid-event revenue is captured automatically by the native AMOS wrapper. Use getRevenueHealth() from the native module or useAmos() context to inspect privacy-safe pending, retry, acknowledgement, and queue-capacity diagnostics.
React Native bindings for AMOS-managed AdMob ads plus AMOS core decisions, events, and metrics.
Use this package when AMOS should configure, preload, request, and show AdMob placements.
import {
AmosBannerAd,
AmosProvider,
BannerAdSize,
useAmosRewardedAd,
} from '@amos-sdk/react-native-admob';
export function Root() {
return (
<AmosProvider
config={{
apiKey: 'AMOS_API_KEY',
appId: 'app_example',
userId: 'publisher-user-123',
lifecycle: {
automatic: true,
sessionTimeoutSeconds: 1800,
configRefreshIntervalSeconds: 300,
},
admob: {
rewardedGroups: {
default: { unitIds: ['ca-app-pub-xxx/111'], preloadOnInit: true },
watermark_remove: {
unitIds: ['ca-app-pub-xxx/222'],
preloadOnInit: true,
allowFallbackToDefault: true,
},
},
},
}}
>
<App />
</AmosProvider>
);
}
function RemoveWatermarkButton() {
const rewarded = useAmosRewardedAd('watermark_remove');
return <Button title="Watch ad" onPress={() => rewarded.show()} />;
}
function HomeBanner() {
return <AmosBannerAd size={BannerAdSize.ANCHORED_ADAPTIVE_BANNER} />;
}
The lifecycle block is optional; the values above are the defaults. Android lifecycle handling is automatic, including stale policy refresh and inactivity-based session rollover. Do not end the AMOS session from a React Native AppState listener. Call refreshConfiguration() from useAmos() only for an immediate QA or critical-policy refresh.
Google Play purchases
The provider context also exposes recordGooglePlayPurchase. Call it after Play Billing reports a successful purchase, using a deterministic event ID for retries:
await useAmos().recordGooglePlayPurchase({
clientEventId: `gplay:${purchase.productId}:${purchase.transactionId}`,
packageName: 'com.example.app',
productId: purchase.productId,
productType: 'ONE_TIME',
purchaseToken: purchase.purchaseToken,
});
The result confirms durable local queueing; RTDN and Developer API verification determine the final purchase lifecycle.
Exported AdMob helpers:
AmosBannerAdAmosNativeAdCardAmosAppOpenAdGateuseAmosInterstitialAduseAmosRewardedAduseAmosAppOpenAduseAmosAdMobRequestBannerAdSize
The Android wrapper resolves the AdMob Maven artifact from this package's amosSdkVersion field:
implementation("com.amostack:amos-sdk-admob:<amosSdkVersion>")
For decisions and tracking without AMOS-managed ads, install @amos-sdk/react-native.
The native package namespace remains com.amostack.amos... for Android compatibility.