useAdropRewardedAd

rewarded hook responsible for requesting rewarded ads and displaying them to the user.


const { 
    isClicked,
    isClosed,
    isEarnRewarded,
    isLoaded,
    isOpened,
    errorCode,
    reward,
    load,
    show,
    reset
} = useAdropRewardedAd(unitId: string)

Requires Ad unit ID


Returns

isClicked: boolean

Determine if ad is clicked.

isClosed: boolean

Determine if ad is dismissed.

isEarnRewarded: boolean

Determine when the rewarded ad gets reward message.

isLoaded: boolean

Determine if ad is fully loaded.

isOpened: boolean

Determine if ad is shown.

errorCode: string?

AdropErrorCode when the adrop ad fails to receive, show.

reward: { type: number; amount: number }?

Reward type & amount when the rewarded ad gets reward message.

load: () -> void

Requests an ad from Adrop using the ad unit ID.

show: () -> void

Shows an ad from Adrop using the ad unit ID. Must be fully loaded before show is called.

reset: () -> void

Reset to request new ad, or destroy the ad to free resources.

Last updated