Reward Ad
Rewarded ads allow you to reward users with in-app items for interacting with video ads, playable ads, and surveys.
Load Ad
To load an reward ad, call the loadAd method on an IKRewardAd
instance and provide the ad unit ID along with an IKLoadAdListener
to receive the loaded ad or any potential errors. Note that, like other ad format load callbacks, IKLoadAdListener
utilizes IKAdError
to provide more detailed error information.
Reference
com.ikame.android.sdk.format.rewarded.IKRewardAd#loadAd
Function Definition
fun loadAd(
screen: String,
callback: IKLoadAdListener?
)
Parameters
screenAd
: considered as a unitId, our team will send you the screenAd list.callback
: An instance ofIKLoadAdListener
that provides callbacks for handling ad load events.
Sample Usage
Show Ad
1. Basic Show Function
To display an reward ad, call the showAd method on an IKRewardAd
instance, providing the activity context, the ad unit ID, and an IKShowAdListener to handle the ad display events. The IKShowAdListener
interface provides callbacks for handling ad show failures and ad dismissals.
#Reference
com.ikame.android.sdk.format.rewarded.IKRewardAd#showAd(Activity, String, IKShowRewardAdListener)
#Function Definition
fun showAd(
activity: Activity?,
screen: String,
adListener: IKShowRewardAdListener?
)
Parameters:
activity
: The Activity in which the interstitial ad will be shown. This can be null if no specific activity context is required.screen
: considered as a unitId, our team will send you the screenAd list.adListener
: IKShowRewardAdListener - Manages reward ad display events.
Sample Usage
2. Show Ad with Loading Callback
To display an interstitial ad with loading callback, call the showAd method on an IKInterstitialAd
instance, providing the activity context, the ad unit ID, and an IKShowAdListener to handle the ad display events. The IKShowRewardAdListener
interface provides callbacks for handling ad display events.The IKLoadingsAdListener
interface provides callbacks for managing the ad’s loading state.
#Reference
com.ikame.android.sdk.format.rewarded.IKRewardAd#showAd(Activity, String, IKShowRewardAdListener, IKLoadingsAdListener)
#Function Definition
fun showAd(
activity: Activity?,
screen: String,
adListener: IKShowRewardAdListener?,
loadingCallback: IKLoadingsAdListener? = null
)
Parameters:
activity
: The Activity in which the interstitial ad will be shown. This can be null if no specific activity context is required.screen
: considered as a unitId, our team will send you the screenAd list.adListener
: IKShowRewardAdListener - Manages reward ad display events.loadingCallback
: IKLoadingsAdListener - Managing the ad display lifecycle events while taking into account the loading time
Sample Usage
Destroy Ad
In certain scenarios, Ad
can be prone to memory leaks. Therefore, it is essential to destroy the ad when your Fragment or Activity is destroyed to manage resources properly.
#Reference
com.ikame.android.sdk.format.rewarded.IKRewardAd#destroy
#Function Definition
fun destroy()
Sample usage
Check Ad Ready
#Reference
IKSdkController.isRewardAdReadyAsync()
Ad Listener Interfaces
- IKShowRewardAdListener: Manages reward ad display events.
- IKLoadAdListener: Handles ad loading events.
- IKLoadingsAdListener: Managing the ad display lifecycle events while taking into account the loading time