Android Integration
To integrate the offerwall into your Android app, either open it in the device browser or render it inside a WebView. A WebView keeps the user in your app and is the recommended approach.
URL
GET
http://adplusmedia.com/app/iframe/[APP_ID]/[USER_ID]
WebView example
kotlin
val webView = WebView(this)
setContentView(webView)
webView.settings.apply {
javaScriptEnabled = true
domStorageEnabled = true
mediaPlaybackRequiresUserGesture = false
}
// Keep navigation inside the WebView instead of bouncing to Chrome.
webView.webViewClient = WebViewClient()
val appId = "1042"
val userId = Uri.encode(currentUserId)
webView.loadUrl("http://adplusmedia.com/app/iframe/$appId/$userId")
java
WebView myWebView = new WebView(activityContext);
setContentView(myWebView);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);
myWebView.setWebViewClient(new WebViewClient());
myWebView.loadUrl("http://adplusmedia.com/app/iframe/[APP_ID]/[USER_ID]");
Required WebView settings
| Setting | Required | Why |
|---|---|---|
javaScriptEnabled |
Yes | The offerwall renders its offer list and handles redirects in JavaScript. |
domStorageEnabled |
Yes | Used to persist the user's filter and language selection between sessions. |
WebViewClient |
Recommended | Without it, the first redirect leaves your app and opens the system browser. |
Manifest permissions
Your app needs internet access to load the wall:
xml
<uses-permission android:name="android.permission.INTERNET" />
Replace [APP_ID] with your placement ID and [USER_ID] with the unique
identifier of the user viewing the wall. Always URL-encode the user ID with Uri.encode().
Some offers hand the user off to the Google Play Store. Let those navigations leave the WebView by
handling market:// and intent:// URLs in your
shouldOverrideUrlLoading implementation, otherwise installs will not complete and the
user will not convert.