// 生命周期函数 public override void OnInit() { /* Mandatory - set your AppsFlyer’s Developer key. */ AppsFlyer.setAppsFlyerKey(Config.ID.GetValue("AppsFlyerKey")); /* For detailed logging */ /* AppsFlyer.setIsDebug (true); */ #if UNITY_IOS /* Mandatory - set your apple app ID * NOTE: You should enter the number only and not the "ID" prefix */ AppsFlyer.setAppID(Config.ID.GetValue("AppId")); AppsFlyer.trackAppLaunch(); // register to push notifications for iOS uninstall UnityEngine.iOS.NotificationServices.RegisterForNotifications(UnityEngine.iOS.NotificationType.Alert | UnityEngine.iOS.NotificationType.Badge | UnityEngine.iOS.NotificationType.Sound); #elif UNITY_ANDROID // /* Mandatory - set your Android package name */ // AppsFlyer.setAppID ("YOUR_ANDROID_PACKAGE_NAME_HERE"); // /* For getting the conversion data in Android, you need to add the "AppsFlyerTrackerCallbacks" listener.*/ // AppsFlyer.init ("YOUR_APPSFLYER_DEV_KEY","AppsFlyerTrackerCallbacks"); #endif // 初始化高级属性数据发送的开关 this.m_isAdvancedToggleOn = Config.ID.GetToggle("AppsFlyerAdvanced"); this.SendLaunchEvent(); }
private void Init() { Application.runInBackground = true; DontDestroyOnLoad(this); #if UNITY_IOS AppsFlyer.setAppsFlyerKey("c6S7FBQfBhj7Do6WTG4jte"); AppsFlyer.setAppID("1358980931"); //AppsFlyer.setIsDebug (true); AppsFlyer.getConversionData(); AppsFlyer.trackAppLaunch(); #elif UNITY_ANDROID AppsFlyer.init("c6S7FBQfBhj7Do6WTG4jte"); //AppsFlyer.setAppID ("YOUR_APP_ID"); // for getting the conversion data AppsFlyer.loadConversionData("StartUp"); // for in app billing validation // AppsFlyer.createValidateInAppListener ("AppsFlyerTrackerCallbacks", "onInAppBillingSuccess", "onInAppBillingFailure"); //For Android Uninstall //AppsFlyer.setGCMProjectNumber ("YOUR_GCM_PROJECT_NUMBER"); #endif }
// Use this for initialization void Start() { print("@@@@@ AppsFlyerTrackerCallbacks on Start @@@@@"); #if UNITY_IOS AppsFlyer.setAppsFlyerKey(APPSFLAYER_DEV_KEY); AppsFlyer.setAppID(APP_PACKAGE_NAME); // For detailed logging // AppsFlyer.setIsDebug (true); // For getting the conversion data will be triggered on AppsFlyerTrackerCallbacks.cs file AppsFlyer.getConversionData(); // For testing validate in app purchase (test against Apple's sandbox environment //AppsFlyer.setIsSandbox(true); AppsFlyer.trackAppLaunch(); #elif UNITY_ANDROID AppsFlyer.setAppsFlyerKey(APPSFLAYER_DEV_KEY); AppsFlyer.setAppID(APP_PACKAGE_NAME); //AppsFlyer.setIsDebug (true); //AppsFlyer.createValidateInAppListener ("AppsFlyerTrackerCallbacks", "onInAppBillingSuccess", "onInAppBillingFailure"); //AppsFlyer.loadConversionData("AppsFlyerTrackerCallbacks","didReceiveConversionData", "didReceiveConversionDataWithError"); #endif DontDestroyOnLoad(this.gameObject); }
private void InitAppsFlyer() { /* Mandatory - set your AppsFlyer’s Developer key. */ AppsFlyer.setAppsFlyerKey("BdP724hHJFraJaxKXvNex7"); /* For detailed logging */ //AppsFlyer.setIsDebug (true); #if UNITY_IOS /* Mandatory - set your apple app ID NOTE: You should enter the number only and not the "ID" prefix */ AppsFlyer.setAppID ("1486122716 "); AppsFlyer.getConversionData(); AppsFlyer.trackAppLaunch (); #elif UNITY_ANDROID /* Mandatory - set your Android package name */ AppsFlyer.setAppID("net.gogame.pewpewplanet"); /* For getting the conversion data in Android, you need to add the "AppsFlyerTrackerCallbacks" listener.*/ AppsFlyer.init("BdP724hHJFraJaxKXvNex7", "AppsFlyerTrackerCallbacks"); AppsFlyer.createValidateInAppListener("AppsFlyerTrackerCallbacks", "onInAppBillingSuccess", "onInAppBillingFailure"); #endif AFTrackRichEvent("app_open"); }
public void SessionStart(string trUserId) { this.Initialize(trUserId); AppsFlyer.trackAppLaunch(); }