示例#1
0
            // Method must be lowercase to match Android method signature.
            public void onFinishedSessionTrackingSucceeded(AndroidJavaObject sessionSuccessData)
            {
                if (callback == null)
                {
                    return;
                }

                if (sessionSuccessData == null)
                {
                    return;
                }

                AdjustSessionSuccess adjustSessionSuccess = new AdjustSessionSuccess();

                adjustSessionSuccess.Adid      = sessionSuccessData.Get <string>(AdjustUtils.KeyAdid);
                adjustSessionSuccess.Message   = sessionSuccessData.Get <string>(AdjustUtils.KeyMessage);
                adjustSessionSuccess.Timestamp = sessionSuccessData.Get <string>(AdjustUtils.KeyTimestamp);

                try
                {
                    AndroidJavaObject ajoJsonResponse    = sessionSuccessData.Get <AndroidJavaObject>(AdjustUtils.KeyJsonResponse);
                    string            jsonResponseString = ajoJsonResponse.Call <string>("toString");
                    adjustSessionSuccess.BuildJsonResponseFromString(jsonResponseString);
                }
                catch (Exception)
                {
                    // JSON response reading failed.
                }

                callback(adjustSessionSuccess);
            }
示例#2
0
            // Method must be lowercase to match Android method signature.
            public void onFinishedSessionTrackingSucceeded(AndroidJavaObject sessionSuccessData)
            {
                if (callback == null)
                {
                    return;
                }
                if (sessionSuccessData == null)
                {
                    return;
                }

                AdjustSessionSuccess adjustSessionSuccess = new AdjustSessionSuccess();

                adjustSessionSuccess.Adid = sessionSuccessData.Get <string>(AdjustUtils.KeyAdid) == "" ?
                                            null : sessionSuccessData.Get <string>(AdjustUtils.KeyAdid);
                adjustSessionSuccess.Message = sessionSuccessData.Get <string>(AdjustUtils.KeyMessage) == "" ?
                                               null : sessionSuccessData.Get <string>(AdjustUtils.KeyMessage);
                adjustSessionSuccess.Timestamp = sessionSuccessData.Get <string>(AdjustUtils.KeyTimestamp) == "" ?
                                                 null : sessionSuccessData.Get <string>(AdjustUtils.KeyTimestamp);

                try
                {
                    AndroidJavaObject ajoJsonResponse    = sessionSuccessData.Get <AndroidJavaObject>(AdjustUtils.KeyJsonResponse);
                    string            jsonResponseString = ajoJsonResponse.Call <string>("toString");
                    adjustSessionSuccess.BuildJsonResponseFromString(jsonResponseString);
                }
                catch (Exception)
                {
                    // JSON response reading failed.
                    // Native Android SDK should send empty JSON object if none available as of v4.12.5.
                    // Native Android SDK added special logic to send Unity friendly values as of v4.15.0.
                }

                callback(adjustSessionSuccess);
            }
示例#3
0
        public void GetNativeSessionSuccess(string sessionSuccessData)
        {
            if (!Application.isEditor)
            {
                if (Adjust.sessionSuccessDelegate == null)
                {
                    Debug.Log("Adjust: Session success delegate was not set.");
                    return;
                }

                var sessionSuccess = new AdjustSessionSuccess(sessionSuccessData);
                Adjust.sessionSuccessDelegate(sessionSuccess);
            }
        }
示例#4
0
        // Token: 0x06000086 RID: 134 RVA: 0x00004258 File Offset: 0x00002658
        public void GetNativeSessionSuccess(string sessionSuccessData)
        {
            if (Adjust.instance == null)
            {
                Debug.Log("adjust: SDK not started. Start it manually using the 'start' method.");
                return;
            }
            if (Adjust.sessionSuccessDelegate == null)
            {
                Debug.Log("adjust: Session success delegate was not set.");
                return;
            }
            AdjustSessionSuccess obj = new AdjustSessionSuccess(sessionSuccessData);

            Adjust.sessionSuccessDelegate(obj);
        }
示例#5
0
        public void GetNativeSessionSuccess(string sessionSuccessData)
        {
            if (IsEditor())
            {
                return;
            }

            if (Adjust.sessionSuccessDelegate == null)
            {
                Debug.Log("[Adjust]: Session success delegate was not set.");
                return;
            }

            var sessionSuccess = new AdjustSessionSuccess(sessionSuccessData);

            Adjust.sessionSuccessDelegate(sessionSuccess);
        }
示例#6
0
        public void GetNativeSessionSuccess(string sessionSuccessData)
        {
            if (instance == null)
            {
                Debug.Log(Adjust.errorMessage);
                return;
            }

            if (Adjust.sessionSuccessDelegate == null)
            {
                Debug.Log("adjust: Session success delegate was not set.");
                return;
            }

            var sessionSuccess = new AdjustSessionSuccess(sessionSuccessData);

            Adjust.sessionSuccessDelegate(sessionSuccess);
        }
示例#7
0
 public void onFinishedSessionTrackingSucceeded(AndroidJavaObject sessionSuccessData)
 {
     if (callback != null && sessionSuccessData != null)
     {
         AdjustSessionSuccess adjustSessionSuccess = new AdjustSessionSuccess();
         adjustSessionSuccess.Adid      = ((!(sessionSuccessData.Get <string>(AdjustUtils.KeyAdid) == string.Empty)) ? sessionSuccessData.Get <string>(AdjustUtils.KeyAdid) : null);
         adjustSessionSuccess.Message   = ((!(sessionSuccessData.Get <string>(AdjustUtils.KeyMessage) == string.Empty)) ? sessionSuccessData.Get <string>(AdjustUtils.KeyMessage) : null);
         adjustSessionSuccess.Timestamp = ((!(sessionSuccessData.Get <string>(AdjustUtils.KeyTimestamp) == string.Empty)) ? sessionSuccessData.Get <string>(AdjustUtils.KeyTimestamp) : null);
         try
         {
             AndroidJavaObject androidJavaObject  = sessionSuccessData.Get <AndroidJavaObject>(AdjustUtils.KeyJsonResponse);
             string            jsonResponseString = androidJavaObject.Call <string>("toString", new object[0]);
             adjustSessionSuccess.BuildJsonResponseFromString(jsonResponseString);
         }
         catch (Exception)
         {
         }
         callback(adjustSessionSuccess);
     }
 }
示例#8
0
 // Token: 0x0600008C RID: 140 RVA: 0x000045B0 File Offset: 0x000029B0
 private void SessionSuccessCallback(AdjustSessionSuccess sessionSuccessData)
 {
     Debug.Log("Session tracked successfully!");
     if (sessionSuccessData.Message != null)
     {
         Debug.Log("Message: " + sessionSuccessData.Message);
     }
     if (sessionSuccessData.Timestamp != null)
     {
         Debug.Log("Timestamp: " + sessionSuccessData.Timestamp);
     }
     if (sessionSuccessData.Adid != null)
     {
         Debug.Log("Adid: " + sessionSuccessData.Adid);
     }
     if (sessionSuccessData.JsonResponse != null)
     {
         Debug.Log("JsonResponse: " + sessionSuccessData.GetJsonResponse());
     }
 }
示例#9
0
        public static void Start(AdjustConfig adjustConfig)
        {
            string logLevelString = null;
            string environment    = adjustConfig.environment.ToLowercaseString();

            Action <Dictionary <string, string> > attributionChangedAction    = null;
            Action <Dictionary <string, string> > sessionSuccessChangedAction = null;
            Action <Dictionary <string, string> > sessionFailureChangedAction = null;
            Action <Dictionary <string, string> > eventSuccessChangedAction   = null;
            Action <Dictionary <string, string> > eventFailureChangedAction   = null;
            Func <string, bool> deeplinkResponseFunc = null;

            if (adjustConfig.logLevel.HasValue)
            {
                logLevelString = adjustConfig.logLevel.Value.ToLowercaseString();
            }

            if (adjustConfig.attributionChangedDelegate != null)
            {
                attributionChangedAction = (attributionMap) =>
                {
                    var attribution = new AdjustAttribution(attributionMap);
                    adjustConfig.attributionChangedDelegate(attribution);
                };
            }

            if (adjustConfig.sessionSuccessDelegate != null)
            {
                sessionSuccessChangedAction = (sessionMap) =>
                {
                    var sessionData = new AdjustSessionSuccess(sessionMap);
                    adjustConfig.sessionSuccessDelegate(sessionData);
                };
            }

            if (adjustConfig.sessionFailureDelegate != null)
            {
                sessionFailureChangedAction = (sessionMap) =>
                {
                    var sessionData = new AdjustSessionFailure(sessionMap);
                    adjustConfig.sessionFailureDelegate(sessionData);
                };
            }

            if (adjustConfig.eventSuccessDelegate != null)
            {
                eventSuccessChangedAction = (eventMap) =>
                {
                    var eventData = new AdjustEventSuccess(eventMap);
                    adjustConfig.eventSuccessDelegate(eventData);
                };
            }

            if (adjustConfig.eventFailureDelegate != null)
            {
                eventFailureChangedAction = (eventMap) =>
                {
                    var eventData = new AdjustEventFailure(eventMap);
                    adjustConfig.eventFailureDelegate(eventData);
                };
            }

            if (adjustConfig.deferredDeeplinkDelegate != null)
            {
                deeplinkResponseFunc = uri =>
                {
                    if (adjustConfig.launchDeferredDeeplink)
                    {
                        adjustConfig.deferredDeeplinkDelegate(uri);
                    }

                    return(adjustConfig.launchDeferredDeeplink);
                };
            }

            bool sendInBackground = false;

            if (adjustConfig.sendInBackground.HasValue)
            {
                sendInBackground = adjustConfig.sendInBackground.Value;
            }

            double delayStartSeconds = 0;

            if (adjustConfig.delayStart.HasValue)
            {
                delayStartSeconds = adjustConfig.delayStart.Value;
            }

            AdjustConfigDto adjustConfigDto = new AdjustConfigDto {
                AppToken                     = adjustConfig.appToken,
                Environment                  = environment,
                SdkPrefix                    = sdkPrefix,
                SendInBackground             = sendInBackground,
                DelayStart                   = delayStartSeconds,
                UserAgent                    = adjustConfig.userAgent,
                DefaultTracker               = adjustConfig.defaultTracker,
                EventBufferingEnabled        = adjustConfig.eventBufferingEnabled,
                LaunchDeferredDeeplink       = adjustConfig.launchDeferredDeeplink,
                LogLevelString               = logLevelString,
                LogDelegate                  = adjustConfig.logDelegate,
                ActionAttributionChangedData = attributionChangedAction,
                ActionSessionSuccessData     = sessionSuccessChangedAction,
                ActionSessionFailureData     = sessionFailureChangedAction,
                ActionEventSuccessData       = eventSuccessChangedAction,
                ActionEventFailureData       = eventFailureChangedAction,
                FuncDeeplinkResponseData     = deeplinkResponseFunc,
                IsDeviceKnown                = adjustConfig.isDeviceKnown,
                SecretId                     = adjustConfig.secretId,
                Info1 = adjustConfig.info1,
                Info2 = adjustConfig.info2,
                Info3 = adjustConfig.info3,
                Info4 = adjustConfig.info4
            };

            AdjustWinInterface.ApplicationLaunching(adjustConfigDto);
            AdjustWinInterface.ApplicationActivated();
            appLaunched = true;
        }