Ejemplo n.º 1
0
 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);
         }
     }
 }
Ejemplo n.º 2
0
    protected override bool AdapterInit(SDKAdapterConfig adapterConfig)
    {
        AdjustAdapterConfig config = (AdjustAdapterConfig)adapterConfig;

        AdjustConfig adjustConfig = new AdjustConfig(config.m_AppToken, config.m_AdjustEnvironment);

        adjustConfig.setLogLevel(config.m_AdjustLogLevel);
        adjustConfig.setLogDelegate(msg => Log.I(msg));
        adjustConfig.setEventBufferingEnabled(config.m_EventBuffering);
        adjustConfig.setSendInBackground(config.m_SendInBackground);

        // adjustConfig.setDeferredDeeplinkDelegate(DeferredDeeplinkCallback);  //深度链接
        // adjustConfig.setEventSuccessDelegate(EventSuccessCallback);
        // adjustConfig.setEventFailureDelegate(EventFailureCallback);
        // adjustConfig.setSessionSuccessDelegate(SessionSuccessCallback);
        // adjustConfig.setSessionFailureDelegate(SessionFailureCallback);
        // adjustConfig.setAttributionChangedDelegate(AttributionChangedCallback);
        Adjust.start(adjustConfig);
        InitSuccess = true;

        m_AdjustDefine = new AdjustDefine();
        m_AdjustDefine.Init();

        Log.I("AdjustAnalysisAdapter init success");
        return(true);
    }
Ejemplo n.º 3
0
        public void SetConfig(string json)
        {
            Debug.Log($"---- AdjustHelper SetConfig // Json {json}");

            if (!string.IsNullOrEmpty(json) && !json.Equals("{}"))
            {
                _adjustData = JsonUtility.FromJson <AdjustData>(json);

                if (string.IsNullOrEmpty(_adjustData.token))
                {
                    Debug.Log("!!!!!!!!!!!!!!!! Error: Adjust Token is Empty ");
                    return;
                }
                else
                {
                    Debug.Log($"AdjustHelper Init // Token {_adjustData.token}");
                }

                var config = new AdjustConfig(_adjustData.token, AdjustEnvironment.Production, false);
                config.setLogLevel(AdjustLogLevel.Verbose);
                config.setSendInBackground(true);
                config.setAttributionChangedDelegate(AttributionChangedCallback);

                config.setDefaultTracker(_adjustData.token);
                config.setAllowIdfaReading(true);
                config.setPreinstallTrackingEnabled(true);
                config.setAllowiAdInfoReading(true);
                config.setAllowAdServicesInfoReading(true);

                config.setEventBufferingEnabled(true);
                //config.setProcessName();

                Adjust.setEnabled(true);
                Adjust.start(config);

                Debug.Log($"Adjust started");
            }
            else
            {
                Debug.Log($"!!!!!!!!!!!!!!!! AdjustHelper isn`t inited");
            }
        }
Ejemplo n.º 4
0
        private void Start()
        {
            string adjustAppToken = Constants.ADJUST_TOKEN_IOS;

            if (Application.platform == RuntimePlatform.Android)
            {
                adjustAppToken = Constants.ADJUST_TOKEN_ANDROID;
            }
            else if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                adjustAppToken = Constants.ADJUST_TOKEN_IOS;
            }

            AdjustEnvironment environment = AdjustEnvironment.Production;

            if (Debug.isDebugBuild)
            {
                environment = AdjustEnvironment.Sandbox;
            }
            else
            {
                environment = AdjustEnvironment.Production;
            }


            AdjustConfig config = new AdjustConfig(adjustAppToken, environment, true);

            config.setDeferredDeeplinkDelegate(DeferredDeeplinkCallback);

            if (Debug.isDebugBuild)
            {
                config.setLogLevel(AdjustLogLevel.Verbose);
            }
            else
            {
                config.setLogLevel(AdjustLogLevel.Info);
            }
            config.setSendInBackground(true);
            new GameObject("Adjust").AddComponent <Adjust>();
            config.setAttributionChangedDelegate(this.attributionChangedDelegate);
            Adjust.start(config);
        }
Ejemplo n.º 5
0
    private void InitAdjust(string adjustAppToken)
    {
        var adjustConfig = new AdjustConfig(
            adjustAppToken,
            AdjustEnvironment.Production, // AdjustEnvironment.Sandbox to test in dashboard
            true
            );

        adjustConfig.setLogLevel(AdjustLogLevel.Info);    // AdjustLogLevel.Suppress to disable logs
        adjustConfig.setSendInBackground(true);
        new GameObject("Adjust").AddComponent <Adjust>(); // do not remove or rename

// Adjust.addSessionCallbackParameter("foo", "bar"); // if requested to set session-level parameters

//adjustConfig.setAttributionChangedDelegate((adjustAttribution) => {
// Debug.LogFormat("Adjust Attribution Callback: ", adjustAttribution.trackerName);
//});

        Adjust.start(adjustConfig);
    }
Ejemplo n.º 6
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;
        }
    }
Ejemplo n.º 7
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;
     }
 }