Native ads are ad assets that are presented to users through UI components that are native to the platform. They're shown using the same types of views with which you're already building your layouts, and can be formatted to match your app's visual design.
When a native ad loads, your app receives an ad object that contains its assets, and the app — rather than the Google Mobile Ads SDK — is responsible for displaying them.
Broadly speaking, there are two parts to successfully implementing native ads: Loading an ad using the SDK and then displaying the ad content in your app.
Complete consent and SDK initialization before calling NativeAd.createForAdRequest() or letting
useNativeAd load (autoLoad: consentReady). See Consent & privacy basics and
the shared load best practices.
For a one-request native-or-banner competitive load (GAM, count 1), or an emulated display pool that keeps one ready fill, see Preload pools and multi-format recipes.
In a React component, load with the useNativeAd hook. It owns the NativeAd: it destroys the ad
when the component unmounts or when adUnitId / requestOptions change, including a load that
resolves after unmount. For testing, use a Test ID; in production, use the ID from the Google AdMob
dashboard under "Ad units":
import { TestIds, useNativeAd } from 'react-native-google-mobile-ads';
const { status, nativeAd, error, retry, destroy } = useNativeAd({
adUnitId: TestIds.NATIVE,
autoLoad: consentReady,
});statusis'idle','loading','loaded','no-fill', or'error'.nativeAdis non-null only whenstatusis'loaded';erroris set for'no-fill'and'error'.autoLoaddefaults totrue. Set it tofalseuntil consent is resolved. Turning it back off stops future automatic loads only; it does not destroy a loaded ad.retry()loads again (after'no-fill'/'error', or the first load whenautoLoadis false). Automatic loading never retries on its own.destroy()destroys the owned ad and returns to'idle'without loading again. Do not callnativeAd.destroy()yourself on an ad the hook owns.
Outside React, call the NativeAd.createForAdRequest static method directly. It returns a promise
that resolves with a NativeAd object, and you own destroy():
const nativeAd = await NativeAd.createForAdRequest(TestIds.NATIVE);Native ads have many advanced features that allow you to make additional customizations to create the best possible ad experience.
Pass an optional NativeAdRequestOptions object as requestOptions to useNativeAd, or as the
second argument to NativeAd.createForAdRequest, to customize the ad request:
NativeAd.createForAdRequest(TestIds.NATIVE, {
aspectRatio: NativeMediaAspectRatio.LANDSCAPE,
});Media Aspect Ratio Controls let you specify a preference for the aspect ratio of ad creatives.
Use of this API does not guarantee that all ad creatives will meet the preference specified.
Specify requestOptions.aspectRatio with a NativeMediaAspectRatio enum value when calling NativeAd.createForAdRequest.
- When unset, the returned ad can have any media aspect ratio.
- When set, you will be able to improve the user experience by specifying the preferred type of aspect ratio.
The following example instructs the SDK to prefer a return image or video with a specific aspect ratio.
NativeAd.createForAdRequest(TestIds.NATIVE, {
aspectRatio: NativeMediaAspectRatio.LANDSCAPE,
});The AdChoices position controls lets you choose which corner to render the AdChoices icon.
Specify requestOptions.adChoicesPlacement with a NativeAdChoicesPlacement enum value when calling NativeAd.createForAdRequest.
- If unset, the AdChoices icon position is set to the top right.
- If set, AdChoices is placed at the custom position as requested.
The following example demonstrates how to set a custom AdChoices image position.
NativeAd.createForAdRequest(TestIds.NATIVE, {
adChoicesPlacement: NativeAdChoicesPlacement.TOP_LEFT,
});The start muted behavior lets you disable or enable a video's starting audio.
Specify requestOptions.startVideoMuted with a boolean value when calling NativeAd.createForAdRequest.
- The start muted behavior is enabled by default.
- When disabled, your app requests the video should begin with audio.
- When enabled, your app requests that the video should begin with audio muted.
The following example shows how to start the video with unmuted audio.
NativeAd.createForAdRequest(TestIds.NATIVE, {
startVideoMuted: false,
});You can specify other request options to be sent while loading an advert, such as keywords and content URLs. Setting additional request options helps AdMob choose better tailored ads from the network. View the RequestOptions source code to see the full range of options available.
When a native ad loads, your app is then responsible for displaying the ad (though it doesn't necessarily have to do so immediately). To make displaying system-defined ad formats easier, the SDK offers some useful resources, as described below.
For the NativeAd format, there is the corresponding NativeAdView component.
This component is a wrapper component that publishers should use as the root for the NativeAd.
A single NativeAdView corresponds to a single native ad.
Each view used to display that ads assets should be placed within the view hierarchy of the NativeAdView component.
Pass the NativeAd object to the nativeAd prop of the NativeAdView component to register the ad view:
import { NativeAdView, TestIds, useNativeAd } from 'react-native-google-mobile-ads';
const NativeComponent = ({ consentReady }: { consentReady: boolean }) => {
const { nativeAd } = useNativeAd({ adUnitId: TestIds.NATIVE, autoLoad: consentReady });
if (!nativeAd) {
return null;
}
return (
<NativeAdView nativeAd={nativeAd}>
{/* Components to display assets must be placed here */}
</NativeAdView>
);
};NativeAsset component, which should be placed within the view hierarchy of a NativeAdView, is used to register the view used for each individual asset.
Registering the views in this way allows the SDK to automatically handle tasks such as:
- Recording clicks.
- Recording impressions (when the first pixel is visible on the screen).
- Displaying the AdChoices overlay.
NativeAsset component is a headless component, which means the component does not have UI implementation.
Customize your UI components as needed and place them inside the NativeAsset component, setting the assetType prop to the asset type you are displaying:
const NativeComponent = ({ consentReady }: { consentReady: boolean }) => {
const { nativeAd } = useNativeAd({ adUnitId: TestIds.NATIVE, autoLoad: consentReady });
if (!nativeAd) {
return null;
}
return (
<NativeAdView nativeAd={nativeAd}>
<NativeAsset assetType={NativeAssetType.HEADLINE}>
<Text>{nativeAd.headline}</Text>
</NativeAsset>
</NativeAdView>
);
};Place the asset view(such as Text, Image component) as a direct child of the NativeAsset
component. See more in Caveats: NativeAsset placement section.
Main image and video assets are displayed to users via NativeMediaView. It should be placed within the view hierarchy of a NativeAdView, as with any other asset view.
Unlike other asset views, the NativeMediaView automatically populates its content.
const NativeComponent = () => {
return (
<NativeAdView nativeAd={nativeAd}>
<NativeMediaView />
{/* Other assets */}
</NativeAdView>
);
};The NativeMediaView component respects the resizeMode property when displaying images. The resizeMode defaults to cover.
Supports the following values:
cover: Scale the image uniformly (maintain the image's aspect ratio) so that:- Both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding)
- At least one dimension of the scaled image will be equal to the corresponding dimension of the view (minus padding)
contain: Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding).stretch: Scale width and height independently, This may change the aspect ratio of the source image.
NativeMediaView's aspectRatio style property is set to nativeAd.mediaContent.aspectRatio by
default.
const NativeComponent = () => {
return (
<NativeAdView nativeAd={nativeAd}>
<NativeMediaView resizeMode={'contain'} style={{ aspectRatio: 1 }} />
{/* Other assets */}
</NativeAdView>
);
};An AdChoices overlay is added as an ad view by the SDK when a backfill ad is returned. If your app uses native ads backfill, leave space in your preferred corner of your native ad view for the automatically inserted AdChoices logo. Also, it's important that the AdChoices overlay is seen, so choose background colors and images appropriately. For more information on the overlay's appearance and function, refer to the programmatic native ads implementation guidelines.
When displaying programmatic native ads, you must display an ad attribution to denote that the view is an advertisement. Learn more in policy guidelines.
These are the steps for displaying a native ad:
- Place the
NativeAdView, register it by setting thenativeAdprop to the NativeAd object. - For each ad asset to be displayed:
- Populate the asset view with the asset in the
NativeAdobject. - Register the asset view by wrapping it with the
NativeAssetcomponent.
- Populate the asset view with the asset in the
- Place the
NativeMediaViewinside your native ad layout to display media asset.
const NativeComponent = ({ consentReady }: { consentReady: boolean }) => {
const { status, nativeAd, retry } = useNativeAd({
adUnitId: TestIds.NATIVE,
autoLoad: consentReady,
});
if (status === 'no-fill' || status === 'error') {
return <Button title="Retry" onPress={retry} />;
}
if (!nativeAd) {
return null;
}
return (
<NativeAdView nativeAd={nativeAd}>
{/* Register every displayed asset inside NativeAdView. */}
{nativeAd.icon && (
<NativeAsset assetType={NativeAssetType.ICON}>
<Image source={{ uri: nativeAd.icon.url }} width={24} height={24} />
</NativeAsset>
)}
<NativeAsset assetType={NativeAssetType.HEADLINE}>
<Text style={{ fontSize: 18, fontWeight: 'bold' }}>{nativeAd.headline}</Text>
</NativeAsset>
<NativeAsset assetType={NativeAssetType.CALL_TO_ACTION}>
<Text style={{ padding: 8 }}>{nativeAd.callToAction}</Text>
</NativeAsset>
{/* Always display an ad attribution. */}
<Text>Sponsored</Text>
<NativeMediaView />
{/* Repeat the registration pattern for the other assets. */}
</NativeAdView>
);
};The NativeAd object emits events that you can listen to.
Use the addAdEventListener method to listen to ad events emitted by the NativeAd. Pass one of the NativeAdEventType enum values to specify the event type.
Check the NativeAdEventType source code to see the full range of events available.
Forward NativeAdEventType.PAID payloads to your
revenue telemetry pipeline.
import { useEffect } from 'react';
import {
NativeAdEventType,
NativeAdView,
TestIds,
useNativeAd,
} from 'react-native-google-mobile-ads';
const NativeComponent = ({ consentReady }: { consentReady: boolean }) => {
const { nativeAd } = useNativeAd({ adUnitId: TestIds.NATIVE, autoLoad: consentReady });
useEffect(() => {
if (!nativeAd) return;
const clickedListener = nativeAd.addAdEventListener(NativeAdEventType.CLICKED, () => {
console.log('Native ad clicked');
});
const paidListener = nativeAd.addAdEventListener(NativeAdEventType.PAID, event => {
console.log('Native ad revenue', event.value, event.currency);
});
return () => {
clickedListener.remove();
paidListener.remove();
};
}, [nativeAd]);
if (!nativeAd) {
return null;
}
return (
<NativeAdView nativeAd={nativeAd}>
{/* Components to display assets must be placed here */}
</NativeAdView>
);
};Always destroy the NativeAd object when it is no longer needed to free up resources.
Calling destroy also removes all event listeners registered on the NativeAd object.
useNativeAd does this for you on unmount and when the request changes; call its destroy() to
drop the ad early. If you created the ad yourself with NativeAd.createForAdRequest, you own it:
const nativeAd = await NativeAd.createForAdRequest(TestIds.NATIVE);
// ...render it in <NativeAdView nativeAd={nativeAd}>...
nativeAd.destroy();Place the asset view(such as Text, Image component) as a direct child of the NativeAsset component,
and do not wrap the asset view with another view.
The SDK automatically handles tasks such as recording / handling clicks on the asset view.
Wrapping the asset view with another view can interfere with these tasks.
Do:
<NativeAsset assetType={NativeAssetType.CALL_TO_ACTION}>
<Text style={{ padding: 8 }}>{nativeAd.callToAction}</Text>
</NativeAsset>
<NativeAsset assetType={NativeAssetType.ICON}>
<Image source={{ uri: nativeAd.icon.url }} width={24} height={24} style={{ borderRadius: 8 }} />
</NativeAsset>Don't:
<NativeAsset assetType={NativeAssetType.CALL_TO_ACTION}>
<TouchableOpacity style={{ padding: 8 }}>
<Text>{nativeAd.callToAction}</Text>
</TouchableOpacity>
</NativeAsset>
<NativeAsset assetType={NativeAssetType.ICON}>
<View style={{ borderRadius: 8, overflow: 'hidden' }}>
<Image source={{ uri: nativeAd.icon.url }} width={24} height={24} />
</View>
</NativeAsset>Use NativeAssetType.CALL_TO_ACTION (wire value 'callToAction') and nativeAd.callToAction.
There is no NativeAssetType.CTA or nativeAd.cta — those names never register the view with the
SDK, so the button appears but does not open the click URL.
You can preload several NativeAd instances and render them from a FlatList (or similar recycled list). When a cell reuses the same NativeAdView tree for a different ad, NativeAsset re-registers its views whenever nativeAd.responseId changes so SDK click handling stays attached. Prefer a stable key per ad (for example nativeAd.responseId) when the row should remount instead of rebind.
Only views wrapped in NativeAsset (or NativeMediaView) are registered as GMA clickable assets.
Do not wrap the entire NativeAdView layout in a single NativeAsset, and do not stretch one
asset view across empty padding — that invents clickable white space and can conflict with AdMob
policy. Decorative spacers and non-asset chrome should stay outside NativeAsset.
On Android, NativeMediaView needs a non-zero laid-out size while the page is visible before GMA can paint video. Prefer showing media from nativeAd.mediaContent (and give the view width + aspectRatio or an explicit height) rather than gating only on nativeAd.images:
{/* prettier-ignore */}
{(nativeAd.mediaContent?.hasVideoContent || (nativeAd.images?.length ?? 0) > 0) && (
<NativeMediaView style={{ width: '100%' }} />
)}If a pager cell still briefly stays black, ensure the media view is mounted inside NativeAdView for that page (not swapped in only after images load) and that the cell is not display: 'none' / zero-height when it becomes the active page.
Play Console stacks that show
JavaTurboModule::setEventEmitterCallback →
NativeGoogleMobileAdsNativeModuleSpecJSI →
RNGoogleMobileAdsSpec_ModuleProvider on armeabi-v7a (often signed release / Play
splits) are a React Native host bug, not a defect in this library’s native module
implementation.
Native ads declare a Codegen EventEmitter (onAdEvent). During TurboModule
construction, React Native’s C++ layer calls Java setEventEmitterCallback. On 32-bit
ARM, the pre-fix path used variadic JNI CallVoidMethod, which is unsafe for that ABI
and can SIGSEGV in art::ArgArray::BuildArgArrayFromVarArgs.
The fix replaces that call with CallVoidMethodA
(PR #51695, backported to the
0.79.6 line and present in later releases including this package’s peer baseline
React Native ≥ 0.86.0).
This package cannot patch libreactnative.so inside the app. If you still see the
stack:
- Confirm the crash ABI is
armeabi-v7a(or another 32-bit split) and the frames above. - Upgrade the host React Native to ≥ 0.79.6 (Expo: a SDK build whose RN patch includes that backport), or to this package’s peer ≥ 0.86.0.
- Rebuild and ship a new binary; Play Console stacks from older RN builds will keep appearing until those installs update.
- If the same stack persists on a patched RN version, escalate to React Native with the
full tombstone and your exact
react-nativeversion — do not expect a library-only workaround that disables the native-ad EventEmitter.
Reports that describe the same frames as Android ≤10-only (or as a missing Android EventEmitter stub) are the same host bug — older OS versions correlate with 32-bit devices, not an API-level or library stub gap (#757, #771, #754).
FlatList, FlashList, and similar lists reuse cell component instances. React state inside a recycled cell survives the row change. A card that loads once in useEffect([]) and deliberately avoids remount keys will keep showing the previous row's NativeAd after scroll — that looks like "the same ad repeating," even when each mount once called NativeAd.createForAdRequest.
Load against list-item identity (or remount the card):
function NativeAdCard({ itemId, adUnitId }: { itemId: string; adUnitId: string }) {
const [nativeAd, setNativeAd] = useState<NativeAd>();
useEffect(() => {
let cancelled = false;
let loaded: NativeAd | undefined;
NativeAd.createForAdRequest(adUnitId)
.then(ad => {
if (cancelled) {
ad.destroy();
return;
}
loaded = ad;
setNativeAd(ad);
})
.catch(console.error);
return () => {
cancelled = true;
loaded?.destroy();
setNativeAd(undefined);
};
}, [itemId, adUnitId]);
if (!nativeAd) {
return null;
}
return <NativeAdView nativeAd={nativeAd}>{/* assets */}</NativeAdView>;
}
// Remount path: key the card so FlashList cannot keep stale JS state for a new row.
// <NativeAdCard key={item.id} itemId={item.id} adUnitId={unitId} />Prefer a preload pool when many feed slots need warm inventory: poll/bind a ready NativeAd per visible slot and destroy() (or return to pool policy) when the slot leaves. See
Preload pools and multi-format recipes (AdPoolPresets.display).
When a cell does reuse the same NativeAdView tree while you swap a different preloaded NativeAd, the library rebinds: NativeAdView passes the new responseId, and NativeAsset re-registers whenever nativeAd.responseId changes so SDK click handling stays attached. Prefer a stable React key per ad (for example nativeAd.responseId) when the row should remount instead of rebind.
No uniqueness guarantee. Each successful createForAdRequest is a separate load request. The ad server may still return the same creative for adjacent slots. This package cannot force distinct creatives; treat back-to-back duplicates after correct per-item load/destroy as fill inventory, not a view-recycling bug.
On Android, this package does not build click Intents or set FLAG_ACTIVITY_NEW_TASK.
Google Mobile Ads owns click handling once assets are registered on NativeAdView. The tip
constructs that SDK view with the current Activity (same mediation guidance as banner
AdView) and defers construction until an Activity is attached — a non-Activity
ReactContext / Application context forces the SDK to add FLAG_ACTIVITY_NEW_TASK, which
can leave a blank app card in Recents while the destination URL still opens, and make
later taps need multiple tries until that blank task is closed. Assets registered before
Activity attach are queued and flushed once the SDK NativeAdView is created.
Related hit-testing / registration work (AdChoices overlay elevation, clearing asset
clickable, FlatList rebind) is separate: see click-ownership notes earlier on this page
(Registered assets only).
If you still see a blank Recents instance with a current tip build:
- Confirm
MainActivityis resumed when the native ad mounts (cold-start trees defer SDKNativeAdViewuntil an Activity is attached). - Check host
AndroidManifest.xmlMainActivityandroid:launchMode. React Native / Expo templates often usesingleTaskfor deep links; that mode interacts with how Google'sAdActivity/ Custom Tabs and anyhttpsintent-filters onMainActivityshare tasks. PrefersingleTopwhen compatible — see Android: fullscreen ads closing after Home → resume. - If an ad destination matches your app's App Links / intent-filters, the system may route the click into your activity instead of the browser; that is host deep-link configuration, not tip intent flags.
- Re-test with Google test units on tip-pinned GMA (
packages/core/package.jsonsdkVersions.android). If a minimal native AdMob sample still duplicates a blank task on the same device / OS /launchMode, escalate to Google with Mobile Ads SDK logs.
This package cannot override Google's click Intent flags or keep a host singleTask
manifest from clearing / stacking activities around SDK chrome.
These features are not implemented in the current version:
- Custom Ad Choices view
- Custom video playback controls
- Custom click gestures
- Custom native ad formats