Returns the asset named assetName (exact, case-sensitive), or null when missing.
Returns the image asset named assetName (exact, case-sensitive), or null when the creative
has no such image asset.
Returns the text asset named assetName (exact, case-sensitive), or null when the creative
has no such text asset.
Reports a click on assetName to Google Ad Manager. The library never navigates.
With clickHandling: 'app' the SDK records the click and calls the custom click handler
instead of navigating, which emits NativeAdEventType.CUSTOM_CLICK. Navigate however the app
prefers once this resolves (deep link, router, in-app browser, …).
With clickHandling: 'sdk' the SDK navigates to the creative's own click-through.
Resolves once the SDK has been told about the click. Rejects when the ad is unknown to native
(for example after destroy()).
Records an impression. Call once the ad is visible; the SDK drops repeats for the same ad.
StaticcreateLoads a Google Ad Manager custom native ad.
import { CustomNativeAd, NativeAdEventType } from 'react-native-google-mobile-ads';
const ad = await CustomNativeAd.createForAdRequest('/1234/carousel', {
customFormatIds: ['12345678'],
});
const cta = ad.getText('Calltoaction');
const image = ad.getImage('Secondaryimage');
ad.recordImpression();
// on tap: report the click, then navigate however the app prefers
await ad.performClick('Calltoaction');
openInAppBrowser(ad.getText('Clickurl'));
Google Ad Manager ad unit ID.
Request options; customFormatIds is required.
StaticfromHydrate from an already-loaded native payload (multi-format path). Package-internal.
ReadonlyadLibrary registry key. Stable for the lifetime of this ad.
ReadonlyadReadonlyassetsText and image assets keyed by their exact Ad Manager name.
ReadonlyavailableEvery asset name the creative carries, verbatim (case-sensitive).
ReadonlyclickReadonlycustomThe Ad Manager custom native format ID that served this ad.
ReadonlymediaVideo asset description, or null when the creative has no media content.
ReadonlyresponseSDK response id, or null when the backend does not expose one (classic Android).
Readonlyresponse
A Google Ad Manager custom native ad (custom native ad format).
Unlike
NativeAd, a custom native ad has no system-defined assets and is not rendered withNativeAdView: read its assets by their exact Ad Manager names and build the UI yourself. You must callrecordImpression()when the ad is shown andperformClick(assetName)when the user taps it; the SDK does not track views for custom native ads.