Exemple #1
0
    public void Init()
    {
        //GooglePlay以外平台如amzon平台,发布时需要调用该api
#if UNITY_ANDROID && !UNITY_EDITOR
        UPTraceApi.setCustomerIdForAndroid(GetAndroidID());
#endif

        //欧盟用户展示gdpr弹窗,并在用户拒绝时调用disableAccessPrivacyInformation()
        //UPTraceApi.disableAccessPrivacyInformation();

        //正式包请关闭该debug
        UPTraceApi.enalbeDebugMode(true);

        //init TraceSDK
        UPTraceApi.initTraceSDK(PRODUCTID, CHANNELID);

        //在线时长上报
        OnlineReport();


        //appsflyer
        AppsFlyer.setIsDebug(true);

        AppsFlyer.initSDK(AF_DEV_KEY, AF_APPID, this);


        //iOS 延迟调用上报,目的是确保首次上报在ATT弹窗获得结果之后
#if UNITY_IOS && !UNITY_EDITOR
        AppsFlyeriOS.waitForATTUserAuthorizationWithTimeoutInterval(60);
#endif
        AppsFlyer.startSDK();
    }
        public void initCall(string productId)
        {
            UPTraceApi.initTraceSDK(productId, "32401", UPTraceConstant.UPTraceSDKZoneEnum.UPTraceSDKZoneForeign);

            Debug.Log("===> call init in CSSDKcall");
            // 调用原生的方法
#if UNITY_IOS && !UNITY_EDITOR
            initForIosCssdk(productId);
#elif UNITY_ANDROID && !UNITY_EDITOR
            if (jc != null)
            {
                jc.CallStatic(JavaClassStaticMethod_init, productId);
            }
#endif
        }