Android In-App Marketing Setup

Current Android SDK Version 4.12.0

Prerequisites

  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) {
        tune.setPackageName("your_package_name_for_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 {
 
    @Override
    public void onCreate() {
        super.onCreate();
        Tune tune = Tune.init(this, TUNE_ADVERTISER_ID, TUNE_CONVERSION_KEY, 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
        Tune.getInstance().enableSmartWhere();

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();
configuration.grant(TuneSmartwhereConfiguration.GRANT_SMARTWHERE_TUNE_EVENTS);
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:

android_push_notifications_icon

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)                       .setColor(Color.BLUE); }
else
{     builder = new TuneNotificationBuilder(R.drawable.pre_lollipop_icon); }
tune.setPushNotificationBuilder(builder);

No Comments

Leave a reply