コード例 #1
0
ファイル: AdTrace.cs プロジェクト: adtrace/adtrace_sdk_unity
        public static void start(AdTraceConfig adtraceConfig)
        {
            if (IsEditor())
            {
                return;
            }

            if (adtraceConfig == null)
            {
                Debug.Log("AdTrace: Missing config to start.");
                return;
            }

            #if UNITY_IOS
            AdTrace.eventSuccessDelegate       = adtraceConfig.getEventSuccessDelegate();
            AdTrace.eventFailureDelegate       = adtraceConfig.getEventFailureDelegate();
            AdTrace.sessionSuccessDelegate     = adtraceConfig.getSessionSuccessDelegate();
            AdTrace.sessionFailureDelegate     = adtraceConfig.getSessionFailureDelegate();
            AdTrace.deferredDeeplinkDelegate   = adtraceConfig.getDeferredDeeplinkDelegate();
            AdTrace.attributionChangedDelegate = adtraceConfig.getAttributionChangedDelegate();
            AdTraceiOS.Start(adtraceConfig);
            #elif UNITY_ANDROID
            AdTraceAndroid.Start(adtraceConfig);
            #else
            Debug.Log(errorMsgPlatform);
            #endif
        }
コード例 #2
0
        public static void Start(AdTraceConfig adtraceConfig)
        {
            string appToken                              = adtraceConfig.appToken != null ? adtraceConfig.appToken : "ADT_INVALID";
            string sceneName                             = adtraceConfig.sceneName != null ? adtraceConfig.sceneName : "ADT_INVALID";
            string userAgent                             = adtraceConfig.userAgent != null ? adtraceConfig.userAgent : "ADT_INVALID";
            string defaultTracker                        = adtraceConfig.defaultTracker != null ? adtraceConfig.defaultTracker : "ADT_INVALID";
            string environment                           = adtraceConfig.environment.ToLowercaseString();
            long   info1                                 = AdTraceUtils.ConvertLong(adtraceConfig.info1);
            long   info2                                 = AdTraceUtils.ConvertLong(adtraceConfig.info2);
            long   info3                                 = AdTraceUtils.ConvertLong(adtraceConfig.info3);
            long   info4                                 = AdTraceUtils.ConvertLong(adtraceConfig.info4);
            long   secretId                              = AdTraceUtils.ConvertLong(adtraceConfig.secretId);
            double delayStart                            = AdTraceUtils.ConvertDouble(adtraceConfig.delayStart);
            int    logLevel                              = AdTraceUtils.ConvertLogLevel(adtraceConfig.logLevel);
            int    isDeviceKnown                         = AdTraceUtils.ConvertBool(adtraceConfig.isDeviceKnown);
            int    sendInBackground                      = AdTraceUtils.ConvertBool(adtraceConfig.sendInBackground);
            int    eventBufferingEnabled                 = AdTraceUtils.ConvertBool(adtraceConfig.eventBufferingEnabled);
            int    allowSuppressLogLevel                 = AdTraceUtils.ConvertBool(adtraceConfig.allowSuppressLogLevel);
            int    launchDeferredDeeplink                = AdTraceUtils.ConvertBool(adtraceConfig.launchDeferredDeeplink);
            int    isAttributionCallbackImplemented      = AdTraceUtils.ConvertBool(adtraceConfig.getAttributionChangedDelegate() != null);
            int    isEventSuccessCallbackImplemented     = AdTraceUtils.ConvertBool(adtraceConfig.getEventSuccessDelegate() != null);
            int    isEventFailureCallbackImplemented     = AdTraceUtils.ConvertBool(adtraceConfig.getEventFailureDelegate() != null);
            int    isSessionSuccessCallbackImplemented   = AdTraceUtils.ConvertBool(adtraceConfig.getSessionSuccessDelegate() != null);
            int    isSessionFailureCallbackImplemented   = AdTraceUtils.ConvertBool(adtraceConfig.getSessionFailureDelegate() != null);
            int    isDeferredDeeplinkCallbackImplemented = AdTraceUtils.ConvertBool(adtraceConfig.getDeferredDeeplinkDelegate() != null);

            _AdTraceLaunchApp(
                appToken,
                environment,
                sdkPrefix,
                userAgent,
                defaultTracker,
                sceneName,
                allowSuppressLogLevel,
                logLevel,
                isDeviceKnown,
                eventBufferingEnabled,
                sendInBackground,
                secretId,
                info1,
                info2,
                info3,
                info4,
                delayStart,
                launchDeferredDeeplink,
                isAttributionCallbackImplemented,
                isEventSuccessCallbackImplemented,
                isEventFailureCallbackImplemented,
                isSessionSuccessCallbackImplemented,
                isSessionFailureCallbackImplemented,
                isDeferredDeeplinkCallbackImplemented);
        }