Jump to: Update Framework References: | Cocoapods: | Directly Referenced Framework: | Update Code:
The TUNE SDK version 4.0.0 introduces some new class namespaces. The code migration from 3.x.x to 4.x.x is very simple with 1:1 class/method name replacements.
- For a clean install, you may want to delete your existing files in /Assets/TuneOSS and /Assets/Plugins. If you have other files you need to keep, you may refer here for a list of files from the 3.x plugin that can be deleted: https://github.com/TuneOSS/unity-plugin/tree/v3.12.1/sample/Assets
- Import the new
Tune.unitypackage
file. - Update the
com.mobileapptracker.Tracker
receiver in your AndroidManifest.xml tocom.tune.TuneTracker
. - Use Tune classes in place of MobileAppTracker/MAT classes:
Old (deprecated) New (replacement) using MATSDK TuneSDK MATBinding Tune MATEvent TuneEvent MATItem TuneItem MATPreloadData TunePreloadData MobileAppTracker GameObject TuneListener GameObject
Update Framework References:
There are two ways to reference the new Tune framework.
Cocoapods:
If your project uses Cocoapods to manage library dependencies, please replace pod 'MobileAppTracker'
in your project's Podfile
with pod 'Tune'
.
After that, open a terminal window, go to the project root folder and run pod update
command to update the dependencies.
Directly Referenced Framework:
If your project directly includes framework references, then remove MobileAppTracker.framework
reference, from Xcode project Build Phases “Link Binary With Libraries”; add Tune.framework
reference instead.
Update Code:
Update import
statements.
- Replace
@import MobileAppTracker
with@import Tune
. - Replace
#import <MobileAppTracker/MobileAppTracker.h>
with#import <Tune/Tune.h>
.
Use Tune classes in place of MobileAppTracker/MAT classes:
Old (deprecated) | New (replacement) |
---|---|
MobileAppTracker | Tune |
MobileAppTrackerDelegate | TuneDelegate |
MobileAppTrackerRegionDelegate | TuneRegionDelegate |
MATEvent | TuneEvent |
MATEventItem | TuneEventItem |
MATPreloadData | TunePreloadData |
Use the Tune init method in place of the MobileAppTracker init method.
from:
- Ensure that jCenter is included as a repository in your Gradle file:
buildscript {
repositories {
[...]
jcenter()
}
[...]
}
+ (void)initializeWithMATAdvertiserId:(NSString *)aid MATConversionKey:(NSString *)key;
Select a preferred platform.
2. Add the following line to your Gradle dependency stanza:
compile 'com.tune:tune-marketing-console-sdk:4.0.+'
+ (void)initializeWithTuneAdvertiserId:(NSString *)aid tuneConversionKey:(NSString *)key;
Select a preferred platform.
This will automatically add in the TUNE SDK (with associated dependencies) to your project.
3. Remove the old MobileAppTracker.jar
from your libs
folder.
To install via the TUNE SDK JAR distribution:
- Replace
MobileAppTracker.jar
withTuneMarketingConsoleSDK.jar
in your project’slibs
folder. - Add the new required dependencies to your app:
Be sure to update the com.mobileapptracker.Tracker
receiver in your AndroidManifest.xml to com.tune.TuneTracker
.
Use Tune classes in place of MobileAppTracker/MAT classes:
Old (deprecated) | New (replacement) |
---|---|
MobileAppTracker | Tune |
MATDeeplinkListener | TuneDeeplinkListener |
MATEvent | TuneEvent |
MATEventItem | TuneEventItem |
MATPreloadData | TunePreloadData |
MATResponse | TuneListener |
com.mobileapptracker.Tracker | com.tune.TuneTracker |
OPTIONAL: We recommend moving your MobileAppTracker.init
call to a Tune.init
call inside a custom Application class. This will make it easier for your SDK integration to enable In-App Marketing, as well as access the Tune singleton throughout your application as Tune.getInstance()
.
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Tune.init(this, YOUR_ADVERTISER_ID, YOUR_CONVERSION_KEY);
}
}
- (void)mobileAppTrackerEnqueuedActionWithReferenceId:(NSString *)referenceId;
- (void)mobileAppTrackerDidSucceedWithData:(NSData *)data;
- (void)mobileAppTrackerDidFailWithError:(NSError *)error;
- (void)mobileAppTrackerDidReceiveDeeplink:(NSString *)deeplink didTimeout:(BOOL)timeout;
- (void)mobileAppTrackerDidFailDeeplinkWithError:(NSError *)error;
- (void)mobileAppTrackerDidDisplayiAd;
- (void)mobileAppTrackerDidRemoveiAd;
- (void)mobileAppTrackerFailedToReceiveiAdWithError:(NSError *)error;
Select a preferred platform.
android:name
field to the <application>
tag in order to use the custom Application you created.<application
android:name=".MyApplication"
- (void)tuneEnqueuedActionWithReferenceId:(NSString *)referenceId;
- (void)tuneDidSucceedWithData:(NSData *)data;
- (void)tuneDidFailWithError:(NSError *)error;
- (void)tuneDidReceiveDeeplink:(NSString *)deeplink didTimeout:(BOOL)timeout;
- (void)tuneDidFailDeeplinkWithError:(NSError *)error;
- (void)tuneDidDisplayiAd;
- (void)tuneDidRemoveiAd;
- (void)tuneFailedToReceiveiAdWithError:(NSError *)error;
Select a preferred platform.
from:
measureSession
and measureEvent
calls where they are, accessing the singleton instance initialized from the Application class with getInstance()
: public class MyActivity extends Activity {
@Override
public void onResume() {
super.onResume();
Tune.getInstance().setReferralSources(this);
Tune.getInstance().measureSession();
}
}
+ (void)setLatitude:(double)latitude longitude:(double)longitude;
Select a preferred platform.
+ (void)setLocation:(TuneLocation *)location;
Select a preferred platform.
-ObjC -lz
Select a preferred platform.
AdSupport
CoreTelephony
iAd
libz.dylib OR libz.tbd
MobileCoreServices
Security
StoreKit
SystemConfiguration
Select a preferred platform.
If the package name of your app does not match the app’s bundle id, then explicitly set the package name in code. If your app usessetSiteId:, then lookup the package name from the TUNE dashboard and call setPackageName: instead.