Example #1
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);
        }
Example #2
0
        public static void TrackEvent(AdTraceEvent adtraceEvent)
        {
            int    isReceiptSet  = AdTraceUtils.ConvertBool(adtraceEvent.isReceiptSet);
            double revenue       = AdTraceUtils.ConvertDouble(adtraceEvent.revenue);
            string eventToken    = adtraceEvent.eventToken;
            string currency      = adtraceEvent.currency;
            string receipt       = adtraceEvent.receipt;
            string transactionId = adtraceEvent.transactionId;
            string callbackId    = adtraceEvent.callbackId;
            string stringJsonCallBackParameters = AdTraceUtils.ConvertListToJson(adtraceEvent.callbackList);
            string stringJsonPartnerParameters  = AdTraceUtils.ConvertListToJson(adtraceEvent.partnerList);

            _AdTraceTrackEvent(eventToken, revenue, currency, receipt, transactionId, callbackId, isReceiptSet, stringJsonCallBackParameters, stringJsonPartnerParameters);
        }
Example #3
0
        // Used for testing only.
        public static void SetTestOptions(Dictionary <string, string> testOptions)
        {
            string baseUrl             = testOptions[AdTraceUtils.KeyTestOptionsBaseUrl];
            string gdprUrl             = testOptions[AdTraceUtils.KeyTestOptionsGdprUrl];
            string basePath            = testOptions.ContainsKey(AdTraceUtils.KeyTestOptionsBasePath) ? testOptions[AdTraceUtils.KeyTestOptionsBasePath] : null;
            string gdprPath            = testOptions.ContainsKey(AdTraceUtils.KeyTestOptionsGdprPath) ? testOptions[AdTraceUtils.KeyTestOptionsGdprPath] : null;
            long   timerIntervalMilis  = -1;
            long   timerStartMilis     = -1;
            long   sessionIntMilis     = -1;
            long   subsessionIntMilis  = -1;
            bool   teardown            = false;
            bool   deleteState         = false;
            bool   noBackoffWait       = false;
            bool   iAdFrameworkEnabled = false;

            if (testOptions.ContainsKey(AdTraceUtils.KeyTestOptionsTimerIntervalInMilliseconds))
            {
                timerIntervalMilis = long.Parse(testOptions[AdTraceUtils.KeyTestOptionsTimerIntervalInMilliseconds]);
            }
            if (testOptions.ContainsKey(AdTraceUtils.KeyTestOptionsTimerStartInMilliseconds))
            {
                timerStartMilis = long.Parse(testOptions[AdTraceUtils.KeyTestOptionsTimerStartInMilliseconds]);
            }
            if (testOptions.ContainsKey(AdTraceUtils.KeyTestOptionsSessionIntervalInMilliseconds))
            {
                sessionIntMilis = long.Parse(testOptions[AdTraceUtils.KeyTestOptionsSessionIntervalInMilliseconds]);
            }
            if (testOptions.ContainsKey(AdTraceUtils.KeyTestOptionsSubsessionIntervalInMilliseconds))
            {
                subsessionIntMilis = long.Parse(testOptions[AdTraceUtils.KeyTestOptionsSubsessionIntervalInMilliseconds]);
            }
            if (testOptions.ContainsKey(AdTraceUtils.KeyTestOptionsTeardown))
            {
                teardown = testOptions[AdTraceUtils.KeyTestOptionsTeardown].ToLower() == "true";
            }
            if (testOptions.ContainsKey(AdTraceUtils.KeyTestOptionsDeleteState))
            {
                deleteState = testOptions[AdTraceUtils.KeyTestOptionsDeleteState].ToLower() == "true";
            }
            if (testOptions.ContainsKey(AdTraceUtils.KeyTestOptionsNoBackoffWait))
            {
                noBackoffWait = testOptions[AdTraceUtils.KeyTestOptionsNoBackoffWait].ToLower() == "true";
            }
            if (testOptions.ContainsKey(AdTraceUtils.KeyTestOptionsiAdFrameworkEnabled))
            {
                iAdFrameworkEnabled = testOptions[AdTraceUtils.KeyTestOptionsiAdFrameworkEnabled].ToLower() == "true";
            }

            _AdTraceSetTestOptions(
                baseUrl,
                basePath,
                gdprUrl,
                gdprPath,
                timerIntervalMilis,
                timerStartMilis,
                sessionIntMilis,
                subsessionIntMilis,
                AdTraceUtils.ConvertBool(teardown),
                AdTraceUtils.ConvertBool(deleteState),
                AdTraceUtils.ConvertBool(noBackoffWait),
                AdTraceUtils.ConvertBool(iAdFrameworkEnabled));
        }
Example #4
0
 public static void SetOfflineMode(bool enabled)
 {
     _AdTraceSetOfflineMode(AdTraceUtils.ConvertBool(enabled));
 }
Example #5
0
 public static void SetEnabled(bool enabled)
 {
     _AdTraceSetEnabled(AdTraceUtils.ConvertBool(enabled));
 }