Android In-App Marketing Setup

In-App Marketing will be shutting down November 1st, 2018. API calls will be removed in Tune Android & iOS SDKs v6.0.0. Customers are required to remove all code references to prevent service disruption. Please contact your Customer Success Manager with additional questions.


  1. TUNE recommends having a PROD and DEBUG app in our system. You can switch between builds automatically by using debug macros. Create separate App IDs for the development and production builds of your app so that changes to your development build do not affect your production build (until you’re ready to push them to your production app audience). You need to have two apps in In-App Marketing for each one of your apps if you support two platforms. One platform is for production and one for development.
    Tune tune = Tune.init(this, "your_advertiser_id", "your_conversion_key", true);
    if (BuildConfig.DEBUG) {
     For more information about creating unique App IDs/package names, please visit Creating Unique Package Names.
  2. Implement version 4.8+ of the SDK. If you need to update to this version, please consult the update guide. In-App Marketing is supported with Tune SDK versions 4.0 and above. If you would like to use a Tune SDK version older than 4.8.0 see our In-App Marketing Setup Instructions 4.0 - 4.7 Guide.

Enabling In-App Marketing

To enable In-App Marketing:

In your Application onCreate, call Tune.init with the extra argument turnOnIAM = true

public class MyApplication extends TuneApplication {
    public void onCreate() {
        Tune tune = Tune.init(this, TUNE_ADVERTISER_ID, TUNE_CONVERSION_KEY, true);

In order to leverage in-app campaigns, you also need to add the following to your AndroidManifest.xml file:

<activity android:name=""
                  android:animateLayoutChanges="true" />

Enable Smartwhere

The TUNE Marketing Console integration with Smartwhere provides clients with location-based business intelligence by implementing defined geofences to provide insights on "in-store" user engagement for their mobile app. By default Smartwhere is included with the TUNE SDK for version 4.11.0+ . For more information please see our Smartwhere Integration  article.

Smartwhere is included in the latest TUNE SDK but is disabled by default. To enable Smartwhere call the following method after the TUNE initialization:

        // OPT-IN Enable SmartWhere

To optionally expose your TUNE client events to Smartwhere, for example to trigger proximity engagements based on your own custom events, make the following call after enabling Smartwhere:

TuneSmartwhereConfiguration configuration = new TuneSmartwhereConfiguration();
Tune.getInstance().configureSmartwhere(configuration);    // configure must be called AFTER enable

Event sharing

For more information on Smartwhere and event sharing please see our Smartwhere Integration and Smartwhere In Store Event Tracking articles.

Set Up Push Notifications

Across all platforms, it is important to establish push notifications after your initial SDK install. For more information on how to set up push notifications and configure campaigns to send out targeted push messages, see our Push Notifications article.

Push Notifications Icons

In Android Lollipop (Android OS developed by Google, spanning versions between 5.0 and 5.1.1) all push notification icons are updated to the new material standards:
The platform only respects icons with no color and only alpha levels. Old icons rendered in material display as a white square, for example:


If you are supporting versions both before and after Lollipop, verify at runtime which icon to use.

You can accomplish this by:

TuneNotificationBuilder builder;
if (Build.VERSION.SDK_INT >= 21) {
    builder = new TuneNotificationBuilder(R.drawable.lollipop_icon, "some_android_o_channel_id").setColor(Color.BLUE);
} else {
    builder = new TuneNotificationBuilder(R.drawable.pre_lollipop_icon, "some_android_o_channel_id");

No Comments

Leave a reply