The Splash Ad is loaded and displayed on the splash screen of the application. A Splash Ad is a full-screen advertisement that can be in either interstitial or open format. It appears as users launch the app, providing an engaging advertisement experience before the main content is fully loaded.
Splash ad automatically show a small branding area so users know they’re in your app. Here is an example of what a splash ad looks like:
This function loads a splash screen advertisement within the specified Android activity. The ad is initialized asynchronously, and the provided IKLoadAdListener is used to handle callbacks related to the ad loading process.
fun loadSplashScreenAd(activity: Activity?, listener: IKLoadAdListener?)
Parameters:
activity: The Activity in which the splash ad will be displayed. This can be null if no specific activity context is required at the time of calling.
listener: The IKLoadAdListener interface is designed to manage responses related to the loading of ads. It provides callbacks for handling both the successful loading of ads and the scenarios where ad loading fails.
onAdLoaded(): Called when the ad is displayed. This method must be implemented to define the actions to be taken when an ad is shown.
onAdLoadFail(error: IKAdError): Invoked when there is a failure in loading the ad. It takes an IKAdError object as a parameter, which contains details about what caused the failure.
Call loadSplashScreenAd() first to start loading the ad
Once loading is complete, call showSplashScreenAd() to display it
Important notes
showSplashScreenAd() is a suspend function that uses Kotlin coroutines
The function remains suspended until the ad either shows successfully or fails
Use IKShowAdListener to handle display status callbacks
suspend fun showSplashScreenAd(activity: Activity?, listener: IKShowAdListener?)
Parameters:
activity: The Activity where the splash ad will be displayed. This can be null if no specific activity context is needed at the time of showing the ad.
listener: IKShowAdListener interface has four callback methods for handling ad display events:
onAdsDismiss(): Called when the ad is dismissed by the user
onAdsShowFail(error: IKAdError): Called when there is an error showing the ad
onAdsShowed(): Called when the ad has been successfully displayed (optional implementation)
onAdsShowTimeout(): Called when the ad display times out (optional implementation)
This function asynchronously loads and displays a splash screen advertisement within the provided activity. It combines the processes of both loading and showing the ad, making it convenient for developers who want to handle the entire splash ad lifecycle in a single call. The provided IKShowAdListener is used to track the status of the ad display.
suspend fun loadAndShowSplashScreenAd(activity: Activity?, listener: IKShowAdListener?): Job?
Parameters:
activity: The Activity where the splash ad will be displayed. This can be null if no specific activity context is needed at the time of showing the ad.
listener: IKShowAdListener interface has four callback methods for handling ad display events:
onAdsDismiss(): Called when the ad is dismissed by the user
onAdsShowFail(error: IKAdError): Called when there is an error showing the ad
onAdsShowed(): Called when the ad has been successfully displayed (optional implementation)
onAdsShowTimeout(): Called when the ad display times out (optional implementation)
fun noneShowSplashAd(activity: Activity?, listener: IKNoneSplashAdListener)
Parameters:
activity: The Activity where the splash ad will be displayed. This can be null if no specific activity context is needed at the time of showing the ad.
listener: IKNoneSplashAdListener is an interface with a single callback method:
onMove(): Called when the app should proceed without showing a splash ad