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); }
private void InitAdjust(string token) { if (UnityEngine.Object.FindObjectOfType(typeof(Adjust)) == null) { GameObject ga = new GameObject(); ga.name = "Adjust"; //ga.transform.parent = transform; ga.AddComponent <Adjust>(); } else { Debug.LogWarning("A GameAnalytics object already exists in this scene - you should never have more than one per scene!"); } AdjustConfig config = new AdjustConfig(token, AdjustEnvironment.Production, true); config.setLogLevel(AdjustLogLevel.Suppress); config.setLogDelegate(msg => Debug.Log(msg)); Adjust.start(config); }
public void Init(string token) { if (string.IsNullOrEmpty(token)) { AdId = "organic"; return; } #if UNITY_ANDROID && !UNITY_EDITOR AdjustConfig config = new AdjustConfig(token, AdjustEnvironment.Production, false); config.setLogLevel(AdjustLogLevel.Verbose); config.setLogDelegate(msg => Debug.Log(msg)); //config.setAttributionChangedDelegate(AttributionChangedCallback); Adjust.start(config); #else Debug.Log("ADID IS ORGANIC"); AdId = "organic"; #endif }
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; } }
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); } }
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; } }