コード例 #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);
         }
     }
 }
コード例 #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);
    }
コード例 #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");
            }
        }
コード例 #4
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);
     }
 }