react-native-google-mobile-ads
    Preparing search index...

    Interface AdHookReturns

    interface AdHookReturns {
        destroy: () => void;
        error?: Error;
        isClicked: boolean;
        isClosed: boolean;
        isEarnedReward?: boolean;
        isLoaded: boolean;
        isOpened: boolean;
        isShowing: boolean;
        load: () => void;
        responseInfo: ResponseInfo | null;
        revenue?: PaidEvent;
        reward?: RewardedAdReward;
        show: (showOptions?: AdShowOptions) => void;
    }

    Hierarchy (View Summary)

    Index
    destroy: () => void

    Release native resources for the underlying ad instance.

    error?: Error

    JavaScript Error containing the error code and message thrown by the Ad.

    isClicked: boolean

    Whether the user clicked the advert.

    isClosed: boolean

    Whether the user closed the ad and has returned back to your application.

    isEarnedReward?: boolean

    Whether the user earned the reward by Rewarded Ad.

    isLoaded: boolean

    Whether the ad is loaded and ready to to be shown to the user.

    isOpened: boolean

    Whether the ad is opened.

    isShowing: boolean

    Whether your ad is showing. The value is equal with isOpened && !isClosed.

    load: () => void

    Start loading the advert with the provided RequestOptions.

    export default function App() {
    const interstitial = useInterstitialAd(TestIds.INTERSTITIAL, {
    requestNonPersonalizedAdsOnly: true,
    });
    useEffect(() => {
    interstitial.load();
    }, [interstitial.load]);
    }
    responseInfo: ResponseInfo | null

    Snapshot of the loaded ad's response info, or null before load / after destroy.

    revenue?: PaidEvent

    Payload from the last impression-level ad revenue event.

    Loaded reward item of the Rewarded Ad.

    show: (showOptions?: AdShowOptions) => void

    Show the loaded advert to the user.

    export default function App() {
    const interstitial = useInterstitialAd(TestIds.INTERSTITIAL, {
    requestNonPersonalizedAdsOnly: true,
    });
    return (
    <View>
    <Button
    title="Navigate to next screen"
    onPress={() => {
    if (interstitial.isLoaded) {
    interstitial.show();
    } else {
    navigation.navigate('NextScreen');
    }
    }}
    />
    </View>
    )
    }

    Type Declaration

      • (showOptions?: AdShowOptions): void
      • Parameters

        • OptionalshowOptions: AdShowOptions

          An optional AdShowOptions interface.

        Returns void