From 4f2e8f711d561a67173c5df90da4ebd840af57b1 Mon Sep 17 00:00:00 2001 From: cuibeibei Date: Wed, 31 Jan 2018 14:28:44 +0800 Subject: [PATCH 1/6] Adjust:All Functions Add UNITY_EDITOR Handles,To Fix Error When Project Run At Unity Editor Model --- Assets/Adjust/Adjust.cs | 104 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 98 insertions(+), 6 deletions(-) diff --git a/Assets/Adjust/Adjust.cs b/Assets/Adjust/Adjust.cs index f6e57818..84e74120 100644 --- a/Assets/Adjust/Adjust.cs +++ b/Assets/Adjust/Adjust.cs @@ -8,6 +8,7 @@ public class Adjust : MonoBehaviour { private const string errorMsgStart = "Adjust: SDK not started. Start it manually using the 'start' method."; private const string errorMsgPlatform = "Adjust: SDK can only be used in Android, iOS, Windows Phone 8.1, Windows Store or Universal Windows apps."; + private const string errorMsgUnityEditor = "Adjust: SDK can't be used in UnityEditor."; public bool startManually = true; public bool eventBuffering = false; @@ -46,6 +47,10 @@ void Awake() void OnApplicationPause(bool pauseStatus) { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS // No action, iOS SDK is subscribed to iOS lifecycle notifications. #elif UNITY_ANDROID @@ -79,12 +84,19 @@ public static void start(AdjustConfig adjustConfig) return; } #if UNITY_IOS - Adjust.eventSuccessDelegate = adjustConfig.getEventSuccessDelegate(); - Adjust.eventFailureDelegate = adjustConfig.getEventFailureDelegate(); - Adjust.sessionSuccessDelegate = adjustConfig.getSessionSuccessDelegate(); - Adjust.sessionFailureDelegate = adjustConfig.getSessionFailureDelegate(); - Adjust.deferredDeeplinkDelegate = adjustConfig.getDeferredDeeplinkDelegate(); - Adjust.attributionChangedDelegate = adjustConfig.getAttributionChangedDelegate(); + Adjust.eventSuccessDelegate = adjustConfig.getEventSuccessDelegate(); + Adjust.eventFailureDelegate = adjustConfig.getEventFailureDelegate(); + Adjust.sessionSuccessDelegate = adjustConfig.getSessionSuccessDelegate(); + Adjust.sessionFailureDelegate = adjustConfig.getSessionFailureDelegate(); + Adjust.deferredDeeplinkDelegate = adjustConfig.getDeferredDeeplinkDelegate(); + Adjust.attributionChangedDelegate = adjustConfig.getAttributionChangedDelegate(); +#endif + +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif +#if UNITY_IOS AdjustiOS.Start(adjustConfig); #elif UNITY_ANDROID AdjustAndroid.Start(adjustConfig); @@ -102,6 +114,10 @@ public static void trackEvent(AdjustEvent adjustEvent) Debug.Log("Adjust: Missing event to track."); return; } +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS AdjustiOS.TrackEvent(adjustEvent); #elif UNITY_ANDROID @@ -115,6 +131,10 @@ public static void trackEvent(AdjustEvent adjustEvent) public static void setEnabled(bool enabled) { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS AdjustiOS.SetEnabled(enabled); #elif UNITY_ANDROID @@ -128,6 +148,10 @@ public static void setEnabled(bool enabled) public static bool isEnabled() { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return false; +#endif #if UNITY_IOS return AdjustiOS.IsEnabled(); #elif UNITY_ANDROID @@ -142,6 +166,10 @@ public static bool isEnabled() public static void setOfflineMode(bool enabled) { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS AdjustiOS.SetOfflineMode(enabled); #elif UNITY_ANDROID @@ -155,6 +183,10 @@ public static void setOfflineMode(bool enabled) public static void setDeviceToken(string deviceToken) { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS AdjustiOS.SetDeviceToken(deviceToken); #elif UNITY_ANDROID @@ -168,6 +200,10 @@ public static void setDeviceToken(string deviceToken) public static void appWillOpenUrl(string url) { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS AdjustiOS.AppWillOpenUrl(url); #elif UNITY_ANDROID @@ -181,6 +217,10 @@ public static void appWillOpenUrl(string url) public static void sendFirstPackages() { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS AdjustiOS.SendFirstPackages(); #elif UNITY_ANDROID @@ -194,6 +234,10 @@ public static void sendFirstPackages() public static void addSessionPartnerParameter(string key, string value) { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS AdjustiOS.AddSessionPartnerParameter(key, value); #elif UNITY_ANDROID @@ -207,6 +251,10 @@ public static void addSessionPartnerParameter(string key, string value) public static void addSessionCallbackParameter(string key, string value) { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS AdjustiOS.AddSessionCallbackParameter(key, value); #elif UNITY_ANDROID @@ -220,6 +268,10 @@ public static void addSessionCallbackParameter(string key, string value) public static void removeSessionPartnerParameter(string key) { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS AdjustiOS.RemoveSessionPartnerParameter(key); #elif UNITY_ANDROID @@ -233,6 +285,10 @@ public static void removeSessionPartnerParameter(string key) public static void removeSessionCallbackParameter(string key) { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS AdjustiOS.RemoveSessionCallbackParameter(key); #elif UNITY_ANDROID @@ -246,6 +302,10 @@ public static void removeSessionCallbackParameter(string key) public static void resetSessionPartnerParameters() { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS AdjustiOS.ResetSessionPartnerParameters(); #elif UNITY_ANDROID @@ -259,6 +319,10 @@ public static void resetSessionPartnerParameters() public static void resetSessionCallbackParameters() { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS AdjustiOS.ResetSessionCallbackParameters(); #elif UNITY_ANDROID @@ -272,6 +336,10 @@ public static void resetSessionCallbackParameters() public static string getAdid() { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return string.Empty; +#endif #if UNITY_IOS return AdjustiOS.GetAdid(); #elif UNITY_ANDROID @@ -286,6 +354,10 @@ public static string getAdid() public static AdjustAttribution getAttribution() { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return null; +#endif #if UNITY_IOS return AdjustiOS.GetAttribution(); #elif UNITY_ANDROID @@ -300,6 +372,10 @@ public static AdjustAttribution getAttribution() public static string getWinAdid() { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return string.Empty; +#endif #if UNITY_IOS Debug.Log("Adjust: Error! Windows Advertising ID is not available on iOS platform."); return string.Empty; @@ -316,6 +392,10 @@ public static string getWinAdid() public static string getIdfa() { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return string.Empty; +#endif #if UNITY_IOS return AdjustiOS.GetIdfa(); #elif UNITY_ANDROID @@ -333,6 +413,10 @@ public static string getIdfa() [Obsolete("This method is intended for testing purposes only. Do not use it.")] public static void setReferrer(string referrer) { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS Debug.Log("Adjust: Install referrer is not available on iOS platform."); #elif UNITY_ANDROID @@ -346,6 +430,10 @@ public static void setReferrer(string referrer) public static void getGoogleAdId(Action onDeviceIdsRead) { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return; +#endif #if UNITY_IOS Debug.Log("Adjust: Google Play Advertising ID is not available on iOS platform."); onDeviceIdsRead(string.Empty); @@ -361,6 +449,10 @@ public static void getGoogleAdId(Action onDeviceIdsRead) public static string getAmazonAdId() { +#if UNITY_EDITOR + Debug.Log(errorMsgUnityEditor); + return string.Empty; +#endif #if UNITY_IOS Debug.Log("Adjust: Amazon Advertising ID is not available on iOS platform."); return string.Empty; From 911615accc3917007d90a195427ce728b4f607b6 Mon Sep 17 00:00:00 2001 From: uerceg Date: Wed, 7 Feb 2018 22:29:19 +0100 Subject: [PATCH 2/6] Prevent SDK code execution within Editor --- Assets/Adjust/Adjust.cs | 767 ++++++++++++++++++++-------------------- 1 file changed, 393 insertions(+), 374 deletions(-) diff --git a/Assets/Adjust/Adjust.cs b/Assets/Adjust/Adjust.cs index 84e74120..34d3246b 100644 --- a/Assets/Adjust/Adjust.cs +++ b/Assets/Adjust/Adjust.cs @@ -8,7 +8,6 @@ public class Adjust : MonoBehaviour { private const string errorMsgStart = "Adjust: SDK not started. Start it manually using the 'start' method."; private const string errorMsgPlatform = "Adjust: SDK can only be used in Android, iOS, Windows Phone 8.1, Windows Store or Universal Windows apps."; - private const string errorMsgUnityEditor = "Adjust: SDK can't be used in UnityEditor."; public bool startManually = true; public bool eventBuffering = false; @@ -20,7 +19,7 @@ public class Adjust : MonoBehaviour public AdjustLogLevel logLevel = AdjustLogLevel.Info; public AdjustEnvironment environment = AdjustEnvironment.Sandbox; -#if UNITY_IOS + #if UNITY_IOS // Delegate references for iOS callback triggering private static Action deferredDeeplinkDelegate = null; private static Action eventSuccessDelegate = null; @@ -28,515 +27,535 @@ public class Adjust : MonoBehaviour private static Action sessionSuccessDelegate = null; private static Action sessionFailureDelegate = null; private static Action attributionChangedDelegate = null; -#endif + #endif void Awake() { - DontDestroyOnLoad(transform.gameObject); - - if (!this.startManually) + if (!Application.isEditor) { - 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); - Adjust.start(adjustConfig); + DontDestroyOnLoad(transform.gameObject); + + 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); + Adjust.start(adjustConfig); + } } } void OnApplicationPause(bool pauseStatus) { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - // No action, iOS SDK is subscribed to iOS lifecycle notifications. -#elif UNITY_ANDROID - if (pauseStatus) - { - AdjustAndroid.OnPause(); - } - else - { - AdjustAndroid.OnResume(); - } -#elif (UNITY_WSA || UNITY_WP8) - if (pauseStatus) + if (!Application.isEditor) { - AdjustWindows.OnPause(); + #if UNITY_IOS + // No action, iOS SDK is subscribed to iOS lifecycle notifications. + #elif UNITY_ANDROID + if (pauseStatus) + { + AdjustAndroid.OnPause(); + } + else + { + AdjustAndroid.OnResume(); + } + #elif (UNITY_WSA || UNITY_WP8) + if (pauseStatus) + { + AdjustWindows.OnPause(); + } + else + { + AdjustWindows.OnResume(); + } + #else + Debug.Log(errorMsgPlatform); + #endif } - else - { - AdjustWindows.OnResume(); - } -#else - Debug.Log(errorMsgPlatform); -#endif } public static void start(AdjustConfig adjustConfig) { - if (adjustConfig == null) + if (!Application.isEditor) { - Debug.Log("Adjust: Missing config to start."); - return; + if (adjustConfig == null) + { + Debug.Log("Adjust: Missing config to start."); + return; + } + #if UNITY_IOS + Adjust.eventSuccessDelegate = adjustConfig.getEventSuccessDelegate(); + Adjust.eventFailureDelegate = adjustConfig.getEventFailureDelegate(); + Adjust.sessionSuccessDelegate = adjustConfig.getSessionSuccessDelegate(); + Adjust.sessionFailureDelegate = adjustConfig.getSessionFailureDelegate(); + Adjust.deferredDeeplinkDelegate = adjustConfig.getDeferredDeeplinkDelegate(); + Adjust.attributionChangedDelegate = adjustConfig.getAttributionChangedDelegate(); + AdjustiOS.Start(adjustConfig); + #elif UNITY_ANDROID + AdjustAndroid.Start(adjustConfig); + #elif (UNITY_WSA || UNITY_WP8) + AdjustWindows.Start(adjustConfig); + #else + Debug.Log(errorMsgPlatform); + #endif } -#if UNITY_IOS - Adjust.eventSuccessDelegate = adjustConfig.getEventSuccessDelegate(); - Adjust.eventFailureDelegate = adjustConfig.getEventFailureDelegate(); - Adjust.sessionSuccessDelegate = adjustConfig.getSessionSuccessDelegate(); - Adjust.sessionFailureDelegate = adjustConfig.getSessionFailureDelegate(); - Adjust.deferredDeeplinkDelegate = adjustConfig.getDeferredDeeplinkDelegate(); - Adjust.attributionChangedDelegate = adjustConfig.getAttributionChangedDelegate(); -#endif - -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - AdjustiOS.Start(adjustConfig); -#elif UNITY_ANDROID - AdjustAndroid.Start(adjustConfig); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.Start(adjustConfig); -#else - Debug.Log(errorMsgPlatform); -#endif } public static void trackEvent(AdjustEvent adjustEvent) { - if (adjustEvent == null) + if (!Application.isEditor) { - Debug.Log("Adjust: Missing event to track."); - return; + if (adjustEvent == null) + { + Debug.Log("Adjust: Missing event to track."); + return; + } + #if UNITY_IOS + AdjustiOS.TrackEvent(adjustEvent); + #elif UNITY_ANDROID + AdjustAndroid.TrackEvent(adjustEvent); + #elif (UNITY_WSA || UNITY_WP8) + AdjustWindows.TrackEvent(adjustEvent); + #else + Debug.Log(errorMsgPlatform); + #endif } -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - AdjustiOS.TrackEvent(adjustEvent); -#elif UNITY_ANDROID - AdjustAndroid.TrackEvent(adjustEvent); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.TrackEvent(adjustEvent); -#else - Debug.Log(errorMsgPlatform); -#endif } public static void setEnabled(bool enabled) { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - AdjustiOS.SetEnabled(enabled); -#elif UNITY_ANDROID - AdjustAndroid.SetEnabled(enabled); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.SetEnabled(enabled); -#else - Debug.Log(errorMsgPlatform); -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + AdjustiOS.SetEnabled(enabled); + #elif UNITY_ANDROID + AdjustAndroid.SetEnabled(enabled); + #elif (UNITY_WSA || UNITY_WP8) + AdjustWindows.SetEnabled(enabled); + #else + Debug.Log(errorMsgPlatform); + #endif + } } public static bool isEnabled() { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return false; -#endif -#if UNITY_IOS - return AdjustiOS.IsEnabled(); -#elif UNITY_ANDROID - return AdjustAndroid.IsEnabled(); -#elif (UNITY_WSA || UNITY_WP8) - return AdjustWindows.IsEnabled(); -#else - Debug.Log(errorMsgPlatform); - return false; -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + return AdjustiOS.IsEnabled(); + #elif UNITY_ANDROID + return AdjustAndroid.IsEnabled(); + #elif (UNITY_WSA || UNITY_WP8) + return AdjustWindows.IsEnabled(); + #else + Debug.Log(errorMsgPlatform); + return false; + #endif + } + else + { + return false; + } } public static void setOfflineMode(bool enabled) { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - AdjustiOS.SetOfflineMode(enabled); -#elif UNITY_ANDROID - AdjustAndroid.SetOfflineMode(enabled); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.SetOfflineMode(enabled); -#else - Debug.Log(errorMsgPlatform); -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + AdjustiOS.SetOfflineMode(enabled); + #elif UNITY_ANDROID + AdjustAndroid.SetOfflineMode(enabled); + #elif (UNITY_WSA || UNITY_WP8) + AdjustWindows.SetOfflineMode(enabled); + #else + Debug.Log(errorMsgPlatform); + #endif + } } public static void setDeviceToken(string deviceToken) { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - AdjustiOS.SetDeviceToken(deviceToken); -#elif UNITY_ANDROID - AdjustAndroid.SetDeviceToken(deviceToken); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.SetDeviceToken(deviceToken); -#else - Debug.Log(errorMsgPlatform); -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + AdjustiOS.SetDeviceToken(deviceToken); + #elif UNITY_ANDROID + AdjustAndroid.SetDeviceToken(deviceToken); + #elif (UNITY_WSA || UNITY_WP8) + AdjustWindows.SetDeviceToken(deviceToken); + #else + Debug.Log(errorMsgPlatform); + #endif + } } public static void appWillOpenUrl(string url) { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - AdjustiOS.AppWillOpenUrl(url); -#elif UNITY_ANDROID - AdjustAndroid.AppWillOpenUrl(url); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.AppWillOpenUrl(url); -#else - Debug.Log(errorMsgPlatform); -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + AdjustiOS.AppWillOpenUrl(url); + #elif UNITY_ANDROID + AdjustAndroid.AppWillOpenUrl(url); + #elif (UNITY_WSA || UNITY_WP8) + AdjustWindows.AppWillOpenUrl(url); + #else + Debug.Log(errorMsgPlatform); + #endif + } } public static void sendFirstPackages() { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - AdjustiOS.SendFirstPackages(); -#elif UNITY_ANDROID - AdjustAndroid.SendFirstPackages(); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.SendFirstPackages(); -#else - Debug.Log(errorMsgPlatform); -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + AdjustiOS.SendFirstPackages(); + #elif UNITY_ANDROID + AdjustAndroid.SendFirstPackages(); + #elif (UNITY_WSA || UNITY_WP8) + AdjustWindows.SendFirstPackages(); + #else + Debug.Log(errorMsgPlatform); + #endif + } } public static void addSessionPartnerParameter(string key, string value) { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - AdjustiOS.AddSessionPartnerParameter(key, value); -#elif UNITY_ANDROID - AdjustAndroid.AddSessionPartnerParameter(key, value); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.AddSessionPartnerParameter(key, value); -#else - Debug.Log(errorMsgPlatform); -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + AdjustiOS.AddSessionPartnerParameter(key, value); + #elif UNITY_ANDROID + AdjustAndroid.AddSessionPartnerParameter(key, value); + #elif (UNITY_WSA || UNITY_WP8) + AdjustWindows.AddSessionPartnerParameter(key, value); + #else + Debug.Log(errorMsgPlatform); + #endif + } } public static void addSessionCallbackParameter(string key, string value) { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - AdjustiOS.AddSessionCallbackParameter(key, value); -#elif UNITY_ANDROID - AdjustAndroid.AddSessionCallbackParameter(key, value); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.AddSessionCallbackParameter(key, value); -#else - Debug.Log(errorMsgPlatform); -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + AdjustiOS.AddSessionCallbackParameter(key, value); + #elif UNITY_ANDROID + AdjustAndroid.AddSessionCallbackParameter(key, value); + #elif (UNITY_WSA || UNITY_WP8) + AdjustWindows.AddSessionCallbackParameter(key, value); + #else + Debug.Log(errorMsgPlatform); + #endif + } } public static void removeSessionPartnerParameter(string key) { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - AdjustiOS.RemoveSessionPartnerParameter(key); -#elif UNITY_ANDROID - AdjustAndroid.RemoveSessionPartnerParameter(key); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.RemoveSessionPartnerParameter(key); -#else - Debug.Log(errorMsgPlatform); -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + AdjustiOS.RemoveSessionPartnerParameter(key); + #elif UNITY_ANDROID + AdjustAndroid.RemoveSessionPartnerParameter(key); + #elif (UNITY_WSA || UNITY_WP8) + AdjustWindows.RemoveSessionPartnerParameter(key); + #else + Debug.Log(errorMsgPlatform); + #endif + } } public static void removeSessionCallbackParameter(string key) { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - AdjustiOS.RemoveSessionCallbackParameter(key); -#elif UNITY_ANDROID - AdjustAndroid.RemoveSessionCallbackParameter(key); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.RemoveSessionCallbackParameter(key); -#else - Debug.Log(errorMsgPlatform); -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + AdjustiOS.RemoveSessionCallbackParameter(key); + #elif UNITY_ANDROID + AdjustAndroid.RemoveSessionCallbackParameter(key); + #elif (UNITY_WSA || UNITY_WP8) + AdjustWindows.RemoveSessionCallbackParameter(key); + #else + Debug.Log(errorMsgPlatform); + #endif + } } public static void resetSessionPartnerParameters() { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - AdjustiOS.ResetSessionPartnerParameters(); -#elif UNITY_ANDROID - AdjustAndroid.ResetSessionPartnerParameters(); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.ResetSessionPartnerParameters(); -#else - Debug.Log(errorMsgPlatform); -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + AdjustiOS.ResetSessionPartnerParameters(); + #elif UNITY_ANDROID + AdjustAndroid.ResetSessionPartnerParameters(); + #elif (UNITY_WSA || UNITY_WP8) + AdjustWindows.ResetSessionPartnerParameters(); + #else + Debug.Log(errorMsgPlatform); + #endif + } } public static void resetSessionCallbackParameters() { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - AdjustiOS.ResetSessionCallbackParameters(); -#elif UNITY_ANDROID - AdjustAndroid.ResetSessionCallbackParameters(); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.ResetSessionCallbackParameters(); -#else - Debug.Log(errorMsgPlatform); -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + AdjustiOS.ResetSessionCallbackParameters(); + #elif UNITY_ANDROID + AdjustAndroid.ResetSessionCallbackParameters(); + #elif (UNITY_WSA || UNITY_WP8) + AdjustWindows.ResetSessionCallbackParameters(); + #else + Debug.Log(errorMsgPlatform); + #endif + } } public static string getAdid() { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return string.Empty; -#endif -#if UNITY_IOS - return AdjustiOS.GetAdid(); -#elif UNITY_ANDROID - return AdjustAndroid.GetAdid(); -#elif (UNITY_WSA || UNITY_WP8) - return AdjustWindows.GetAdid(); -#else - Debug.Log(errorMsgPlatform); - return string.Empty; -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + return AdjustiOS.GetAdid(); + #elif UNITY_ANDROID + return AdjustAndroid.GetAdid(); + #elif (UNITY_WSA || UNITY_WP8) + return AdjustWindows.GetAdid(); + #else + Debug.Log(errorMsgPlatform); + return string.Empty; + #endif + } + else + { + return string.Empty; + } } public static AdjustAttribution getAttribution() { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return null; -#endif -#if UNITY_IOS - return AdjustiOS.GetAttribution(); -#elif UNITY_ANDROID - return AdjustAndroid.GetAttribution(); -#elif (UNITY_WSA || UNITY_WP8) - return AdjustWindows.GetAttribution(); -#else - Debug.Log(errorMsgPlatform); - return null; -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + return AdjustiOS.GetAttribution(); + #elif UNITY_ANDROID + return AdjustAndroid.GetAttribution(); + #elif (UNITY_WSA || UNITY_WP8) + return AdjustWindows.GetAttribution(); + #else + Debug.Log(errorMsgPlatform); + return null; + #endif + } + else + { + return null; + } } public static string getWinAdid() { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return string.Empty; -#endif -#if UNITY_IOS - Debug.Log("Adjust: Error! Windows Advertising ID is not available on iOS platform."); - return string.Empty; -#elif UNITY_ANDROID - Debug.Log("Adjust: Error! Windows Advertising ID is not available on Android platform."); - return string.Empty; -#elif (UNITY_WSA || UNITY_WP8) - return AdjustWindows.GetWinAdId(); -#else - Debug.Log(errorMsgPlatform); - return string.Empty; -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + Debug.Log("Adjust: Error! Windows Advertising ID is not available on iOS platform."); + return string.Empty; + #elif UNITY_ANDROID + Debug.Log("Adjust: Error! Windows Advertising ID is not available on Android platform."); + return string.Empty; + #elif (UNITY_WSA || UNITY_WP8) + return AdjustWindows.GetWinAdId(); + #else + Debug.Log(errorMsgPlatform); + return string.Empty; + #endif + } + else + { + return string.Empty; + } } public static string getIdfa() { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return string.Empty; -#endif -#if UNITY_IOS - return AdjustiOS.GetIdfa(); -#elif UNITY_ANDROID - Debug.Log("Adjust: Error! IDFA is not available on Android platform."); - return string.Empty; -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("Adjust: Error! IDFA is not available on Windows platform."); - return string.Empty; -#else - Debug.Log(errorMsgPlatform); - return string.Empty; -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + return AdjustiOS.GetIdfa(); + #elif UNITY_ANDROID + Debug.Log("Adjust: Error! IDFA is not available on Android platform."); + return string.Empty; + #elif (UNITY_WSA || UNITY_WP8) + Debug.Log("Adjust: Error! IDFA is not available on Windows platform."); + return string.Empty; + #else + Debug.Log(errorMsgPlatform); + return string.Empty; + #endif + } + else + { + return string.Empty; + } } [Obsolete("This method is intended for testing purposes only. Do not use it.")] public static void setReferrer(string referrer) { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - Debug.Log("Adjust: Install referrer is not available on iOS platform."); -#elif UNITY_ANDROID - AdjustAndroid.SetReferrer(referrer); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("Adjust: Error! Install referrer is not available on Windows platform."); -#else - Debug.Log(errorMsgPlatform); -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + Debug.Log("Adjust: Install referrer is not available on iOS platform."); + #elif UNITY_ANDROID + AdjustAndroid.SetReferrer(referrer); + #elif (UNITY_WSA || UNITY_WP8) + Debug.Log("Adjust: Error! Install referrer is not available on Windows platform."); + #else + Debug.Log(errorMsgPlatform); + #endif + } } public static void getGoogleAdId(Action onDeviceIdsRead) { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return; -#endif -#if UNITY_IOS - Debug.Log("Adjust: Google Play Advertising ID is not available on iOS platform."); - onDeviceIdsRead(string.Empty); -#elif UNITY_ANDROID - AdjustAndroid.GetGoogleAdId(onDeviceIdsRead); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("Adjust: Google Play Advertising ID is not available on Windows platform."); - onDeviceIdsRead(string.Empty); -#else - Debug.Log(errorMsgPlatform); -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + Debug.Log("Adjust: Google Play Advertising ID is not available on iOS platform."); + onDeviceIdsRead(string.Empty); + #elif UNITY_ANDROID + AdjustAndroid.GetGoogleAdId(onDeviceIdsRead); + #elif (UNITY_WSA || UNITY_WP8) + Debug.Log("Adjust: Google Play Advertising ID is not available on Windows platform."); + onDeviceIdsRead(string.Empty); + #else + Debug.Log(errorMsgPlatform); + #endif + } } public static string getAmazonAdId() { -#if UNITY_EDITOR - Debug.Log(errorMsgUnityEditor); - return string.Empty; -#endif -#if UNITY_IOS - Debug.Log("Adjust: Amazon Advertising ID is not available on iOS platform."); - return string.Empty; -#elif UNITY_ANDROID - return AdjustAndroid.GetAmazonAdId(); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("Adjust: Amazon Advertising ID not available on Windows platform."); - return string.Empty; -#else - Debug.Log(errorMsgPlatform); - return string.Empty; -#endif + if (!Application.isEditor) + { + #if UNITY_IOS + Debug.Log("Adjust: Amazon Advertising ID is not available on iOS platform."); + return string.Empty; + #elif UNITY_ANDROID + return AdjustAndroid.GetAmazonAdId(); + #elif (UNITY_WSA || UNITY_WP8) + Debug.Log("Adjust: Amazon Advertising ID not available on Windows platform."); + return string.Empty; + #else + Debug.Log(errorMsgPlatform); + return string.Empty; + #endif + } + else + { + return string.Empty; + } } #if UNITY_IOS public void GetNativeAttribution(string attributionData) { - if (Adjust.attributionChangedDelegate == null) + if (!Application.isEditor) { - Debug.Log("Adjust: Attribution changed delegate was not set."); - return; + if (Adjust.attributionChangedDelegate == null) + { + Debug.Log("Adjust: Attribution changed delegate was not set."); + return; + } + + var attribution = new AdjustAttribution(attributionData); + Adjust.attributionChangedDelegate(attribution); } - - var attribution = new AdjustAttribution(attributionData); - Adjust.attributionChangedDelegate(attribution); } public void GetNativeEventSuccess(string eventSuccessData) { - if (Adjust.eventSuccessDelegate == null) + if (!Application.isEditor) { - Debug.Log("Adjust: Event success delegate was not set."); - return; + if (Adjust.eventSuccessDelegate == null) + { + Debug.Log("Adjust: Event success delegate was not set."); + return; + } + + var eventSuccess = new AdjustEventSuccess(eventSuccessData); + Adjust.eventSuccessDelegate(eventSuccess); } - - var eventSuccess = new AdjustEventSuccess(eventSuccessData); - Adjust.eventSuccessDelegate(eventSuccess); } public void GetNativeEventFailure(string eventFailureData) { - if (Adjust.eventFailureDelegate == null) + if (!Application.isEditor) { - Debug.Log("Adjust: Event failure delegate was not set."); - return; + if (Adjust.eventFailureDelegate == null) + { + Debug.Log("Adjust: Event failure delegate was not set."); + return; + } + + var eventFailure = new AdjustEventFailure(eventFailureData); + Adjust.eventFailureDelegate(eventFailure); } - - var eventFailure = new AdjustEventFailure(eventFailureData); - Adjust.eventFailureDelegate(eventFailure); } public void GetNativeSessionSuccess(string sessionSuccessData) { - if (Adjust.sessionSuccessDelegate == null) + if (!Application.isEditor) { - Debug.Log("Adjust: Session success delegate was not set."); - return; + if (Adjust.sessionSuccessDelegate == null) + { + Debug.Log("Adjust: Session success delegate was not set."); + return; + } + + var sessionSuccess = new AdjustSessionSuccess(sessionSuccessData); + Adjust.sessionSuccessDelegate(sessionSuccess); } - - var sessionSuccess = new AdjustSessionSuccess(sessionSuccessData); - Adjust.sessionSuccessDelegate(sessionSuccess); } public void GetNativeSessionFailure(string sessionFailureData) { - if (Adjust.sessionFailureDelegate == null) + if (!Application.isEditor) { - Debug.Log("Adjust: Session failure delegate was not set."); - return; + if (Adjust.sessionFailureDelegate == null) + { + Debug.Log("Adjust: Session failure delegate was not set."); + return; + } + + var sessionFailure = new AdjustSessionFailure(sessionFailureData); + Adjust.sessionFailureDelegate(sessionFailure); } - - var sessionFailure = new AdjustSessionFailure(sessionFailureData); - Adjust.sessionFailureDelegate(sessionFailure); } public void GetNativeDeferredDeeplink(string deeplinkURL) { - if (Adjust.deferredDeeplinkDelegate == null) + if (!Application.isEditor) { - Debug.Log("Adjust: Deferred deeplink delegate was not set."); - return; - } + if (Adjust.deferredDeeplinkDelegate == null) + { + Debug.Log("Adjust: Deferred deeplink delegate was not set."); + return; + } - Adjust.deferredDeeplinkDelegate(deeplinkURL); + Adjust.deferredDeeplinkDelegate(deeplinkURL); + } } #endif } From 8d7039154479d0d34c12ec6719e7aa4c56510e48 Mon Sep 17 00:00:00 2001 From: uerceg Date: Wed, 7 Feb 2018 22:44:29 +0100 Subject: [PATCH 3/6] Align const char variables next to each other --- Assets/Adjust/iOS/AdjustUnity.mm | 116 ++++++++++++++++++------------- Assets/Adjust/iOS/AdjustiOS.cs | 20 +++--- 2 files changed, 78 insertions(+), 58 deletions(-) diff --git a/Assets/Adjust/iOS/AdjustUnity.mm b/Assets/Adjust/iOS/AdjustUnity.mm index 76b952b9..a00ed756 100644 --- a/Assets/Adjust/iOS/AdjustUnity.mm +++ b/Assets/Adjust/iOS/AdjustUnity.mm @@ -14,7 +14,7 @@ - (id)init { @end // Method for converting JSON stirng parameters into NSArray object. -NSArray* ConvertArrayParameters(const char* cStringJsonArrayParameters) { +NSArray* convertArrayParameters(const char* cStringJsonArrayParameters) { if (cStringJsonArrayParameters == NULL) { return nil; } @@ -36,6 +36,23 @@ - (id)init { return arrayParameters; } +BOOL isStringValid(const char* cString) { + if (cString == NULL) { + return false; + } + + NSString *objcString = [NSString stringWithUTF8String:cString]; + if (objcString == nil) { + return false; + } + + if ([objcString isEqualToString:@"ADJ_INVALID"]) { + return false; + } + + return true; +} + extern "C" { void addValueOrEmpty(NSMutableDictionary *dictionary, NSString *key, NSObject *value) { @@ -46,37 +63,36 @@ void addValueOrEmpty(NSMutableDictionary *dictionary, NSString *key, NSObject *v } } - void _AdjustLaunchApp( - const char* appToken, - const char* environment, - const char* sdkPrefix, - int allowSuppressLogLevel, - int logLevel, - int isDeviceKnown, - int eventBuffering, - int sendInBackground, - long secretId, - long info1, - long info2, - long info3, - long info4, - double delayStart, - const char* userAgent, - const char* defaultTracker, - int launchDeferredDeeplink, - const char* sceneName, - int isAttributionCallbackImplemented, - int isEventSuccessCallbackImplemented, - int isEventFailureCallbackImplemented, - int isSessionSuccessCallbackImplemented, - int isSessionFailureCallbackImplemented, - int isDeferredDeeplinkCallbackImplemented) { - NSString *stringSdkPrefix = [NSString stringWithUTF8String:sdkPrefix]; - NSString *stringAppToken = [NSString stringWithUTF8String:appToken]; - NSString *stringEnvironment = [NSString stringWithUTF8String:environment]; - NSString *stringUserAgent = [NSString stringWithUTF8String:userAgent]; - NSString *stringDefaultTracker = [NSString stringWithUTF8String:defaultTracker]; - NSString *stringSceneName = [NSString stringWithUTF8String:sceneName]; + void _AdjustLaunchApp(const char* appToken, + const char* environment, + const char* sdkPrefix, + const char* userAgent, + const char* defaultTracker, + const char* sceneName, + int allowSuppressLogLevel, + int logLevel, + int isDeviceKnown, + int eventBuffering, + int sendInBackground, + long secretId, + long info1, + long info2, + long info3, + long info4, + double delayStart, + int launchDeferredDeeplink, + int isAttributionCallbackImplemented, + int isEventSuccessCallbackImplemented, + int isEventFailureCallbackImplemented, + int isSessionSuccessCallbackImplemented, + int isSessionFailureCallbackImplemented, + int isDeferredDeeplinkCallbackImplemented) { + NSString *stringAppToken = isStringValid(appToken) == true ? [NSString stringWithUTF8String:appToken] : nil; + NSString *stringEnvironment = isStringValid(environment) == true ? [NSString stringWithUTF8String:environment] : nil; + NSString *stringSdkPrefix = isStringValid(sdkPrefix) == true ? [NSString stringWithUTF8String:sdkPrefix] : nil; + NSString *stringUserAgent = isStringValid(userAgent) == true ? [NSString stringWithUTF8String:userAgent] : nil; + NSString *stringDefaultTracker = isStringValid(defaultTracker) == true ? [NSString stringWithUTF8String:defaultTracker] : nil; + NSString *stringSceneName = isStringValid(sceneName) == true ? [NSString stringWithUTF8String:sceneName] : nil; ADJConfig *adjustConfig; @@ -92,9 +108,12 @@ void _AdjustLaunchApp( [adjustConfig setSdkPrefix:stringSdkPrefix]; // Attribution delegate & other delegates - if (isAttributionCallbackImplemented || isEventSuccessCallbackImplemented || - isEventFailureCallbackImplemented || isSessionSuccessCallbackImplemented || - isSessionFailureCallbackImplemented || isDeferredDeeplinkCallbackImplemented) { + if (isAttributionCallbackImplemented + || isEventSuccessCallbackImplemented + || isEventFailureCallbackImplemented + || isSessionSuccessCallbackImplemented + || isSessionFailureCallbackImplemented + || isDeferredDeeplinkCallbackImplemented) { [adjustConfig setDelegate: [AdjustUnityDelegate getInstanceWithSwizzleOfAttributionCallback:isAttributionCallbackImplemented eventSucceededCallback:isEventSuccessCallbackImplemented @@ -127,16 +146,12 @@ void _AdjustLaunchApp( [adjustConfig setDelayStart:delayStart]; } - if (stringUserAgent != NULL) { - if ([stringUserAgent length] > 0) { - [adjustConfig setUserAgent:stringUserAgent]; - } + if (stringUserAgent != nil) { + [adjustConfig setUserAgent:stringUserAgent]; } - if (stringDefaultTracker != NULL) { - if ([stringDefaultTracker length] > 0) { - [adjustConfig setDefaultTracker:stringDefaultTracker]; - } + if (stringDefaultTracker != nil) { + [adjustConfig setDefaultTracker:stringDefaultTracker]; } if (secretId != -1 && info1 != -1 && info2 != -1 && info3 != -1 && info4 != 1) { @@ -145,12 +160,17 @@ void _AdjustLaunchApp( // Launch adjust instance. [Adjust appDidLaunch:adjustConfig]; - - // Since v4.7.0 session is not automatically started after calling appDidLaunch, thus calling trackSubsessionStart. [Adjust trackSubsessionStart]; } - void _AdjustTrackEvent(const char* eventToken, double revenue, const char* currency, const char* receipt, const char* transactionId, int isReceiptSet, const char* jsonCallbackParameters, const char* jsonPartnerParameters) { + void _AdjustTrackEvent(const char* eventToken, + double revenue, + const char* currency, + const char* receipt, + const char* transactionId, + int isReceiptSet, + const char* jsonCallbackParameters, + const char* jsonPartnerParameters) { NSString *stringEventToken = [NSString stringWithUTF8String:eventToken]; ADJEvent *event = [ADJEvent eventWithEventToken:stringEventToken]; @@ -161,7 +181,7 @@ void _AdjustTrackEvent(const char* eventToken, double revenue, const char* curre [event setRevenue:revenue currency:stringCurrency]; } - NSArray *arrayCallbackParameters = ConvertArrayParameters(jsonCallbackParameters); + NSArray *arrayCallbackParameters = convertArrayParameters(jsonCallbackParameters); if (arrayCallbackParameters != nil) { NSUInteger count = [arrayCallbackParameters count]; @@ -177,7 +197,7 @@ void _AdjustTrackEvent(const char* eventToken, double revenue, const char* curre } } - NSArray *arrayPartnerParameters = ConvertArrayParameters(jsonPartnerParameters); + NSArray *arrayPartnerParameters = convertArrayParameters(jsonPartnerParameters); if (arrayPartnerParameters != nil) { NSUInteger count = [arrayPartnerParameters count]; diff --git a/Assets/Adjust/iOS/AdjustiOS.cs b/Assets/Adjust/iOS/AdjustiOS.cs index d37cf82b..be4ad5c7 100644 --- a/Assets/Adjust/iOS/AdjustiOS.cs +++ b/Assets/Adjust/iOS/AdjustiOS.cs @@ -16,6 +16,9 @@ private static extern void _AdjustLaunchApp( string appToken, string environment, string sdkPrefix, + string userAgent, + string defaultTracker, + string sceneName, int allowSuppressLogLevel, int logLevel, int isDeviceKnown, @@ -27,10 +30,7 @@ private static extern void _AdjustLaunchApp( long info3, long info4, double delayStart, - string userAgent, - string defaultTracker, int launchDeferredDeeplink, - string sceneName, int isAttributionCallbackImplemented, int isEventSuccessCallbackImplemented, int isEventFailureCallbackImplemented, @@ -98,10 +98,10 @@ public AdjustiOS() {} public static void Start(AdjustConfig adjustConfig) { - string appToken = adjustConfig.appToken; - string sceneName = adjustConfig.sceneName; - string userAgent = adjustConfig.userAgent != null ? adjustConfig.userAgent : String.Empty; - string defaultTracker = adjustConfig.defaultTracker != null ? adjustConfig.defaultTracker : String.Empty; + string appToken = adjustConfig.appToken != null ? adjustConfig.appToken : "ADJ_INVALID"; + string sceneName = adjustConfig.sceneName != null ? adjustConfig.sceneName : "ADJ_INVALID"; + string userAgent = adjustConfig.userAgent != null ? adjustConfig.userAgent : "ADJ_INVALID"; + string defaultTracker = adjustConfig.defaultTracker != null ? adjustConfig.defaultTracker : "ADJ_INVALID"; string environment = adjustConfig.environment.ToLowercaseString(); long info1 = AdjustUtils.ConvertLong(adjustConfig.info1); @@ -130,6 +130,9 @@ public static void Start(AdjustConfig adjustConfig) appToken, environment, sdkPrefix, + userAgent, + defaultTracker, + sceneName, allowSuppressLogLevel, logLevel, isDeviceKnown, @@ -141,10 +144,7 @@ public static void Start(AdjustConfig adjustConfig) info3, info4, delayStart, - userAgent, - defaultTracker, launchDeferredDeeplink, - sceneName, isAttributionCallbackImplemented, isEventSuccessCallbackImplemented, isEventFailureCallbackImplemented, From c5cb2886c8dc72a2b5fabf12226b6490577b3c07 Mon Sep 17 00:00:00 2001 From: uerceg Date: Thu, 8 Feb 2018 15:18:22 +0100 Subject: [PATCH 4/6] New version 4.12.2 --- Assets/Adjust/Android/AdjustAndroid.cs | 2 +- Assets/Adjust/Windows/AdjustWindows.cs | 2 +- Assets/Adjust/iOS/AdjustiOS.cs | 2 +- VERSION | 2 +- doc/migrate.md | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Assets/Adjust/Android/AdjustAndroid.cs b/Assets/Adjust/Android/AdjustAndroid.cs index d0a0e541..9498d996 100644 --- a/Assets/Adjust/Android/AdjustAndroid.cs +++ b/Assets/Adjust/Android/AdjustAndroid.cs @@ -9,7 +9,7 @@ namespace com.adjust.sdk #if UNITY_ANDROID public class AdjustAndroid { - private const string sdkPrefix = "unity4.12.1"; + private const string sdkPrefix = "unity4.12.2"; private static bool launchDeferredDeeplink = true; diff --git a/Assets/Adjust/Windows/AdjustWindows.cs b/Assets/Adjust/Windows/AdjustWindows.cs index b134097b..81474619 100644 --- a/Assets/Adjust/Windows/AdjustWindows.cs +++ b/Assets/Adjust/Windows/AdjustWindows.cs @@ -16,7 +16,7 @@ namespace com.adjust.sdk { public class AdjustWindows { - private const string sdkPrefix = "unity4.12.1"; + private const string sdkPrefix = "unity4.12.2"; private static bool appLaunched = false; public static void Start(AdjustConfig adjustConfig) diff --git a/Assets/Adjust/iOS/AdjustiOS.cs b/Assets/Adjust/iOS/AdjustiOS.cs index be4ad5c7..d74a98d9 100644 --- a/Assets/Adjust/iOS/AdjustiOS.cs +++ b/Assets/Adjust/iOS/AdjustiOS.cs @@ -9,7 +9,7 @@ namespace com.adjust.sdk #if UNITY_IOS public class AdjustiOS { - private const string sdkPrefix = "unity4.12.1"; + private const string sdkPrefix = "unity4.12.2"; [DllImport("__Internal")] private static extern void _AdjustLaunchApp( diff --git a/VERSION b/VERSION index 53cf85e1..f1cd7de1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.12.1 +4.12.2 diff --git a/doc/migrate.md b/doc/migrate.md index e4d4aa2d..70a55bf6 100644 --- a/doc/migrate.md +++ b/doc/migrate.md @@ -1,4 +1,4 @@ -## Migrate your Adjust SDK for Unity3d to 4.12.1 from 3.4.4 +## Migrate your Adjust SDK for Unity3d to 4.12.2 from 3.4.4 ### Migration procedure @@ -9,7 +9,7 @@ keeping in `Assets/Plugins` folder. For migration purposes, we have prepared the Adjust SDK uninstall script written in Python (`adjust_uninstall.py`). -Migration to version 4.12.1 of our SDK requires the following steps: +Migration to version 4.12.2 of our SDK requires the following steps: 1. Copy the `adjust_uninstall.py` script to your root Unity project directory and run it. This script should delete all adjust source files from the previous SDK version you had. From 1a0203f171701ff2aee2e9bc46d42976c78c84a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uglje=C5=A1a=20Erceg?= Date: Thu, 8 Feb 2018 15:24:12 +0100 Subject: [PATCH 5/6] Version 4.12.2 changes --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5605a4a2..94a94f7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +### Version 4.12.2 (8th February 2018) +#### Fixed +- Fixed Adjust SDK behaviour once tried to be run in `Editor` - no errors displayed anymore. +- Fixed random crashes on iOS 10.1.x devices when trying to initialise SDK. + +#### Native SDKs +- [iOS@v4.12.1][ios_sdk_v4.12.1] +- [Android@v4.12.1][android_sdk_v4.12.1] +- [Windows@v4.12.0][windows_sdk_v4.12.0] + +--- + ### Version 4.12.1 (1st February 2018) #### Native changes - https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md#version-4121-31st-january-2018 From a0de9670892d696def7c812f76e37178066a6a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uglje=C5=A1a=20Erceg?= Date: Fri, 9 Feb 2018 09:25:29 +0100 Subject: [PATCH 6/6] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94a94f7d..ef72c724 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### Version 4.12.2 (8th February 2018) +### Version 4.12.2 (9th February 2018) #### Fixed - Fixed Adjust SDK behaviour once tried to be run in `Editor` - no errors displayed anymore. - Fixed random crashes on iOS 10.1.x devices when trying to initialise SDK.