App Open
Prerequisites
App Open Ads
App open ads are a special ad format designed to be shown automatically when users bring your application back to the foreground. They have a small branding area so users know they’re in your app. By clicking the “Continue to app” button, they will be redirected back to your app.
Here is an example of what an app open ad looks like.
To activate the App open ads please contact with your account manager or our technical support.
When debug mode is enabled we include an enabled app open by default. To disable it you can call R89AdFactory.setAppOpenEnabled(false)
How it works?
Foreground Events and counter
The App open ads are shown when your application moves to the foreground. It is initially loaded with the SDK’s initialization and reloaded automatically each time the user views and closes it.
You can tell us to configure the “foreground counter”. If the required amount of “foreground counter” is set to 2, that means the ad will be shown once a user brings the app back to the foreground for the second time.
The value for of the “foreground counter”, determines when the App Open Ad will be shown, can be configured through our platform communicating with your account manager or tech support.
The initial app launch is considered the first foreground event, meaning that if the foreground event count is set to 2, the App Open Ad will be shown the next time the app transitions from the background to the foreground.
Rest Counter
There is an additional “rest counter” parameter that could be configured to skip the app open show event. This means after the first app open ad appearance, if this counter is set to 1 and the “foreground counter” is set to 2, the ad will be displayed after 4 foreground events.
The value of the “rest counter”, can be configured through our platform communicating your account manager or tech support.
Note that the “rest counter” parameter logic will take effect only starting after the first show. This provides a way so you can configure your desired User Experience and we also provide other ways to limit the frequency of this ad.
Expiration
App open ads will time out after a maximum of 4 hours. Ads rendered more than four hours after request time will no longer be valid, if we keep the previous example counters, when the user opens for the first time the app and then waits for hours the ad will not show on the second foreground event, it will refresh itself and wait until the next opportunity which will be the third foregrounding event.
How to test it?
The App open ad can be tested out of the box by initializing the SDK in the debug mode.
To enable the debug mode call the R89SDK.setDebug()
method before the SDK’s initialize method. Additionally, to see the related logs set the log level LogLevels.DEBUG
or LogLevels.VERBOSE
to see them in more granular detail.
class App : Application() {
override fun onCreate()
{
super.onCreate()
//This is the example with the manual configuration
R89SDK.setDebug()
R89SDK.setLogLevel(LogLevels.VERBOSE)
R89SDK.initialize(
appContext = this,
pubUUID = <your-pub-uuid>,
apiKey = <your-api-key>,
singleLine = false
)
}
}
By default, for the debug mode the “foreground counter” is set to 2, meaning the app open ad will be shown on the second foreground event, counting the first launch as well. This means that after launching the app for the first time if the user moves it to the background and then brings it back to the foreground, an app open ad will be displayed.
The next time the App Open Ad will be shown on the second foreground event, counted from this moment. It means the user must follow this sequence:
#1 Start the application → move it to the background again → #2 bring it to the foreground, and the app open ad will appear.
By default, for the debug mode, the “rest counter” is set to 1, which will skip the next show event. After the app open ad first appearance, having the “rest counter” set to 1, and the “foreground counter” set to 2, the ad will appear on the 4th foreground event by following this sequence:
move the app to the background → #1 bring it to the foreground → move it to the background again → #2 bring it to the foreground → show event is registered but skipped because of the “rest counter” → move the app to the background → #1 bring it to the foreground → move it to the background again → #2 bring it to the foreground → show event is registered and not ignored so the ad shows.
By default, the debug mode comes with the 4-hour ad expiration timer value, and after reaching it the ad will be automatically reloaded by the SDK if the ad was expired at the time of showing.
When the user brings the app back to the foreground, the app open ad will be reloaded then on the next foreground event it will be shown and everything will reset appropriately.
To mitigate this behavior, the SDK checks the ad’s expiration status whenever the app moves to the background or foreground.
Lifecycle Events
You can subscribe to these with the method R89AdFactory.subscribeToAppOpen(...)
and provide an instance of AppOpenInterstitialEventListener
.
class App : Application() {
override fun onCreate()
{
super.onCreate()
R89SDK.setDebug()
R89SDK.setLogLevel(LogLevels.VERBOSE)
R89SDK.initialize(...)
val eventListener: AppOpenInterstitialEventListener = <create the listener with a method or inplace>
R89AdFactory.subscribeToAppOpen(eventListener)
}
}