Unity In-App Marketing Setup

Prerequisites

TUNE recommends creating both PROD and DEBUG apps 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.

For more information about creating unique App IDs/package names, please visit Creating Unique Package Names.

Set up

  1. Implement version 4.0+ of the Unity plugin from Github.
  2. Make Python 2.7 available from your command line, our build scripts will use this.
  3. In Unity, click TUNE -> Setup from the context menu and open the In-App Marketing dropdown.
  4. Enter your TUNE advertiser id, conversion key, and package name.

unity_setup

Enabling In-App Marketing for Unity Android

Unity Android integration requires the app to implement a custom Application class which extends TuneApplication in order to hook into the application lifecycle. You may auto-generate this from the editor.

Important Note: Make sure you complete each of the following three steps:

  1. Select the Create Application Java File button to generate the .java file which initializes Tune with your advertiser id, conversion key, and package name and In-App Marketing enabled.unity_android_create_java
  2.  Compile this .java file into a JAR in order for Unity to use. Enter the Android API level you wish to compile the JAR with, then click Generate Application Jar.unity_android_create_jar
  3. Tell the app to use this custom Application class. Add a reference to it in /Plugins/Android/AndroidManifest.xml.unity_android_edit_manifest

Enabling In-App Marketing for Unity iOS

Unity iOS integration requires the app to implement a custom AppDelegate class which inherits Unity’s LifeCycleListener in order to hook into the application lifecycle. You may auto-generate this from the editor.

Important Note: Make sure you complete both of the following two steps:

  1. Populate the checkbox to enable In-App Marketing for iOS. This allows the post-build processing script to modify the generated Xcode project correctly to support In-App Marketing.unity_ios_enable_iam
  2. Create a custom class which inherits LifeCycleListener. Auto-generate this from the editor. Click the Create LifeCycleListener File button to generate the .mm file which initializes Tune with your advertiser id, conversion key, and package name.unity_ios_create_lifecyclelistener

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 Push Notifications.

Have a Question? Please contact support@tune.com for technical support.