AppKit WebView manual integration

This format is used to have editorial contents mixed with affiliates offers and it is built to be used inside a native WebView of Android and iOS devices.

If you are lazy I would suggest you to have a look to the implementation already available inside our Android SDK Instructions

Manual integration

First of all make sure you have a valid LAYOUT_ID, the LAYOUT_ID is bounded to an OS so you will need one for Android and one for iOS. Ask you account manager to have your layout ids.

URI:

http://wallkit.instal.com/serve/html/

or with ssl

https://wallkit.instal.com/serve/html/

Description:

Return an HTML content that can be used inside a WebView

Parameters:

Required Name Type Description
required layout_id int the id of the layout
optional idfa string the IDFA of the iOS device if present
optional gaid string the GAID of the Android device if present
optional android_id string the ANDROID ID of the Android device if present
optional android_imei string the IMEI of the Android device if present

Example final url:

http://wallkit.instal.com/serve/html/?layout_id=42&gaid=caa23999-74d1-4635-bba0-164b44a3be3a

Important Notes

Request Headers

You must respect with the webview the User-Agent and the Language of the device to have the correct content inside the page:

Example user agent:

User-Agent: Mozilla/5.0 (Linux; Android 4.4.4; en-us; Nexus 5 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2307.2 Mobile Safari/537.36

Example language:

Accept-Language:"it,en-AU;q=0.7,en;q=0.3"

Customize WebView click behavior

As you know the WebView will keep opening links inside the WebView to continue the navigation inside it. You must override this behaviour to use the default system browser to open the links this will allow the device to fire an intent to open the device Store.

If this is not respected you will not be able to monetize the clicks.

Example Implementation Android

ebView.setWebViewClient(new WebViewClient() {
    @Override public boolean shouldOverrideUrlLoading(WebView view, String url) {
       if (url.startsWith("http://wallkit.instal.com") || url.startsWith("https://wallkit.instal.com")) {
           return false;
       } else {
           Intent i = new Intent();
           i.setAction(Intent.ACTION_VIEW);
           i.setData(Uri.parse(url));
           i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

           startActivity(i);
           return true;
       }
    }
});