Add the wall to an iOS, Android or React Native app
Open your wall’s link in a browser tab from your app (SFSafariViewController on iOS, a Custom Tab on Android) and it works with no other code. Host the wall in your own WebView only when it has to sit inside your screens or your app needs its events, and then hand store links to the phone yourself.
See also: Hosted Offerwall
On this page
| Browser tab | WebView in your app | |
|---|---|---|
| Code you write | Open one URL | Link routing and a message bridge |
| App Store and Google Play links | Work as they do in Safari or Chrome | You hand them to the phone |
| Wall events | None reach your app | All except offer_redirect, which is for iframes |
| How the user closes it | The browser’s own Done or back button | The wall’s close control, which your app has to hear |
We recommend the browser tab unless you need the events. You learn about every conversion from your postback either way.
Use the same wall link as on the web, with the phone’s details:
https://offerwall.affiliateos.xyz/w/owapp_your_wall?uid=u_48213&country=US&source=ios&platform=ios&device_id=IDFA_IF_ALLOWED
Example: user u_48213 on an iPhone in the US.
sourceisiosorandroid, once. A secondsourcein the URL makes the launch fail.platformisiosorandroid, so an iPhone user is never shown an app that only exists on Android. Never sendplatform=webfrom a phone: the wall then lists web offers only.device_idis the IDFA or GAID when the user allowed it. Anything that isn’t in an advertising ID’s shape, including an all-zero IDFA, is dropped and the wall opens as usual. On iOS, a real IDFA withplatform=iosalso shortens the iPhone tracking guide to its second screen.- If your wall requires signed links, your app asks your server for a fresh URL each time. The wall secret never goes in the app.
iOS: present the URL in SFSafariViewController
Present an
SFSafariViewControllerwith the launch URL, as a sheet over your screen. Offers and App Store links open as they would in Safari.Android: open the URL in a Custom Tab
Launch a
CustomTabsIntentwith the launch URL, and fall back to the default browser if the phone has no Custom Tabs support. Google Play links open the Play Store.Check it worked
Open the wall from your app with a test user ID. The wall hides its own close control in a browser tab, because nothing in your app can hear it; the user closes the tab with the browser’s button. Your app gets no events from the tab.
In your own WebView the wall is the page itself, so it moves itself to each offer it opens. Your app has three jobs.
Send store links to the phone
When the WebView is about to load an App Store or Google Play store page, or a link with a scheme that isn’t
httporhttps(such asitms-apps:,market:orintent:), cancel the load and hand the URL to the phone (UIApplication.openon iOS, anIntenton Android,Linking.openURLin React Native). A WebView can’t open those itself, and the offer dead-ends on a blank screen.Open offers over the wall, not in it
When the wall’s WebView is about to load an
httporhttpspage on any host other than the wall’s, cancel it and load that page in a second WebView on top of the wall. Close the second one when it hands a store link to the phone. The user then comes back to the wall, where the offer shows as started. Some offer links stop on a page of their own that expires once the user leaves it, and without this that page is what the user returns to.Load the wall’s own URL, not a link of yours that redirects to it, so the host you compare against is the wall’s.
Forward the wall’s messages and close on
close_requestedIn a WebView the wall posts its events to its own window. Inject a short script that listens for
messageevents whosetypestarts withaffiliateos.offerwall.and passes them to your app through your WebView’s bridge. Whenclose_requestedarrives, dismiss the WebView.The wall shows its close control only where it can tell something is listening: inside an iframe, or in a React Native WebView. With your own native bridge, add
&close=showto the URL. If your screen has its own close button, add&close=hide.Check it worked
Open the wall with a test user ID and add
&testMode=1: tapping Get then records the start without leaving the wall, and your app should receiveoffer_started. Then, without test mode, tap a game offer: the App Store or Play Store should open, and closing it should bring the user back to the wall. Test your wall before launch covers the rest.
Use react-native-webview and do the three jobs above in onShouldStartLoadWithRequest and onMessage. We have a ready-made React Native container that does all three, with tested link rules. It isn’t published as a package: ask for it at hello@affiliateos.ai.