Skip to content

Latest commit

 

History

History
1219 lines (810 loc) · 35.1 KB

README.md

File metadata and controls

1219 lines (810 loc) · 35.1 KB

TUNE SDK Bridge

The TUNE SDK Bridge provides a React Native interface to the native TUNE SDK methods for attribution, measuring app events and In-App Marketing on both iOS and Android.

Example Usage

    import TuneSDK from 'react-native-tune-sdk';

    const params = {
        id           : '0001',
        userIdType   : 'facebook',
        email        : '[email protected]',
        name         : 'Jane Smith',
        age          : 50,
        gender       : 'FEMALE',
        location     : { latitude : 120.999, longitude : 90.000,  description : '' }
    };

    TuneSDK.login( params );

Table of Contents

Installation

Installation with rnpm

  1. npm install --save react-native-tune-sdk
  2. rnpm link react-native-tune-sdk

With this, rnpm will linking most of the dependencies for you, but you will still need to do some of the manual steps below, step 5 and 6 will have to be done for both the iOS installation and android, and steps 7 and 8 will also be needed for iOS.

iOS Manual Installation

  1. npm install --save react-native-tune-sdk

  2. In Xcode, right-click the Libraries folder under your project ➜ Add Files to <your project>.

  3. Go to node_modulesreact-native-tune-sdkiosRNTuneSDKBridge and add the RNTuneSDKBridge.xcodeproj file.

  4. Add libRNTuneSDKBridge.a from the linked project to your project properties ➜ "Build Phases" ➜ "Link Binary With Libraries"

  5. Next you will have to link a few more SDK framework/libraries which are required by GA (if you do not already have them linked.) Under the same "Link Binary With Libraries", click the + and add the following:

  6. AdSupport.framework

  7. CoreTelephony.framework

  8. iAd.framework

  9. libz.tbd

  10. MobileCoreServices.framework

  11. Security.framework

  12. StoreKit.framework

  13. SystemConfiguration.framework

  14. Under your project properties ➜ "Info", add a new line with the following for you TUNE SDK config:

  • Create a dictionary named TUNE.
  • Add a string with a key of advertiserId and a value of your advertiser Id.
  • Add a string with a key of conversionKey and a value of your conversion Key.

alt tag

  1. In your Application AppDelegate class add the code below to the bottom of the lifecycle method didFinishLaunchingWithOptions.
  // TUNE SDK Initialize
  NSDictionary *tuneConfig = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"Tune"];
  [Tune initializeWithTuneAdvertiserId:[TuneConfig objectForKey:@"advertiserId"] tuneConversionKey:[TuneConfig objectForKey:@"conversionKey"]];
  1. Lastly, add to the AppDelegate class in the applicationDidBecomeActive lifecycle method the Tune [Tune measureSession] messure session call like below:
  - (void)applicationDidBecomeActive:(UIApplication *)application
  {
    // Attribution will not function without the measureSession call included
    [Tune measureSession];
  }

Android Manual Installation

Prerequisites for Android

Consult this guide if you are unsure how to do this. Specifically step 3 for the mentioned packages.

Steps Up steps:

  • npm install react-native-tune-sdk
  • Add Tune package to the android/setting.gradle file
  • Add Tune package to your android/app/build.gradle
  • Add and initialize TUNE SDK in MainActivity.java
  • Create a Java class file next to MainActivity file and create a class to initial the TUNE SDK.
  • Add the class you created from the above step to AndroidManifest.xml and add permissions.
  1. npm install --save react-native-tune-sdk

  2. Add the following in android/setting.gradle

...
include ':TuneSDKBridge', ':app'
project(':TuneSDKBridge').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-tune-sdk/android')
  1. And the following in android/app/build.gradle
...
dependencies {
    ...
    compile project(':TuneSDKBridge')
}
  1. Register package in MainActivity.java

** React Native 0.16+ and above.

// Step 1; import package:
import com.tune.react.TuneSDKBridge.TuneSDKBridgePackage; // <!----

public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
    ...

  @Override
  protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
      // INITIALIZE TRACKING APP WITH YOUR advertiser id, conversion id, and Google api IMA sender id ( optional )
      new TuneSDKBridgePackage(),
      );
  }
    ...
  1. Create the TuneSDK class to initialize the TUNE SDK.
 package com.name.of.your.package;

 import com.tune.Tune;
 import com.tune.ma.application.TuneApplication;

 public class TuneSDK extends TuneApplication {

     private static Tune tuneInstance;
     private static final String tuneAdvertiserId = "your_advertisment_id";
     private static final String tuneConversionKey = "your_conversion_id";

     @Override
     public void onCreate() {
         super.onCreate();
         tuneInstance = Tune.init( this, tuneAdvertiserId, tuneConversionKey);
     }

 }
  1. Add the class new TuneSDK class to your AndroidManifest.xml application section and above that, add the permissions below.
    <!--  Need permissions -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <!-- Add the application -->
    <application
        android:name=".TuneSDK"
        android:allowBackup="true"
        android:icon="@mipmap/hasoffers"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">

React Native Versions 0.16 < and lower

// Step 1; import package:
import com.tune.react.TuneSDKBridge.TuneSDKBridgePackage; // <!----

public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
      ...

      mReactInstanceManager = ReactInstanceManager.builder()
          .setApplication(getApplication())
          .setBundleAssetName("index.android.bundle")
          .setJSMainModuleName("index.android")
          .addPackage(new MainReactPackage())
          // INITIALIZE
          .addPackage(new TuneSDKBridgePackage()
          .setUseDeveloperSupport(BuildConfig.DEBUG)
          .setInitialLifecycleState(LifecycleState.RESUMED)
          .build();

        ...
     }   

Javascript API

Authentication

Login

See the TUNE SDK docs for more info

Example :

    const params = {
        id           : '0001',
        userIdType   : 'facebook',
        email        : '[email protected]',
        name         : 'Jane Smith',
        age          : 50,
        gender       : 'FEMALE',
        location     : { latitude : 120.999, longitude : 90.000,  description : '' }
    };

    TuneSDK.login( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • email (required): String - user email address
  • name: String - name of the user
  • age : Integer - user age
  • gender (required): String - MALE or FEMALE all upper case.
  • location: Object
    • longitude: Float - latitude
    • longitude: Float - longitude
    • description String - description or Street address of the location

Registration

See the TUNE SDK docs for more info

Example :

   const params = {
        id           : '0001',
        userIdType   : 'facebook',
        email        : '[email protected]',
        name         : 'Jane Smith',
        age          : 50,
        gender       : 'FEMALE',
        location     : { latitude : 120.999, longitude : 90.000,  description : '' }   
   };

   TuneSDK.registration( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • email (required): String - user email address
  • name: String - name of the user
  • age : Integer - user age
  • gender (required): String - MALE or FEMALE all upper case.
  • location: Object
    • longitude: Float - latitude
    • longitude: Float - longitude
    • description String - description or Street address of the location

##eCommerce

Add To Cart

See the TUNE SDK docs for more info

Example :

    const params = {
        id           : '0001',
        userIdType   : 'facebook',
        gender       : 'MALE',
        age          : 50,
        revenue      : 0.0,
        currencyCode : 'USD',
        location     : { latitude : 120.999, longitude : 90.000,  description : '' },
        eventItems   : [{itemName : 'book', unitPrice : 1.00, quantity : 1, revenue : 0.0, attribute1 : '',attribute2 : '',attribute3 : '',attribute4 : '',attribute5 : '' }]    
    };

    TuneSDK.addToCart( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • gender (required): String - MALE or FEMALE all upper case.
  • age : Integer - user age
  • revenue : Float - the revenue
  • currencyCode: String - the currency code of the transaction exp. 'USD'
  • location: Object
    • longitude: Float - latitude
    • longitude: Float - longitude
    • description String - description or Street address of the location
  • eventItems: Array of Objects
    • event: Object - example object
      • itemName: String - item name
      • unitPrice: - Float - unit price of item added to cart
      • quantity: - Integer - the quantity number of the item added to cart
      • revenue: - Float - the revenue
      • attribute1: - String
      • attribute2: - String
      • attribute3: - String
      • attribute4: - String
      • attribute5: - String

Add To Wishlist

See the TUNE SDK docs for more info

Example :

    const params = {
        id           : '0001',
        userIdType   : 'facebook',
        currencyCode : 'USD',
        location     : { latitude : 120.999, longitude : 90.000,  description : '' },
        eventItems   : [{itemName : 'book', unitPrice : 1.00, quantity : 1, revenue : 0.0, attribute1 : '',attribute2 : '',attribute3 : '',attribute4 : '',attribute5 : '' }]    
    };

    TuneSDK.addToWishList( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • currencyCode: String - the currency code of the transaction exp. 'USD'
  • location: Object
    • longitude: Float - latitude
    • longitude: Float - longitude
    • description String - description or Street address of the location
  • eventItems: Array of Objects
    • event: Object - example object
      • itemName: String - item name
      • unitPrice: - Float - unit price of item added to cart
      • quantity: - Integer - the quantity number of the item added to cart
      • revenue: - Float - the revenue
      • attribute1: - String
      • attribute2: - String
      • attribute3: - String
      • attribute4: - String
      • attribute5: - String

Added Payment Info

See the TUNE SDK docs for more info

Example :

    const params = {
        id           : '0001',
        userIdType   : 'facebook',
        currencyCode : 'USD',
        location     : { latitude : 120.999, longitude : 90.000,  description : '' },
        eventItems   : [{itemName : 'book', unitPrice : 1.00, quantity : 1, revenue : 0.0, attribute1 : '',attribute2 : '',attribute3 : '',attribute4 : '',attribute5 : '' }]    
    };

    TuneSDK.addedPaymentInfo( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • currencyCode: String - the currency code of the transaction exp. 'USD'
  • location: Object
    • longitude: Float - latitude
    • longitude: Float - longitude
    • description String - description or Street address of the location
  • eventItems: Array of Objects
    • event: Object - example object
      • itemName: String - item name
      • unitPrice: - Float - unit price of item added to cart
      • quantity: - Integer - the quantity number of the item added to cart
      • revenue: - Float - the revenue
      • attribute1: - String
      • attribute2: - String
      • attribute3: - String
      • attribute4: - String
      • attribute5: - String

Checkout Initiated

See the TUNE SDK docs for more info

Example :

    const params = {
        id              : '0001',
        userIdType      : 'facebook',
        revenue         : 0.0,
        currencyCode    : 'USD',
        advertiserRefId : '00001',
        location        : { latitude : 120.999, longitude : 90.000,  description : '' },
        eventItems      : [{itemName : 'book', unitPrice : 1.00, quantity : 1, revenue : 0.0, attribute1 : '',attribute2 : '',attribute3 : '',attribute4 : '',attribute5 : '' }]    
    };

    TuneSDK.checkoutInitiated( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • revenue : Float - the revenue
  • currencyCode: String - the currency code of the transaction exp. 'USD'
  • advertiserRefId: String - advertiser reference Id
  • location: Object
    • longitude: Float - latitude
    • longitude: Float - longitude
    • description String - description or Street address of the location
  • eventItems: Array of Objects
    • event: Object - example object
      • itemName: String - item name
      • unitPrice: - Float - unit price of item added to cart
      • quantity: - Integer - the quantity number of the item added to cart
      • revenue: - Float - the revenue
      • attribute1: - String
      • attribute2: - String
      • attribute3: - String
      • attribute4: - String
      • attribute5: - String

Purchase

See the TUNE SDK docs for more info

Example :

    const params = {
        id              : '0001',
        userIdType      : 'facebook',
        revenue         : 0.0,
        currencyCode    : 'USD',
        advertiserRefId : '00001',
        location        : { latitude : 120.999, longitude : 90.000,  description : '' },
        eventItems      : [{itemName : 'book', unitPrice : 1.00, quantity : 1, revenue : 0.0, attribute1 : '',attribute2 : '',attribute3 : '',attribute4 : '',attribute5 : '' }]    
    };

    TuneSDK.purchase( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • revenue : Float - the revenue
  • currencyCode: String - the currency code of the transaction exp. 'USD'
  • advertiserRefId: String - advertiser reference Id
  • location: Object
    • longitude: Float - latitude
    • longitude: Float - longitude
    • description String - description or Street address of the location
  • eventItems: Array of Objects
    • event: Object - example object
      • itemName: String - item name
      • unitPrice: - Float - unit price of item added to cart
      • quantity: - Integer - the quantity number of the item added to cart
      • revenue: - Float - the revenue
      • attribute1: - String
      • attribute2: - String
      • attribute3: - String
      • attribute4: - String
      • attribute5: - String

Reservation

See the TUNE SDK docs for more info

Example :

    const params = {
      id              : '0001',
      userIdType      : 'facebook',
      gender          : 'FEMALE',
      age             : 50,
      revenue         : 0.0,
      quantity        : 1,
      currencyCode    : 'USD',
      advertiserRefId : '00001',
      date1           : {day : 1, month : 1, year : 2016},
      date2           : {day : 1, month : 1, year : 2016},
      location        : { latitude : 120.999, longitude : 90.000,  description : '' },
      eventItems      : [{itemName : 'book', unitPrice : 1.00, quantity : 1, revenue : 0.0, attribute1 : '',attribute2 : '',attribute3 : '',attribute4 : '',attribute5 : '' }]
  };

    TuneSDK.reservation( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • gender (required): String - MALE or FEMALE all upper case.
  • age: Int - user age
  • revenue : Float - the revenue
  • quantity: Int
  • currencyCode: String - the currency code of the transaction exp. 'USD'
  • advertiserRefId: String - advertiser reference Id
  • location: Object
    • longitude: Float - latitude
    • longitude: Float - longitude
    • description String - description or Street address of the location
  • date1: Object
    • day: Int
    • month: Int
    • year Int
  • date2: Object
    • day: Int
    • month: Int
    • year Int
  • eventItems: Array of Objects
    • event: Object - example object
      • itemName: String - item name
      • unitPrice: - Float - unit price of item added to cart
      • quantity: - Integer - the quantity number of the item added to cart
      • revenue: - Float - the revenue
      • attribute1: - String
      • attribute2: - String
      • attribute3: - String
      • attribute4: - String
      • attribute5: - String

Content

Content View

See the TUNE SDK docs for more info

Example :

    const params = {
        id           : '0001',
        userIdType   : 'facebook',
        currencyCode : 'USD',
        location     : { latitude : 120.999, longitude : 90.000,  description : '' },
        eventItems   : [{itemName : 'book', unitPrice : 1.00, quantity : 1, revenue : 0.0, attribute1 : '',attribute2 : '',attribute3 : '',attribute4 : '',attribute5 : '' }]    
    };

    TuneSDK.contentView( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • currencyCode: String - the currency code of the transaction exp. 'USD'
  • location: Object
    • longitude: Float - latitude
    • longitude: Float - longitude
    • description String - description or Street address of the location
  • eventItems: Array of Objects
    • event: Object - example object
      • itemName: String - item name
      • unitPrice: - Float - unit price of item added to cart
      • quantity: - Integer - the quantity number of the item added to cart
      • revenue: - Float - the revenue
      • attribute1: - String
      • attribute2: - String
      • attribute3: - String
      • attribute4: - String
      • attribute5: - String

Search

See the TUNE SDK docs for more info

Example :

    const params = {
        id           : '0001',
        userIdType   : 'facebook',
        quantity     : 1,
        currencyCode : 'USD',
        searchString : 'Searching string is this',
        location     : { latitude : 120.999, longitude : 90.000,  description : '' },
        data1        : {day : 1, month : 1, year : 2016},
        date2        : {day : 1, month : 1, year : 2016},
        eventItems   : [{itemName : 'book', unitPrice : 1.00, quantity : 1, revenue : 0.0, attribute1 : '',attribute2 : '',attribute3 : '',attribute4 : '',attribute5 : '' }]    
    };

    TuneSDK.search( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • quantity: Int
  • currencyCode: String - the currency code of the transaction exp. 'USD'
  • searchString: String - search string
  • location: Object
    • longitude: Float - latitude
    • longitude: Float - longitude
    • description String - description or Street address of the location
  • date1: Object
    • day: Int
    • month: Int
    • year Int
  • date2: Object
    • day: Int
    • month: Int
    • year Int
  • eventItems: Array of Objects
    • event: Object - example object
      • itemName: String - item name
      • unitPrice: - Float - unit price of item added to cart
      • quantity: - Integer - the quantity number of the item added to cart
      • revenue: - Float - the revenue
      • attribute1: - String
      • attribute2: - String
      • attribute3: - String
      • attribute4: - String
      • attribute5: - String

Gaming

Invite

See the TUNE SDK docs for more info

Example :

    const params = {
        id         : '0001',
        userIdType : 'facebook',
        contentId  : 'Something the user achieved or id reference to that achievement'
    };

    TuneSDK.achievementUnlocked( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • contentId (required): String - Something the user achieved or id reference to that achievement

Level Achieved

See the TUNE SDK docs for more info

Example :

    const params = {
        id         : '0001',
        userIdType : 'facebook',
        level      : 45
    };

    TuneSDK.levelAchieved( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • level (required): Int - level in your game

Spent Credits

See the TUNE SDK docs for more info

Example :

    const params = {
        id         : '0001',
        userIdType : 'facebook',
        credits    : 1009009
    };

    TuneSDK.spentCredits( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • credits (required): Int - credits related to your game

Tutorial Complete

See the TUNE SDK docs for more info

Example :

    const params = {
        id         : '0001',
        userIdType : 'facebook'
    };

    TuneSDK.tutorialComplete( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.

Sharing

Invite

See the TUNE SDK docs for more info

Example :

    const params = {
        id         : '0001',
        userIdType : 'facebook'
    };

    TuneSDK.invite( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.

Rated

See the TUNE SDK docs for more info

Example :

    const params = {
        id         : '0001',
        userIdType : 'facebook',
        rating     : 5.0,
        contentId  : '000001'
    };

    TuneSDK.rated( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.
  • rating : Float - the revenue
  • contentId : String - any descriptive information about the item being rated

Share

See the TUNE SDK docs for more info

Example :

    const params = {
        id         : '0001',
        userIdType : 'facebook'
    };

    TuneSDK.share( params );
  • id (required): String - id of the customer
  • userIdType (required): String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.

registerCustomProfileString

Custom User Profile Variables

See the TUNE SDK docs for more info

Register custom profile String

Example :

    const params = {
        name  : 'CustomValueName',
        value : 'Bob'
    };

    TuneSDK.registerCustomProfileString( params );
  • name (required) : String - name of the custom value
  • value (optional) : String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.

Register custom profile date time

Example :

    const params = {
        name  : 'CustomValueName',
        value : { day : 1, month : 1, year : 2016 }
    };

    TuneSDK.registerCustomProfileDateTime( params );
  • name (required) : String - name of the custom value
  • value (optional) : Object - and object containing a day, month, year integer

Register custom profile number

Example :

    const params = {
        name  : 'CustomValueName',
        value : 1
    };

    TuneSDK.registerCustomProfileNumber( params );
  • name (required) : String - name of the custom value
  • value (optional) : Int - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.

Register custom profile location

Example :

    const params = {
        name  : 'CustomValueName',
        value : { latitude : 120.999, longitude : 90.000,  description : '' }
    };

    TuneSDK.registerCustomProfileGeolocation( params );
  • name (required) : String - name of the custom value
  • value (optional) : Object - containing longitude and latitude values

Set Custom Profile String Value

Example :

    const params = {
        name  : 'CustomValueName',
        value : 'Bob'
    };

    TuneSDK.setCustomProfileStringValue( params );
  • name (required) :** String - name of the custom value
  • value (optional) :** String - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.

Set Custom Profile Date Value

Example :

    const params = {
        name  : 'CustomValueName',
        value : { day : 1, month : 1, year : 2016 }
    };

    TuneSDK.setCustomProfileDate( params );
  • name (required) : String - name of the custom value
  • value (required) : Object - and object containing a day, month, year integer

Set Custom Profile Number Value

Example :

    const params = {
        name  : 'CustomValueName',
        value : 1
    };

    TuneSDK.setCustomProfileNumber( params );
  • name (required) : String - name of the custom value
  • value (required) : Int - the user id type, must be one of these facebook, twitter, google or user if you are using a non-third party id.

Set Custom Profile Geolocation Value

Example :

    const params = {
        name  : 'CustomValueName',
        value : { latitude : 120.999, longitude : 90.000,  description : '' }
    };

    TuneSDK.setCustomProfileGeolocation( params );
  • name (required) : String - name of the custom value
  • value (required) : Object - containing longitude and latitude values

Clear Custom Profile Variable

Example :

    TuneSDK.clearCustomProfileVariable( 'NameOfCustomValue' );
  • name (required) : String - name of the custom value

Clear All Custom Profile Variables

Example :

    TuneSDK.clearAllCustomProfileVariables();

In App Marketing Features

documentation

Enabling Push

documentation

iOS

You will have to follow the instructions here and add the neccessary certs to enable push.

Android

For android you will also need to follow the link above for instructions to on how to get your Google Sender Id, from Google API developer console. Once you create your app and get the Id, make sure you have these items.

  • ** You have your apps configuration find in your projects com.main folder. You can get it from here Google Configuration
  • ** You add the Google Sender Id to the initializer class that you created earlier ( TuneSDK : in the examples )
  public class TuneSDK extends TuneApplication {

      private static Tune tuneInstance;
      private static final String tuneAdvertiserId = "your_advertisment_id";
      private static final String tuneConversionKey = "your_conversion_id";
      // Google Sender Id if you integrated IAM for push notifications
      private static final String tuneSenderId = "google_sender_id";

        @Override
        public void onCreate() {
            super.onCreate();
            tuneInstance = Tune.init( this, tuneAdvertiserId, tuneConversionKey);

            // Add Google Sender Id
            tuneInstance.setPushNotificationSenderId(tuneSenderId);
        }
    }

Power Hooks Registration

documentation

iOS

For iOS, you just have to add a array to the Tune dictionary you created in the Info.plist. Name the array powerHooks. For each hook that you want to register, create an dictionary with the fields hookId, hookValue, and hookDefault with your string values for each like this example.

alt tag

Android

The process for android is a little different. Add your power hooks to the TuneApplication class that you created earlier, right after your Tune.init call. See the example below:

	package com.name.of.your.package;

	import com.tune.Tune;
	import com.tune.ma.application.TuneApplication;

	public class TuneSDK extends TuneApplication {

	    private static Tune tuneInstance;
	    private static final String tuneAdvertiserId = "your_advertisment_id";
	    private static final String tuneConversionKey = "your_conversion_id";

	    @Override
	    public void onCreate() {
	        super.onCreate();
	        tuneInstance = Tune.init( this, tuneAdvertiserId, tuneConversionKey);

	        // Register your Power Hook
	        tuneInstance.registerPowerHook("hook_id", "hook_user_friendly_name_value", "hook_default_value");
	    }

	}

Once register, you can retrieve hook values via Javascript by adding the hook id to an array and passing it to the getPowerHookValues async method in your .

getPowerHookValues - Returns a Map to all the values you requested.

  • name (required) : Array - all the hook id's of the values you want to get
  componentWillMount() {
    this.getYourHookValue(['hook_id']);
  }

  @autobind
  async getYourHookValue(values = []) {
    const hookValues = await TuneSDK.getPowerHookValues(values);

    this.setState({ hookValue : hookValues.feedback_url });

  }

Deep Actions

documentation

TBD