public void InitializeAppsFlyer() { if (!base.Inited) { AppsFlyer.initSDK("nr8SibwpFjcKGBQNpDdttd", "com.futureplay.minecraft"); AppsFlyer.setCustomerUserId(PlayerData.Instance.PlayerId); AppsFlyer.trackAppLaunch(); PlayerData.Instance.DaysRetained.Skip(1).Subscribe(delegate(int days) { AppsFlyer.trackRichEvent("Retained_Day", new Dictionary <string, string> { { "Day", days.ToString() } }); }); (from res in PersistentSingleton <AdService> .Instance.AdResults where res.result == AdService.V2PShowResult.Finished select res).Subscribe(delegate(AdWatched adWatched) { AppsFlyer.trackRichEvent("Ad_Watched", adWatched.asDictionary()); }); base.Inited = true; } }
void InitAppsFlyerSDK() { #if UNITY_IOS && !UNITY_EDITOR if (useATT) { AppsFlyeriOS.waitForATTUserAuthorizationWithTimeoutInterval(attDuration); } if (disableSKAd) { AppsFlyeriOS.disableSKAdNetwork(true); } #endif // These fields are set from the editor so do not modify! //******************************// AppsFlyer.setIsDebug(true); AppsFlyer.initSDK(devKey, appId, this); //******************************// if (useUDL) { AppsFlyer.OnDeepLinkReceived += OnDeepLink; } if (!String.IsNullOrEmpty(userInviteOneLinkId)) { AppsFlyer.setAppInviteOneLinkID(userInviteOneLinkId); } if (!String.IsNullOrEmpty(cuid)) { AppsFlyer.setCustomerUserId(cuid); } onSDKStarted(); if (DelaySdkStartTime > 0) { StartCoroutine(DelaySdkStartUp()); } else { AppsFlyer.startSDK(); } }
public void Update() { //AF 与AvidlyTraceSDK 互传,只设置一次,且确保拿到的不为空 if (!HasSetAFID) { //获取 afid string afid = AppsFlyer.getAppsFlyerId(); // 获取openId string openId = UPTraceApi.getOpenId(); if (afid == null || afid == "" || openId == null || openId == "") { return; } Debug.Log("afid=" + afid); Debug.Log("openId=" + openId); // 将openId赋值给AppsFlyer AppsFlyer.setCustomerUserId(openId); // 将afid赋值给统计包 UPTraceApi.setAFId(afid); HasSetAFID = true; } }