public void StartAdjust()
 {
     if (this.adjust != null)
     {
         return;
     }
     if (!this.startManually)
     {
         AdjustConfig adjustConfig = new AdjustConfig(this.appToken, this.environment, this.logLevel == AdjustLogLevel.Suppress);
         adjustConfig.setLogLevel(this.logLevel);
         adjustConfig.setSendInBackground(this.sendInBackground);
         adjustConfig.setEventBufferingEnabled(this.eventBuffering);
         adjustConfig.setLaunchDeferredDeeplink(this.launchDeferredDeeplink);
         if (this.printAttribution)
         {
             adjustConfig.setEventSuccessDelegate(new Action <AdjustEventSuccess>(this.EventSuccessCallback), "Adjust");
             adjustConfig.setEventFailureDelegate(new Action <AdjustEventFailure>(this.EventFailureCallback), "Adjust");
             adjustConfig.setSessionSuccessDelegate(new Action <AdjustSessionSuccess>(this.SessionSuccessCallback), "Adjust");
             adjustConfig.setSessionFailureDelegate(new Action <AdjustSessionFailure>(this.SessionFailureCallback), "Adjust");
             adjustConfig.setDeferredDeeplinkDelegate(new Action <string>(this.DeferredDeeplinkCallback), "Adjust");
             adjustConfig.setAttributionChangedDelegate(new Action <AdjustAttribution>(this.AttributionChangedCallback), "Adjust");
         }
         this.start(adjustConfig);
         this.getGoogleAdId(delegate(string googleAdId)
         {
             global::Debug.Log("googleAdId:" + googleAdId);
         });
         string adid = this.getAdid();
         if (adid != null)
         {
             global::Debug.Log("adid:" + adid);
         }
     }
 }
Exemple #2
0
    void OnGUI()
    {
        if (showPopUp)
        {
            GUI.Window(0, new Rect((Screen.width / 2) - 150, (Screen.height / 2) - 65, 300, 130), showGUI, "Is SDK enabled?");
        }

        if (GUI.Button(new Rect(0, Screen.height * 0 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), txtManualLaunch))
        {
            if (!string.Equals(txtManualLaunch, "SDK Launched", StringComparison.OrdinalIgnoreCase))
            {
                AdjustConfig adjustConfig = new AdjustConfig("2fm9gkqubvpc", AdjustEnvironment.Sandbox);
                adjustConfig.setLogLevel(AdjustLogLevel.Verbose);
                adjustConfig.setLogDelegate(msg => Debug.Log(msg));
                adjustConfig.setSendInBackground(true);
                adjustConfig.setLaunchDeferredDeeplink(true);

                adjustConfig.setEventSuccessDelegate(EventSuccessCallback);
                adjustConfig.setEventFailureDelegate(EventFailureCallback);
                adjustConfig.setSessionSuccessDelegate(SessionSuccessCallback);
                adjustConfig.setSessionFailureDelegate(SessionFailureCallback);
                adjustConfig.setDeferredDeeplinkDelegate(DeferredDeeplinkCallback);
                adjustConfig.setAttributionChangedDelegate(AttributionChangedCallback);

                Adjust.start(adjustConfig);
                isEnabled = true;

                txtManualLaunch = "SDK Launched";
            }
        }

        if (GUI.Button(new Rect(0, Screen.height * 1 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Track Simple Event"))
        {
            AdjustEvent adjustEvent = new AdjustEvent("g3mfiw");
            Adjust.trackEvent(adjustEvent);
        }

        if (GUI.Button(new Rect(0, Screen.height * 2 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Track Revenue Event"))
        {
            AdjustEvent adjustEvent = new AdjustEvent("a4fd35");
            adjustEvent.setRevenue(0.25, "EUR");

            Adjust.trackEvent(adjustEvent);
        }

        if (GUI.Button(new Rect(0, Screen.height * 3 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Track Callback Event"))
        {
            AdjustEvent adjustEvent = new AdjustEvent("34vgg9");

            adjustEvent.addCallbackParameter("key", "value");
            adjustEvent.addCallbackParameter("foo", "bar");

            Adjust.trackEvent(adjustEvent);
        }

        if (GUI.Button(new Rect(0, Screen.height * 4 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Track Partner Event"))
        {
            AdjustEvent adjustEvent = new AdjustEvent("w788qs");

            adjustEvent.addPartnerParameter("key", "value");
            adjustEvent.addPartnerParameter("foo", "bar");

            Adjust.trackEvent(adjustEvent);
        }

        if (GUI.Button(new Rect(0, Screen.height * 5 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), txtSetOfflineMode))
        {
            if (string.Equals(txtSetOfflineMode, "Turn Offline Mode ON", StringComparison.OrdinalIgnoreCase))
            {
                Adjust.setOfflineMode(true);
                txtSetOfflineMode = "Turn Offline Mode OFF";
            }
            else
            {
                Adjust.setOfflineMode(false);
                txtSetOfflineMode = "Turn Offline Mode ON";
            }
        }

        if (GUI.Button(new Rect(0, Screen.height * 6 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), txtSetEnabled))
        {
            if (string.Equals(txtSetEnabled, "Disable SDK", StringComparison.OrdinalIgnoreCase))
            {
                Adjust.setEnabled(false);
                txtSetEnabled = "Enable SDK";
            }
            else
            {
                Adjust.setEnabled(true);
                txtSetEnabled = "Disable SDK";
            }
        }

        if (GUI.Button(new Rect(0, Screen.height * 7 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Is SDK Enabled?"))
        {
            isEnabled = Adjust.isEnabled();
            showPopUp = true;
        }
    }
Exemple #3
0
 public static void Init()
 {
     if (AdjustHelper.inited)
     {
         return;
     }
     try
     {
         AdjustEnvironment environment  = (!AdjustHelper.IsSandboxMode()) ? AdjustEnvironment.Production : AdjustEnvironment.Sandbox;
         AdjustLogLevel    logLevel     = (!BuildConfig.LOG_ENABLED) ? AdjustLogLevel.Error : AdjustLogLevel.Verbose;
         AdjustConfig      adjustConfig = new AdjustConfig("6652dk67rxj4", environment);
         adjustConfig.setLogLevel(logLevel);
         AdjustConfig adjustConfig2 = adjustConfig;
         if (AdjustHelper.__f__mg_cache0 == null)
         {
             AdjustHelper.__f__mg_cache0 = new Action <string>(FMLogger.vCore);
         }
         adjustConfig2.setLogDelegate(AdjustHelper.__f__mg_cache0);
         adjustConfig.setEventBufferingEnabled(true);
         adjustConfig.setLaunchDeferredDeeplink(true);
         AdjustConfig adjustConfig3 = adjustConfig;
         if (AdjustHelper.__f__mg_cache1 == null)
         {
             AdjustHelper.__f__mg_cache1 = new Action <AdjustEventSuccess>(AdjustHelper.EventSuccessCallback);
         }
         adjustConfig3.setEventSuccessDelegate(AdjustHelper.__f__mg_cache1, "Adjust");
         AdjustConfig adjustConfig4 = adjustConfig;
         if (AdjustHelper.__f__mg_cache2 == null)
         {
             AdjustHelper.__f__mg_cache2 = new Action <AdjustEventFailure>(AdjustHelper.EventFailureCallback);
         }
         adjustConfig4.setEventFailureDelegate(AdjustHelper.__f__mg_cache2, "Adjust");
         AdjustConfig adjustConfig5 = adjustConfig;
         if (AdjustHelper.__f__mg_cache3 == null)
         {
             AdjustHelper.__f__mg_cache3 = new Action <AdjustSessionSuccess>(AdjustHelper.SessionSuccessCallback);
         }
         adjustConfig5.setSessionSuccessDelegate(AdjustHelper.__f__mg_cache3, "Adjust");
         AdjustConfig adjustConfig6 = adjustConfig;
         if (AdjustHelper.__f__mg_cache4 == null)
         {
             AdjustHelper.__f__mg_cache4 = new Action <AdjustSessionFailure>(AdjustHelper.SessionFailureCallback);
         }
         adjustConfig6.setSessionFailureDelegate(AdjustHelper.__f__mg_cache4, "Adjust");
         AdjustConfig adjustConfig7 = adjustConfig;
         if (AdjustHelper.__f__mg_cache5 == null)
         {
             AdjustHelper.__f__mg_cache5 = new Action <string>(AdjustHelper.DeferredDeeplinkCallback);
         }
         adjustConfig7.setDeferredDeeplinkDelegate(AdjustHelper.__f__mg_cache5, "Adjust");
         AdjustConfig adjustConfig8 = adjustConfig;
         if (AdjustHelper.__f__mg_cache6 == null)
         {
             AdjustHelper.__f__mg_cache6 = new Action <AdjustAttribution>(AdjustHelper.AttributionChangedCallback);
         }
         adjustConfig8.setAttributionChangedDelegate(AdjustHelper.__f__mg_cache6, "Adjust");
         Adjust.start(adjustConfig);
         AdjustHelper.inited = true;
     }
     catch (Exception ex)
     {
         AdjustHelper.inited = false;
         FMLogger.vCore("Adjust init error. " + ex.Message);
     }
 }
Exemple #4
0
 private void OnGUI()
 {
     if (this.showPopUp)
     {
         GUI.Window(0, new Rect((float)(Screen.width / 2 - 150), (float)(Screen.height / 2 - 65), 300f, 130f), new GUI.WindowFunction(this.showGUI), "Is SDK enabled?");
     }
     if (GUI.Button(new Rect(0f, (float)(Screen.height * 0 / this.numberOfButtons), (float)Screen.width, (float)(Screen.height / this.numberOfButtons)), this.txtManualLaunch) && !string.Equals(this.txtManualLaunch, "SDK Launched", StringComparison.OrdinalIgnoreCase))
     {
         AdjustConfig adjustConfig = new AdjustConfig("2fm9gkqubvpc", AdjustEnvironment.Sandbox);
         adjustConfig.setLogLevel(AdjustLogLevel.Verbose);
         adjustConfig.setLogDelegate(delegate(string msg)
         {
             UnityEngine.Debug.Log(msg);
         });
         adjustConfig.setSendInBackground(true);
         adjustConfig.setLaunchDeferredDeeplink(true);
         adjustConfig.setEventSuccessDelegate(new Action <AdjustEventSuccess>(this.EventSuccessCallback), "Adjust");
         adjustConfig.setEventFailureDelegate(new Action <AdjustEventFailure>(this.EventFailureCallback), "Adjust");
         adjustConfig.setSessionSuccessDelegate(new Action <AdjustSessionSuccess>(this.SessionSuccessCallback), "Adjust");
         adjustConfig.setSessionFailureDelegate(new Action <AdjustSessionFailure>(this.SessionFailureCallback), "Adjust");
         adjustConfig.setDeferredDeeplinkDelegate(new Action <string>(this.DeferredDeeplinkCallback), "Adjust");
         adjustConfig.setAttributionChangedDelegate(new Action <AdjustAttribution>(this.AttributionChangedCallback), "Adjust");
         Adjust.start(adjustConfig);
         this.isEnabled       = true;
         this.txtManualLaunch = "SDK Launched";
     }
     if (GUI.Button(new Rect(0f, (float)(Screen.height / this.numberOfButtons), (float)Screen.width, (float)(Screen.height / this.numberOfButtons)), "Track Simple Event"))
     {
         AdjustEvent adjustEvent = new AdjustEvent("g3mfiw");
         Adjust.trackEvent(adjustEvent);
     }
     if (GUI.Button(new Rect(0f, (float)(Screen.height * 2 / this.numberOfButtons), (float)Screen.width, (float)(Screen.height / this.numberOfButtons)), "Track Revenue Event"))
     {
         AdjustEvent adjustEvent2 = new AdjustEvent("a4fd35");
         adjustEvent2.setRevenue(0.25, "EUR");
         Adjust.trackEvent(adjustEvent2);
     }
     if (GUI.Button(new Rect(0f, (float)(Screen.height * 3 / this.numberOfButtons), (float)Screen.width, (float)(Screen.height / this.numberOfButtons)), "Track Callback Event"))
     {
         AdjustEvent adjustEvent3 = new AdjustEvent("34vgg9");
         adjustEvent3.addCallbackParameter("key", "value");
         adjustEvent3.addCallbackParameter("foo", "bar");
         Adjust.trackEvent(adjustEvent3);
     }
     if (GUI.Button(new Rect(0f, (float)(Screen.height * 4 / this.numberOfButtons), (float)Screen.width, (float)(Screen.height / this.numberOfButtons)), "Track Partner Event"))
     {
         AdjustEvent adjustEvent4 = new AdjustEvent("w788qs");
         adjustEvent4.addPartnerParameter("key", "value");
         adjustEvent4.addPartnerParameter("foo", "bar");
         Adjust.trackEvent(adjustEvent4);
     }
     if (GUI.Button(new Rect(0f, (float)(Screen.height * 5 / this.numberOfButtons), (float)Screen.width, (float)(Screen.height / this.numberOfButtons)), this.txtSetOfflineMode))
     {
         if (string.Equals(this.txtSetOfflineMode, "Turn Offline Mode ON", StringComparison.OrdinalIgnoreCase))
         {
             Adjust.setOfflineMode(true);
             this.txtSetOfflineMode = "Turn Offline Mode OFF";
         }
         else
         {
             Adjust.setOfflineMode(false);
             this.txtSetOfflineMode = "Turn Offline Mode ON";
         }
     }
     if (GUI.Button(new Rect(0f, (float)(Screen.height * 6 / this.numberOfButtons), (float)Screen.width, (float)(Screen.height / this.numberOfButtons)), this.txtSetEnabled))
     {
         if (string.Equals(this.txtSetEnabled, "Disable SDK", StringComparison.OrdinalIgnoreCase))
         {
             Adjust.setEnabled(false);
             this.txtSetEnabled = "Enable SDK";
         }
         else
         {
             Adjust.setEnabled(true);
             this.txtSetEnabled = "Disable SDK";
         }
     }
     if (GUI.Button(new Rect(0f, (float)(Screen.height * 7 / this.numberOfButtons), (float)Screen.width, (float)(Screen.height / this.numberOfButtons)), "Is SDK Enabled?"))
     {
         this.isEnabled = Adjust.isEnabled();
         this.showPopUp = true;
     }
 }