WebView cloud alerts

This is a version of our cloud alert that gives you complete control over the content. Design your alert in HTML/CSS, upload it somewhere and enter the URL pointing to it in the developer dashboard. The WebView which will load your alert URL has a translucent background, so you can even design your alert to look like a dialog.

Closing the alert

To close the alert you can either:

Add a link to close:// in your HTML.

Call the Javascript function appbrain.close().

Android Javascript interface

The complete list of Javascript functions that are available from the WebView:

appbrain.close(): close the alert.

appbrain.isPackageInstalled(packageName): returns true if the app with this package name is installed on the device.

appbrain.sendMail(address,subject,content): open an Android e-mail intent.

Query parameters

When you add our special query parameter values to your URL, they will be replaced with certain data from the app. For example, the URL:

http://www.appbrain.com/?pkg=appbrain-app-package

when opened in the AppBrain example app, would result in the WebView loading:

http://www.appbrain.com/?pkg=com.appbrain.example

Here is the complete list of possible values:

appbrain-app-package: the app’s package name.

appbrain-app-version: the app’s version code.

appbrain-os-version: the device’s Android version.

appbrain-os-language: the device’s language.

appbrain-screen-density: the screen’s density.

appbrain-screen-size: the minimum screen dimension in dip.

Example HTML template

If you want to use the WebView to show a dialog style alert, you can use the HTML below to get started.