diff --git a/Assets/Adjust/3rd Party.meta b/Assets/Adjust/3rd Party.meta deleted file mode 100644 index 832fff0b..00000000 --- a/Assets/Adjust/3rd Party.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 48d72eaa514ffd0449362a759c8e9a86 -folderAsset: yes -timeCreated: 1578652520 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Android.meta b/Assets/Adjust/Android.meta deleted file mode 100644 index 1700eda1..00000000 --- a/Assets/Adjust/Android.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 64b3fa260fe5b3c4e9215ec9b42c90da -folderAsset: yes -timeCreated: 1578652520 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Android/AdjustAndroid.cs b/Assets/Adjust/Android/AdjustAndroid.cs deleted file mode 100644 index 61f8d735..00000000 --- a/Assets/Adjust/Android/AdjustAndroid.cs +++ /dev/null @@ -1,1065 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using UnityEngine; - -namespace com.adjust.sdk -{ -#if UNITY_ANDROID - public class AdjustAndroid - { - private const string sdkPrefix = "unity4.38.1"; - private static bool launchDeferredDeeplink = true; - private static AndroidJavaClass ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); - private static AndroidJavaObject ajoCurrentActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic("currentActivity"); - private static DeferredDeeplinkListener onDeferredDeeplinkListener; - private static AttributionChangeListener onAttributionChangedListener; - private static EventTrackingFailedListener onEventTrackingFailedListener; - private static EventTrackingSucceededListener onEventTrackingSucceededListener; - private static SessionTrackingFailedListener onSessionTrackingFailedListener; - private static SessionTrackingSucceededListener onSessionTrackingSucceededListener; - private static VerificationInfoListener onVerificationInfoListener; - private static DeeplinkResolutionListener onDeeplinkResolvedListener; - - public static void Start(AdjustConfig adjustConfig) - { - // Thank you, Unity 2019.2.0, for breaking this. - // AndroidJavaObject ajoEnvironment = adjustConfig.environment == AdjustEnvironment.Sandbox ? - // new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic("ENVIRONMENT_SANDBOX") : - // new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic("ENVIRONMENT_PRODUCTION"); - - // Get environment variable. - string ajoEnvironment = adjustConfig.environment == AdjustEnvironment.Production ? "production" : "sandbox"; - - // Create adjust config object. - AndroidJavaObject ajoAdjustConfig; - - // Check if suppress log leve is supported. - if (adjustConfig.allowSuppressLogLevel != null) - { - ajoAdjustConfig = new AndroidJavaObject("com.adjust.sdk.AdjustConfig", ajoCurrentActivity, adjustConfig.appToken, ajoEnvironment, adjustConfig.allowSuppressLogLevel); - } - else - { - ajoAdjustConfig = new AndroidJavaObject("com.adjust.sdk.AdjustConfig", ajoCurrentActivity, adjustConfig.appToken, ajoEnvironment); - } - - // Check if deferred deeplink should be launched by SDK. - launchDeferredDeeplink = adjustConfig.launchDeferredDeeplink; - - // Check log level. - if (adjustConfig.logLevel != null) - { - AndroidJavaObject ajoLogLevel; - if (adjustConfig.logLevel.Value.ToUppercaseString().Equals("SUPPRESS")) - { - ajoLogLevel = new AndroidJavaClass("com.adjust.sdk.LogLevel").GetStatic("SUPRESS"); - } - else - { - ajoLogLevel = new AndroidJavaClass("com.adjust.sdk.LogLevel").GetStatic(adjustConfig.logLevel.Value.ToUppercaseString()); - } - - if (ajoLogLevel != null) - { - ajoAdjustConfig.Call("setLogLevel", ajoLogLevel); - } - } - - // Set unity SDK prefix. - ajoAdjustConfig.Call("setSdkPrefix", sdkPrefix); - - // Check if user has configured the delayed start option. - if (adjustConfig.delayStart != null) - { - ajoAdjustConfig.Call("setDelayStart", adjustConfig.delayStart); - } - - // Check event buffering setting. - if (adjustConfig.eventBufferingEnabled != null) - { - AndroidJavaObject ajoIsEnabled = new AndroidJavaObject("java.lang.Boolean", adjustConfig.eventBufferingEnabled.Value); - ajoAdjustConfig.Call("setEventBufferingEnabled", ajoIsEnabled); - } - - // Check COPPA setting. - if (adjustConfig.coppaCompliantEnabled != null) - { - ajoAdjustConfig.Call("setCoppaCompliantEnabled", adjustConfig.coppaCompliantEnabled.Value); - } - - // Check final Android attribution setting. - if (adjustConfig.finalAndroidAttributionEnabled != null) - { - ajoAdjustConfig.Call("setFinalAttributionEnabled", adjustConfig.finalAndroidAttributionEnabled.Value); - } - - // Check read Android IDs only once. - if (adjustConfig.readDeviceInfoOnceEnabled != null) - { - ajoAdjustConfig.Call("setReadDeviceInfoOnceEnabled", adjustConfig.readDeviceInfoOnceEnabled.Value); - } - - // Check Play Store Kids Apps setting. - if (adjustConfig.playStoreKidsAppEnabled != null) - { - ajoAdjustConfig.Call("setPlayStoreKidsAppEnabled", adjustConfig.playStoreKidsAppEnabled.Value); - } - - // Check if user enabled tracking in the background. - if (adjustConfig.sendInBackground != null) - { - ajoAdjustConfig.Call("setSendInBackground", adjustConfig.sendInBackground.Value); - } - - // Check if user wants to get cost data in attribution callback. - if (adjustConfig.needsCost != null) - { - ajoAdjustConfig.Call("setNeedsCost", adjustConfig.needsCost.Value); - } - - // Check if user wants to run preinstall campaigns. - if (adjustConfig.preinstallTrackingEnabled != null) - { - ajoAdjustConfig.Call("setPreinstallTrackingEnabled", adjustConfig.preinstallTrackingEnabled.Value); - } - - // Check if user has set custom preinstall file path. - if (adjustConfig.preinstallFilePath != null) - { - ajoAdjustConfig.Call("setPreinstallFilePath", adjustConfig.preinstallFilePath); - } - - // Check if FB app ID has been set. - if (adjustConfig.fbAppId != null) - { - ajoAdjustConfig.Call("setFbAppId", adjustConfig.fbAppId); - } - - // Check if user has set user agent value. - if (adjustConfig.userAgent != null) - { - ajoAdjustConfig.Call("setUserAgent", adjustConfig.userAgent); - } - - // Check if user has set default process name. - if (!String.IsNullOrEmpty(adjustConfig.processName)) - { - ajoAdjustConfig.Call("setProcessName", adjustConfig.processName); - } - - // Check if user has set default tracker token. - if (adjustConfig.defaultTracker != null) - { - ajoAdjustConfig.Call("setDefaultTracker", adjustConfig.defaultTracker); - } - - // Check if user has set external device identifier. - if (adjustConfig.externalDeviceId != null) - { - ajoAdjustConfig.Call("setExternalDeviceId", adjustConfig.externalDeviceId); - } - - // Check if user has set custom URL strategy. - if (adjustConfig.urlStrategy != null) - { - if (adjustConfig.urlStrategy == AdjustConfig.AdjustUrlStrategyChina) - { - AndroidJavaObject ajoUrlStrategyChina = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic("URL_STRATEGY_CHINA"); - ajoAdjustConfig.Call("setUrlStrategy", ajoUrlStrategyChina); - } - else if (adjustConfig.urlStrategy == AdjustConfig.AdjustUrlStrategyIndia) - { - AndroidJavaObject ajoUrlStrategyIndia = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic("URL_STRATEGY_INDIA"); - ajoAdjustConfig.Call("setUrlStrategy", ajoUrlStrategyIndia); - } - else if (adjustConfig.urlStrategy == AdjustConfig.AdjustUrlStrategyCn) - { - AndroidJavaObject ajoUrlStrategyCn = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic("URL_STRATEGY_CN"); - ajoAdjustConfig.Call("setUrlStrategy", ajoUrlStrategyCn); - } - else if (adjustConfig.urlStrategy == AdjustConfig.AdjustUrlStrategyCnOnly) - { - AndroidJavaObject ajoUrlStrategyCnOnly = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic("URL_STRATEGY_CN_ONLY"); - ajoAdjustConfig.Call("setUrlStrategy", ajoUrlStrategyCnOnly); - } - else if (adjustConfig.urlStrategy == AdjustConfig.AdjustDataResidencyEU) - { - AndroidJavaObject ajoDataResidencyEU = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic("DATA_RESIDENCY_EU"); - ajoAdjustConfig.Call("setUrlStrategy", ajoDataResidencyEU); - } - else if (adjustConfig.urlStrategy == AdjustConfig.AdjustDataResidencyTR) - { - AndroidJavaObject ajoDataResidencyTR = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic("DATA_RESIDENCY_TR"); - ajoAdjustConfig.Call("setUrlStrategy", ajoDataResidencyTR); - } - else if (adjustConfig.urlStrategy == AdjustConfig.AdjustDataResidencyUS) - { - AndroidJavaObject ajoDataResidencyUS = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic("DATA_RESIDENCY_US"); - ajoAdjustConfig.Call("setUrlStrategy", ajoDataResidencyUS); - } - } - - // Check if user has set app secret. - if (IsAppSecretSet(adjustConfig)) - { - ajoAdjustConfig.Call("setAppSecret", - adjustConfig.secretId.Value, - adjustConfig.info1.Value, - adjustConfig.info2.Value, - adjustConfig.info3.Value, - adjustConfig.info4.Value); - } - - // Check if user has set device as known. - if (adjustConfig.isDeviceKnown.HasValue) - { - ajoAdjustConfig.Call("setDeviceKnown", adjustConfig.isDeviceKnown.Value); - } - - // Check if user has enabled reading of IMEI and MEID. - // Obsolete method. - if (adjustConfig.readImei.HasValue) - { - // ajoAdjustConfig.Call("setReadMobileEquipmentIdentity", adjustConfig.readImei.Value); - } - - // Check attribution changed delagate setting. - if (adjustConfig.attributionChangedDelegate != null) - { - onAttributionChangedListener = new AttributionChangeListener(adjustConfig.attributionChangedDelegate); - ajoAdjustConfig.Call("setOnAttributionChangedListener", onAttributionChangedListener); - } - - // Check event success delegate setting. - if (adjustConfig.eventSuccessDelegate != null) - { - onEventTrackingSucceededListener = new EventTrackingSucceededListener(adjustConfig.eventSuccessDelegate); - ajoAdjustConfig.Call("setOnEventTrackingSucceededListener", onEventTrackingSucceededListener); - } - - // Check event failure delagate setting. - if (adjustConfig.eventFailureDelegate != null) - { - onEventTrackingFailedListener = new EventTrackingFailedListener(adjustConfig.eventFailureDelegate); - ajoAdjustConfig.Call("setOnEventTrackingFailedListener", onEventTrackingFailedListener); - } - - // Check session success delegate setting. - if (adjustConfig.sessionSuccessDelegate != null) - { - onSessionTrackingSucceededListener = new SessionTrackingSucceededListener(adjustConfig.sessionSuccessDelegate); - ajoAdjustConfig.Call("setOnSessionTrackingSucceededListener", onSessionTrackingSucceededListener); - } - - // Check session failure delegate setting. - if (adjustConfig.sessionFailureDelegate != null) - { - onSessionTrackingFailedListener = new SessionTrackingFailedListener(adjustConfig.sessionFailureDelegate); - ajoAdjustConfig.Call("setOnSessionTrackingFailedListener", onSessionTrackingFailedListener); - } - - // Check deferred deeplink delegate setting. - if (adjustConfig.deferredDeeplinkDelegate != null) - { - onDeferredDeeplinkListener = new DeferredDeeplinkListener(adjustConfig.deferredDeeplinkDelegate); - ajoAdjustConfig.Call("setOnDeeplinkResponseListener", onDeferredDeeplinkListener); - } - - // Initialise and start the SDK. - ajcAdjust.CallStatic("onCreate", ajoAdjustConfig); - ajcAdjust.CallStatic("onResume"); - } - - public static void TrackEvent(AdjustEvent adjustEvent) - { - AndroidJavaObject ajoAdjustEvent = new AndroidJavaObject("com.adjust.sdk.AdjustEvent", adjustEvent.eventToken); - - // Check if user has set revenue for the event. - if (adjustEvent.revenue != null) - { - ajoAdjustEvent.Call("setRevenue", (double)adjustEvent.revenue, adjustEvent.currency); - } - - // Check if user has added any callback parameters to the event. - if (adjustEvent.callbackList != null) - { - for (int i = 0; i < adjustEvent.callbackList.Count; i += 2) - { - string key = adjustEvent.callbackList[i]; - string value = adjustEvent.callbackList[i + 1]; - ajoAdjustEvent.Call("addCallbackParameter", key, value); - } - } - - // Check if user has added any partner parameters to the event. - if (adjustEvent.partnerList != null) - { - for (int i = 0; i < adjustEvent.partnerList.Count; i += 2) - { - string key = adjustEvent.partnerList[i]; - string value = adjustEvent.partnerList[i + 1]; - ajoAdjustEvent.Call("addPartnerParameter", key, value); - } - } - - // Check if user has added transaction ID to the event. - if (adjustEvent.transactionId != null) - { - ajoAdjustEvent.Call("setOrderId", adjustEvent.transactionId); - } - - // Check if user has added callback ID to the event. - if (adjustEvent.callbackId != null) - { - ajoAdjustEvent.Call("setCallbackId", adjustEvent.callbackId); - } - - // Check if user has added product ID to the event. - if (adjustEvent.productId != null) - { - ajoAdjustEvent.Call("setProductId", adjustEvent.productId); - } - - // Check if user has added purchase token to the event. - if (adjustEvent.purchaseToken != null) - { - ajoAdjustEvent.Call("setPurchaseToken", adjustEvent.purchaseToken); - } - - // Track the event. - ajcAdjust.CallStatic("trackEvent", ajoAdjustEvent); - } - - public static bool IsEnabled() - { - return ajcAdjust.CallStatic("isEnabled"); - } - - public static void SetEnabled(bool enabled) - { - ajcAdjust.CallStatic("setEnabled", enabled); - } - - public static void SetOfflineMode(bool enabled) - { - ajcAdjust.CallStatic("setOfflineMode", enabled); - } - - public static void SendFirstPackages() - { - ajcAdjust.CallStatic("sendFirstPackages"); - } - - public static void SetDeviceToken(string deviceToken) - { - ajcAdjust.CallStatic("setPushToken", deviceToken, ajoCurrentActivity); - } - - public static string GetAdid() - { - return ajcAdjust.CallStatic("getAdid"); - } - - public static void GdprForgetMe() - { - ajcAdjust.CallStatic("gdprForgetMe", ajoCurrentActivity); - } - - public static void DisableThirdPartySharing() - { - ajcAdjust.CallStatic("disableThirdPartySharing", ajoCurrentActivity); - } - - public static AdjustAttribution GetAttribution() - { - try - { - AndroidJavaObject ajoAttribution = ajcAdjust.CallStatic("getAttribution"); - if (null == ajoAttribution) - { - return null; - } - - AdjustAttribution adjustAttribution = new AdjustAttribution(); - adjustAttribution.trackerName = ajoAttribution.Get(AdjustUtils.KeyTrackerName) == "" ? - null : ajoAttribution.Get(AdjustUtils.KeyTrackerName); - adjustAttribution.trackerToken = ajoAttribution.Get(AdjustUtils.KeyTrackerToken) == "" ? - null : ajoAttribution.Get(AdjustUtils.KeyTrackerToken); - adjustAttribution.network = ajoAttribution.Get(AdjustUtils.KeyNetwork) == "" ? - null : ajoAttribution.Get(AdjustUtils.KeyNetwork); - adjustAttribution.campaign = ajoAttribution.Get(AdjustUtils.KeyCampaign) == "" ? - null : ajoAttribution.Get(AdjustUtils.KeyCampaign); - adjustAttribution.adgroup = ajoAttribution.Get(AdjustUtils.KeyAdgroup) == "" ? - null : ajoAttribution.Get(AdjustUtils.KeyAdgroup); - adjustAttribution.creative = ajoAttribution.Get(AdjustUtils.KeyCreative) == "" ? - null : ajoAttribution.Get(AdjustUtils.KeyCreative); - adjustAttribution.clickLabel = ajoAttribution.Get(AdjustUtils.KeyClickLabel) == "" ? - null : ajoAttribution.Get(AdjustUtils.KeyClickLabel); - adjustAttribution.adid = ajoAttribution.Get(AdjustUtils.KeyAdid) == "" ? - null : ajoAttribution.Get(AdjustUtils.KeyAdid); - adjustAttribution.costType = ajoAttribution.Get(AdjustUtils.KeyCostType) == "" ? - null : ajoAttribution.Get(AdjustUtils.KeyCostType); - AndroidJavaObject ajoCostAmount = ajoAttribution.Get(AdjustUtils.KeyCostAmount) == null ? - null : ajoAttribution.Get(AdjustUtils.KeyCostAmount); - if (ajoCostAmount == null) - { - adjustAttribution.costAmount = null; - } - else - { - double costAmount = ajoCostAmount.Call("doubleValue"); - adjustAttribution.costAmount = costAmount; - } - adjustAttribution.costCurrency = ajoAttribution.Get(AdjustUtils.KeyCostCurrency) == "" ? - null : ajoAttribution.Get(AdjustUtils.KeyCostCurrency); - adjustAttribution.fbInstallReferrer = ajoAttribution.Get(AdjustUtils.KeyFbInstallReferrer) == "" ? - null : ajoAttribution.Get(AdjustUtils.KeyFbInstallReferrer); - return adjustAttribution; - } - catch (Exception) {} - - return null; - } - - public static void AddSessionPartnerParameter(string key, string value) - { - if (ajcAdjust == null) - { - ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); - } - ajcAdjust.CallStatic("addSessionPartnerParameter", key, value); - } - - public static void AddSessionCallbackParameter(string key, string value) - { - if (ajcAdjust == null) - { - ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); - } - ajcAdjust.CallStatic("addSessionCallbackParameter", key, value); - } - - public static void RemoveSessionPartnerParameter(string key) - { - if (ajcAdjust == null) - { - ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); - } - ajcAdjust.CallStatic("removeSessionPartnerParameter", key); - } - - public static void RemoveSessionCallbackParameter(string key) - { - if (ajcAdjust == null) - { - ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); - } - ajcAdjust.CallStatic("removeSessionCallbackParameter", key); - } - - public static void ResetSessionPartnerParameters() - { - if (ajcAdjust == null) - { - ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); - } - ajcAdjust.CallStatic("resetSessionPartnerParameters"); - } - - public static void ResetSessionCallbackParameters() - { - if (ajcAdjust == null) - { - ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); - } - ajcAdjust.CallStatic("resetSessionCallbackParameters"); - } - - public static void AppWillOpenUrl(string url) - { - AndroidJavaClass ajcUri = new AndroidJavaClass("android.net.Uri"); - AndroidJavaObject ajoUri = ajcUri.CallStatic("parse", url); - ajcAdjust.CallStatic("appWillOpenUrl", ajoUri, ajoCurrentActivity); - } - - public static void TrackAdRevenue(string source, string payload) - { - if (ajcAdjust == null) - { - ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); - } - AndroidJavaObject jsonPayload = new AndroidJavaObject("org.json.JSONObject", payload); - ajcAdjust.CallStatic("trackAdRevenue", source, jsonPayload); - } - - public static void TrackAdRevenue(AdjustAdRevenue adRevenue) - { - AndroidJavaObject ajoAdjustAdRevenue = new AndroidJavaObject("com.adjust.sdk.AdjustAdRevenue", adRevenue.source); - - // Check if user has set revenue. - if (adRevenue.revenue != null) - { - AndroidJavaObject ajoRevenue = new AndroidJavaObject("java.lang.Double", adRevenue.revenue); - ajoAdjustAdRevenue.Call("setRevenue", ajoRevenue, adRevenue.currency); - } - - // Check if user has set ad impressions count. - if (adRevenue.adImpressionsCount != null) - { - AndroidJavaObject ajoAdImpressionsCount = new AndroidJavaObject("java.lang.Integer", adRevenue.adImpressionsCount); - ajoAdjustAdRevenue.Call("setAdImpressionsCount", ajoAdImpressionsCount); - } - - // Check if user has set ad revenue network. - if (adRevenue.adRevenueNetwork != null) - { - ajoAdjustAdRevenue.Call("setAdRevenueNetwork", adRevenue.adRevenueNetwork); - } - - // Check if user has set ad revenue unit. - if (adRevenue.adRevenueUnit != null) - { - ajoAdjustAdRevenue.Call("setAdRevenueUnit", adRevenue.adRevenueUnit); - } - - // Check if user has set ad revenue placement. - if (adRevenue.adRevenuePlacement != null) - { - ajoAdjustAdRevenue.Call("setAdRevenuePlacement", adRevenue.adRevenuePlacement); - } - - // Check if user has added any callback parameters. - if (adRevenue.callbackList != null) - { - for (int i = 0; i < adRevenue.callbackList.Count; i += 2) - { - string key = adRevenue.callbackList[i]; - string value = adRevenue.callbackList[i + 1]; - ajoAdjustAdRevenue.Call("addCallbackParameter", key, value); - } - } - - // Check if user has added any partner parameters. - if (adRevenue.partnerList != null) - { - for (int i = 0; i < adRevenue.partnerList.Count; i += 2) - { - string key = adRevenue.partnerList[i]; - string value = adRevenue.partnerList[i + 1]; - ajoAdjustAdRevenue.Call("addPartnerParameter", key, value); - } - } - - // Track ad revenue. - ajcAdjust.CallStatic("trackAdRevenue", ajoAdjustAdRevenue); - } - - public static void TrackPlayStoreSubscription(AdjustPlayStoreSubscription subscription) - { - AndroidJavaObject ajoSubscription = new AndroidJavaObject("com.adjust.sdk.AdjustPlayStoreSubscription", - Convert.ToInt64(subscription.price), - subscription.currency, - subscription.sku, - subscription.orderId, - subscription.signature, - subscription.purchaseToken); - - // Check if user has set purchase time for subscription. - if (subscription.purchaseTime != null) - { - ajoSubscription.Call("setPurchaseTime", Convert.ToInt64(subscription.purchaseTime)); - } - - // Check if user has added any callback parameters to the subscription. - if (subscription.callbackList != null) - { - for (int i = 0; i < subscription.callbackList.Count; i += 2) - { - string key = subscription.callbackList[i]; - string value = subscription.callbackList[i + 1]; - ajoSubscription.Call("addCallbackParameter", key, value); - } - } - - // Check if user has added any partner parameters to the subscription. - if (subscription.partnerList != null) - { - for (int i = 0; i < subscription.partnerList.Count; i += 2) - { - string key = subscription.partnerList[i]; - string value = subscription.partnerList[i + 1]; - ajoSubscription.Call("addPartnerParameter", key, value); - } - } - - // Track the subscription. - ajcAdjust.CallStatic("trackPlayStoreSubscription", ajoSubscription); - } - - public static void TrackThirdPartySharing(AdjustThirdPartySharing thirdPartySharing) - { - AndroidJavaObject ajoIsEnabled; - AndroidJavaObject ajoAdjustThirdPartySharing; - if (thirdPartySharing.isEnabled != null) - { - ajoIsEnabled = new AndroidJavaObject("java.lang.Boolean", thirdPartySharing.isEnabled.Value); - ajoAdjustThirdPartySharing = new AndroidJavaObject("com.adjust.sdk.AdjustThirdPartySharing", ajoIsEnabled); - } - else - { - string[] parameters = null; - ajoAdjustThirdPartySharing = new AndroidJavaObject("com.adjust.sdk.AdjustThirdPartySharing", parameters); - } - - if (thirdPartySharing.granularOptions != null) - { - foreach (KeyValuePair> entry in thirdPartySharing.granularOptions) - { - for (int i = 0; i < entry.Value.Count;) - { - ajoAdjustThirdPartySharing.Call("addGranularOption", entry.Key, entry.Value[i++], entry.Value[i++]); - } - } - } - - if (thirdPartySharing.partnerSharingSettings != null) - { - foreach (KeyValuePair> entry in thirdPartySharing.partnerSharingSettings) - { - for (int i = 0; i < entry.Value.Count;) - { - ajoAdjustThirdPartySharing.Call("addPartnerSharingSetting", entry.Key, entry.Value[i++], bool.Parse(entry.Value[i++])); - } - } - } - - ajcAdjust.CallStatic("trackThirdPartySharing", ajoAdjustThirdPartySharing); - } - - public static void TrackMeasurementConsent(bool measurementConsent) - { - ajcAdjust.CallStatic("trackMeasurementConsent", measurementConsent); - } - - // Android specific methods. - public static void OnPause() - { - ajcAdjust.CallStatic("onPause"); - } - - public static void OnResume() - { - ajcAdjust.CallStatic("onResume"); - } - - public static void SetReferrer(string referrer) - { - ajcAdjust.CallStatic("setReferrer", referrer, ajoCurrentActivity); - } - - public static void GetGoogleAdId(Action onDeviceIdsRead) - { - DeviceIdsReadListener onDeviceIdsReadProxy = new DeviceIdsReadListener(onDeviceIdsRead); - ajcAdjust.CallStatic("getGoogleAdId", ajoCurrentActivity, onDeviceIdsReadProxy); - } - - public static string GetAmazonAdId() - { - return ajcAdjust.CallStatic("getAmazonAdId", ajoCurrentActivity); - } - - public static string GetSdkVersion() - { - string nativeSdkVersion = ajcAdjust.CallStatic("getSdkVersion"); - return sdkPrefix + "@" + nativeSdkVersion; - } - - public static void VerifyPlayStorePurchase(AdjustPlayStorePurchase purchase, Action verificationInfoCallback) - { - AndroidJavaObject ajoPurchase = new AndroidJavaObject("com.adjust.sdk.AdjustPurchase", - purchase.productId, - purchase.purchaseToken); - onVerificationInfoListener = new VerificationInfoListener(verificationInfoCallback); - - ajcAdjust.CallStatic("verifyPurchase", ajoPurchase, onVerificationInfoListener); - } - - public static void ProcessDeeplink(string url, Action resolvedLinkCallback) - { - onDeeplinkResolvedListener = new DeeplinkResolutionListener(resolvedLinkCallback); - AndroidJavaClass ajcUri = new AndroidJavaClass("android.net.Uri"); - AndroidJavaObject ajoUri = ajcUri.CallStatic("parse", url); - ajcAdjust.CallStatic("processDeeplink", ajoUri, ajoCurrentActivity, onDeeplinkResolvedListener); - } - - // Used for testing only. - public static void SetTestOptions(Dictionary testOptions) - { - AndroidJavaObject ajoTestOptions = AdjustUtils.TestOptionsMap2AndroidJavaObject(testOptions, ajoCurrentActivity); - ajcAdjust.CallStatic("setTestOptions", ajoTestOptions); - } - - // Private & helper classes. - private class AttributionChangeListener : AndroidJavaProxy - { - private Action callback; - - public AttributionChangeListener(Action pCallback) : base("com.adjust.sdk.OnAttributionChangedListener") - { - this.callback = pCallback; - } - - // Method must be lowercase to match Android method signature. - public void onAttributionChanged(AndroidJavaObject attribution) - { - if (callback == null) - { - return; - } - - AdjustAttribution adjustAttribution = new AdjustAttribution(); - adjustAttribution.trackerName = attribution.Get(AdjustUtils.KeyTrackerName) == "" ? - null : attribution.Get(AdjustUtils.KeyTrackerName); - adjustAttribution.trackerToken = attribution.Get(AdjustUtils.KeyTrackerToken) == "" ? - null : attribution.Get(AdjustUtils.KeyTrackerToken); - adjustAttribution.network = attribution.Get(AdjustUtils.KeyNetwork) == "" ? - null : attribution.Get(AdjustUtils.KeyNetwork); - adjustAttribution.campaign = attribution.Get(AdjustUtils.KeyCampaign) == "" ? - null : attribution.Get(AdjustUtils.KeyCampaign); - adjustAttribution.adgroup = attribution.Get(AdjustUtils.KeyAdgroup) == "" ? - null : attribution.Get(AdjustUtils.KeyAdgroup); - adjustAttribution.creative = attribution.Get(AdjustUtils.KeyCreative) == "" ? - null : attribution.Get(AdjustUtils.KeyCreative); - adjustAttribution.clickLabel = attribution.Get(AdjustUtils.KeyClickLabel) == "" ? - null : attribution.Get(AdjustUtils.KeyClickLabel); - adjustAttribution.adid = attribution.Get(AdjustUtils.KeyAdid) == "" ? - null : attribution.Get(AdjustUtils.KeyAdid); - adjustAttribution.costType = attribution.Get(AdjustUtils.KeyCostType) == "" ? - null : attribution.Get(AdjustUtils.KeyCostType); - AndroidJavaObject ajoCostAmount = attribution.Get(AdjustUtils.KeyCostAmount) == null ? - null : attribution.Get(AdjustUtils.KeyCostAmount); - if (ajoCostAmount == null) - { - adjustAttribution.costAmount = null; - } - else - { - double costAmount = ajoCostAmount.Call("doubleValue"); - adjustAttribution.costAmount = costAmount; - } - adjustAttribution.costCurrency = attribution.Get(AdjustUtils.KeyCostCurrency) == "" ? - null : attribution.Get(AdjustUtils.KeyCostCurrency); - adjustAttribution.fbInstallReferrer = attribution.Get(AdjustUtils.KeyFbInstallReferrer) == "" ? - null : attribution.Get(AdjustUtils.KeyFbInstallReferrer); - callback(adjustAttribution); - } - } - - private class DeferredDeeplinkListener : AndroidJavaProxy - { - private Action callback; - - public DeferredDeeplinkListener(Action pCallback) : base("com.adjust.sdk.OnDeeplinkResponseListener") - { - this.callback = pCallback; - } - - // Method must be lowercase to match Android method signature. - public bool launchReceivedDeeplink(AndroidJavaObject deeplink) - { - if (callback == null) - { - return launchDeferredDeeplink; - } - - string deeplinkURL = deeplink.Call("toString"); - callback(deeplinkURL); - return launchDeferredDeeplink; - } - } - - private class EventTrackingSucceededListener : AndroidJavaProxy - { - private Action callback; - - public EventTrackingSucceededListener(Action pCallback) : base("com.adjust.sdk.OnEventTrackingSucceededListener") - { - this.callback = pCallback; - } - - // Method must be lowercase to match Android method signature. - public void onFinishedEventTrackingSucceeded(AndroidJavaObject eventSuccessData) - { - if (callback == null) - { - return; - } - if (eventSuccessData == null) - { - return; - } - - AdjustEventSuccess adjustEventSuccess = new AdjustEventSuccess(); - adjustEventSuccess.Adid = eventSuccessData.Get(AdjustUtils.KeyAdid) == "" ? - null : eventSuccessData.Get(AdjustUtils.KeyAdid); - adjustEventSuccess.Message = eventSuccessData.Get(AdjustUtils.KeyMessage) == "" ? - null : eventSuccessData.Get(AdjustUtils.KeyMessage); - adjustEventSuccess.Timestamp = eventSuccessData.Get(AdjustUtils.KeyTimestamp) == "" ? - null : eventSuccessData.Get(AdjustUtils.KeyTimestamp); - adjustEventSuccess.EventToken = eventSuccessData.Get(AdjustUtils.KeyEventToken) == "" ? - null : eventSuccessData.Get(AdjustUtils.KeyEventToken); - adjustEventSuccess.CallbackId = eventSuccessData.Get(AdjustUtils.KeyCallbackId) == "" ? - null : eventSuccessData.Get(AdjustUtils.KeyCallbackId); - - try - { - AndroidJavaObject ajoJsonResponse = eventSuccessData.Get(AdjustUtils.KeyJsonResponse); - string jsonResponseString = ajoJsonResponse.Call("toString"); - adjustEventSuccess.BuildJsonResponseFromString(jsonResponseString); - } - catch (Exception) - { - // JSON response reading failed. - // Native Android SDK should send empty JSON object if none available as of v4.12.5. - // Native Android SDK added special logic to send Unity friendly values as of v4.15.0. - } - - callback(adjustEventSuccess); - } - } - - private class EventTrackingFailedListener : AndroidJavaProxy - { - private Action callback; - - public EventTrackingFailedListener(Action pCallback) : base("com.adjust.sdk.OnEventTrackingFailedListener") - { - this.callback = pCallback; - } - - // Method must be lowercase to match Android method signature. - public void onFinishedEventTrackingFailed(AndroidJavaObject eventFailureData) - { - if (callback == null) - { - return; - } - if (eventFailureData == null) - { - return; - } - - AdjustEventFailure adjustEventFailure = new AdjustEventFailure(); - adjustEventFailure.Adid = eventFailureData.Get(AdjustUtils.KeyAdid) == "" ? - null : eventFailureData.Get(AdjustUtils.KeyAdid); - adjustEventFailure.Message = eventFailureData.Get(AdjustUtils.KeyMessage) == "" ? - null : eventFailureData.Get(AdjustUtils.KeyMessage); - adjustEventFailure.WillRetry = eventFailureData.Get(AdjustUtils.KeyWillRetry); - adjustEventFailure.Timestamp = eventFailureData.Get(AdjustUtils.KeyTimestamp) == "" ? - null : eventFailureData.Get(AdjustUtils.KeyTimestamp); - adjustEventFailure.EventToken = eventFailureData.Get(AdjustUtils.KeyEventToken) == "" ? - null : eventFailureData.Get(AdjustUtils.KeyEventToken); - adjustEventFailure.CallbackId = eventFailureData.Get(AdjustUtils.KeyCallbackId) == "" ? - null : eventFailureData.Get(AdjustUtils.KeyCallbackId); - - try - { - AndroidJavaObject ajoJsonResponse = eventFailureData.Get(AdjustUtils.KeyJsonResponse); - string jsonResponseString = ajoJsonResponse.Call("toString"); - adjustEventFailure.BuildJsonResponseFromString(jsonResponseString); - } - catch (Exception) - { - // JSON response reading failed. - // Native Android SDK should send empty JSON object if none available as of v4.12.5. - // Native Android SDK added special logic to send Unity friendly values as of v4.15.0. - } - - callback(adjustEventFailure); - } - } - - private class SessionTrackingSucceededListener : AndroidJavaProxy - { - private Action callback; - - public SessionTrackingSucceededListener(Action pCallback) : base("com.adjust.sdk.OnSessionTrackingSucceededListener") - { - this.callback = pCallback; - } - - // Method must be lowercase to match Android method signature. - public void onFinishedSessionTrackingSucceeded(AndroidJavaObject sessionSuccessData) - { - if (callback == null) - { - return; - } - if (sessionSuccessData == null) - { - return; - } - - AdjustSessionSuccess adjustSessionSuccess = new AdjustSessionSuccess(); - adjustSessionSuccess.Adid = sessionSuccessData.Get(AdjustUtils.KeyAdid) == "" ? - null : sessionSuccessData.Get(AdjustUtils.KeyAdid); - adjustSessionSuccess.Message = sessionSuccessData.Get(AdjustUtils.KeyMessage) == "" ? - null : sessionSuccessData.Get(AdjustUtils.KeyMessage); - adjustSessionSuccess.Timestamp = sessionSuccessData.Get(AdjustUtils.KeyTimestamp) == "" ? - null : sessionSuccessData.Get(AdjustUtils.KeyTimestamp); - - try - { - AndroidJavaObject ajoJsonResponse = sessionSuccessData.Get(AdjustUtils.KeyJsonResponse); - string jsonResponseString = ajoJsonResponse.Call("toString"); - adjustSessionSuccess.BuildJsonResponseFromString(jsonResponseString); - } - catch (Exception) - { - // JSON response reading failed. - // Native Android SDK should send empty JSON object if none available as of v4.12.5. - // Native Android SDK added special logic to send Unity friendly values as of v4.15.0. - } - - callback(adjustSessionSuccess); - } - } - - private class SessionTrackingFailedListener : AndroidJavaProxy - { - private Action callback; - - public SessionTrackingFailedListener(Action pCallback) : base("com.adjust.sdk.OnSessionTrackingFailedListener") - { - this.callback = pCallback; - } - - // Method must be lowercase to match Android method signature. - public void onFinishedSessionTrackingFailed(AndroidJavaObject sessionFailureData) - { - if (callback == null) - { - return; - } - if (sessionFailureData == null) - { - return; - } - - AdjustSessionFailure adjustSessionFailure = new AdjustSessionFailure(); - adjustSessionFailure.Adid = sessionFailureData.Get(AdjustUtils.KeyAdid) == "" ? - null : sessionFailureData.Get(AdjustUtils.KeyAdid); - adjustSessionFailure.Message = sessionFailureData.Get(AdjustUtils.KeyMessage) == "" ? - null : sessionFailureData.Get(AdjustUtils.KeyMessage); - adjustSessionFailure.WillRetry = sessionFailureData.Get(AdjustUtils.KeyWillRetry); - adjustSessionFailure.Timestamp = sessionFailureData.Get(AdjustUtils.KeyTimestamp) == "" ? - null : sessionFailureData.Get(AdjustUtils.KeyTimestamp); - - try - { - AndroidJavaObject ajoJsonResponse = sessionFailureData.Get(AdjustUtils.KeyJsonResponse); - string jsonResponseString = ajoJsonResponse.Call("toString"); - adjustSessionFailure.BuildJsonResponseFromString(jsonResponseString); - } - catch (Exception) - { - // JSON response reading failed. - // Native Android SDK should send empty JSON object if none available as of v4.12.5. - // Native Android SDK added special logic to send Unity friendly values as of v4.15.0. - } - - callback(adjustSessionFailure); - } - } - - private class DeviceIdsReadListener : AndroidJavaProxy - { - private Action onPlayAdIdReadCallback; - - public DeviceIdsReadListener(Action pCallback) : base("com.adjust.sdk.OnDeviceIdsRead") - { - this.onPlayAdIdReadCallback = pCallback; - } - - // Method must be lowercase to match Android method signature. - public void onGoogleAdIdRead(string playAdId) - { - if (onPlayAdIdReadCallback == null) - { - return; - } - - this.onPlayAdIdReadCallback(playAdId); - } - - // Handling of null object. - public void onGoogleAdIdRead(AndroidJavaObject ajoAdId) - { - if (ajoAdId == null) - { - string adId = null; - this.onGoogleAdIdRead(adId); - return; - } - - this.onGoogleAdIdRead(ajoAdId.Call("toString")); - } - } - - private class VerificationInfoListener : AndroidJavaProxy - { - private Action callback; - - public VerificationInfoListener(Action pCallback) : base("com.adjust.sdk.OnPurchaseVerificationFinishedListener") - { - this.callback = pCallback; - } - - public void onVerificationFinished(AndroidJavaObject verificationInfo) - { - AdjustPurchaseVerificationInfo purchaseVerificationInfo = new AdjustPurchaseVerificationInfo(); - // verification status - purchaseVerificationInfo.verificationStatus = verificationInfo.Get(AdjustUtils.KeyVerificationStatus); - // status code - purchaseVerificationInfo.code = verificationInfo.Get(AdjustUtils.KeyCode); - // message - purchaseVerificationInfo.message = verificationInfo.Get(AdjustUtils.KeyMessage); - - if (callback != null) - { - callback(purchaseVerificationInfo); - } - } - } - - private class DeeplinkResolutionListener : AndroidJavaProxy - { - private Action callback; - - public DeeplinkResolutionListener(Action pCallback) : base("com.adjust.sdk.OnDeeplinkResolvedListener") - { - this.callback = pCallback; - } - - public void onDeeplinkResolved(string resolvedLink) - { - if (callback != null) - { - callback(resolvedLink); - } - } - } - - // Private & helper methods. - private static bool IsAppSecretSet(AdjustConfig adjustConfig) - { - return adjustConfig.secretId.HasValue - && adjustConfig.info1.HasValue - && adjustConfig.info2.HasValue - && adjustConfig.info3.HasValue - && adjustConfig.info4.HasValue; - } - } -#endif -} diff --git a/Assets/Adjust/Android/AdjustAndroid.cs.meta b/Assets/Adjust/Android/AdjustAndroid.cs.meta deleted file mode 100644 index f977efdb..00000000 --- a/Assets/Adjust/Android/AdjustAndroid.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1b21499aaf10a42e8b6377af71a35ba5 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Adjust/Android/adjust-android.jar b/Assets/Adjust/Android/adjust-android.jar deleted file mode 100644 index f957787d..00000000 Binary files a/Assets/Adjust/Android/adjust-android.jar and /dev/null differ diff --git a/Assets/Adjust/Android/adjust-android.jar.meta b/Assets/Adjust/Android/adjust-android.jar.meta deleted file mode 100644 index 62add18a..00000000 --- a/Assets/Adjust/Android/adjust-android.jar.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: de7cd4cf0359345f487233fc82a1d892 -timeCreated: 1526341612 -licenseType: Pro -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': data - second: - enabled: 0 - settings: {} - data: - first: - Android: Android - second: - enabled: 1 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Editor.meta b/Assets/Adjust/Editor.meta deleted file mode 100644 index 13d1600c..00000000 --- a/Assets/Adjust/Editor.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: b51771bcccf507e45b2db8213466a010 -folderAsset: yes -timeCreated: 1578652520 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Editor/AdjustEditor.cs b/Assets/Adjust/Editor/AdjustEditor.cs deleted file mode 100644 index b81dadce..00000000 --- a/Assets/Adjust/Editor/AdjustEditor.cs +++ /dev/null @@ -1,342 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Xml; -using System.Collections.Generic; -using System.Text.RegularExpressions; -using UnityEngine; -using UnityEditor; -using UnityEditor.Callbacks; -#if UNITY_IOS -using UnityEditor.iOS.Xcode; -#endif - -public class AdjustEditor : AssetPostprocessor -{ - [MenuItem("Assets/Adjust/Export Unity Package")] - public static void ExportAdjustUnityPackage() - { - string exportedFileName = "Adjust.unitypackage"; - string assetsPath = "Assets/Adjust"; - List assetsToExport = new List(); - - // Adjust Assets. - assetsToExport.Add(assetsPath + "/3rd Party/SimpleJSON.cs"); - - assetsToExport.Add(assetsPath + "/Android/adjust-android.jar"); - assetsToExport.Add(assetsPath + "/Android/AdjustAndroid.cs"); - assetsToExport.Add(assetsPath + "/Android/AdjustAndroidManifest.xml"); - - assetsToExport.Add(assetsPath + "/Editor/AdjustEditor.cs"); - assetsToExport.Add(assetsPath + "/Editor/AdjustSettings.cs"); - assetsToExport.Add(assetsPath + "/Editor/AdjustSettingsEditor.cs"); - assetsToExport.Add(assetsPath + "/Editor/AdjustCustomEditor.cs"); - assetsToExport.Add(assetsPath + "/Editor/AdjustEditorPreprocessor.cs"); - - assetsToExport.Add(assetsPath + "/ExampleGUI/ExampleGUI.cs"); - assetsToExport.Add(assetsPath + "/ExampleGUI/ExampleGUI.prefab"); - assetsToExport.Add(assetsPath + "/ExampleGUI/ExampleGUI.unity"); - - assetsToExport.Add(assetsPath + "/iOS/ADJAttribution.h"); - assetsToExport.Add(assetsPath + "/iOS/ADJConfig.h"); - assetsToExport.Add(assetsPath + "/iOS/ADJEvent.h"); - assetsToExport.Add(assetsPath + "/iOS/ADJEventFailure.h"); - assetsToExport.Add(assetsPath + "/iOS/ADJEventSuccess.h"); - assetsToExport.Add(assetsPath + "/iOS/ADJLogger.h"); - assetsToExport.Add(assetsPath + "/iOS/ADJSessionFailure.h"); - assetsToExport.Add(assetsPath + "/iOS/ADJSessionSuccess.h"); - assetsToExport.Add(assetsPath + "/iOS/ADJSubscription.h"); - assetsToExport.Add(assetsPath + "/iOS/Adjust.h"); - assetsToExport.Add(assetsPath + "/iOS/AdjustiOS.cs"); - assetsToExport.Add(assetsPath + "/iOS/AdjustSdk.a"); - assetsToExport.Add(assetsPath + "/iOS/AdjustUnity.h"); - assetsToExport.Add(assetsPath + "/iOS/AdjustUnity.mm"); - assetsToExport.Add(assetsPath + "/iOS/AdjustUnityDelegate.h"); - assetsToExport.Add(assetsPath + "/iOS/AdjustUnityDelegate.mm"); - - assetsToExport.Add(assetsPath + "/Prefab/Adjust.prefab"); - - assetsToExport.Add(assetsPath + "/Unity/Adjust.cs"); - assetsToExport.Add(assetsPath + "/Unity/AdjustAppStoreSubscription.cs"); - assetsToExport.Add(assetsPath + "/Unity/AdjustAttribution.cs"); - assetsToExport.Add(assetsPath + "/Unity/AdjustConfig.cs"); - assetsToExport.Add(assetsPath + "/Unity/AdjustEnvironment.cs"); - assetsToExport.Add(assetsPath + "/Unity/AdjustEvent.cs"); - assetsToExport.Add(assetsPath + "/Unity/AdjustEventFailure.cs"); - assetsToExport.Add(assetsPath + "/Unity/AdjustEventSuccess.cs"); - assetsToExport.Add(assetsPath + "/Unity/AdjustLogLevel.cs"); - assetsToExport.Add(assetsPath + "/Unity/AdjustPlayStoreSubscription.cs"); - assetsToExport.Add(assetsPath + "/Unity/AdjustSessionFailure.cs"); - assetsToExport.Add(assetsPath + "/Unity/AdjustSessionSuccess.cs"); - assetsToExport.Add(assetsPath + "/Unity/AdjustUtils.cs"); - - assetsToExport.Add(assetsPath + "/Windows/AdjustWindows.cs"); - assetsToExport.Add(assetsPath + "/Windows/WindowsPcl.dll"); - assetsToExport.Add(assetsPath + "/Windows/WindowsUap.dll"); - assetsToExport.Add(assetsPath + "/Windows/Stubs/Win10Interface.dll"); - assetsToExport.Add(assetsPath + "/Windows/Stubs/Win81Interface.dll"); - assetsToExport.Add(assetsPath + "/Windows/Stubs/WinWsInterface.dll"); - assetsToExport.Add(assetsPath + "/Windows/W81/AdjustWP81.dll"); - assetsToExport.Add(assetsPath + "/Windows/W81/Win81Interface.dll"); - assetsToExport.Add(assetsPath + "/Windows/WS/AdjustWS.dll"); - assetsToExport.Add(assetsPath + "/Windows/WS/WinWsInterface.dll"); - assetsToExport.Add(assetsPath + "/Windows/WU10/AdjustUAP10.dll"); - assetsToExport.Add(assetsPath + "/Windows/WU10/Win10Interface.dll"); - assetsToExport.Add(assetsPath + "/Windows/Newtonsoft.Json.dll"); - - AssetDatabase.ExportPackage( - assetsToExport.ToArray(), - exportedFileName, - ExportPackageOptions.IncludeDependencies | ExportPackageOptions.Interactive); - } - - [PostProcessBuild] - public static void OnPostprocessBuild(BuildTarget target, string projectPath) - { - RunPostBuildScript(target: target, projectPath: projectPath); - } - - private static void RunPostBuildScript(BuildTarget target, string projectPath = "") - { - if (target == BuildTarget.iOS) - { -#if UNITY_IOS - Debug.Log("[Adjust]: Starting to perform post build tasks for iOS platform."); - - string xcodeProjectPath = projectPath + "/Unity-iPhone.xcodeproj/project.pbxproj"; - - PBXProject xcodeProject = new PBXProject(); - xcodeProject.ReadFromFile(xcodeProjectPath); - -#if UNITY_2019_3_OR_NEWER - string xcodeTarget = xcodeProject.GetUnityMainTargetGuid(); -#else - string xcodeTarget = xcodeProject.TargetGuidByName("Unity-iPhone"); -#endif - HandlePlistIosChanges(projectPath); - - if (AdjustSettings.iOSUniversalLinksDomains.Length > 0) - { - AddUniversalLinkDomains(xcodeProject, xcodeProjectPath, xcodeTarget); - } - - // If enabled by the user, Adjust SDK will try to add following frameworks to your project: - // - AdSupport.framework (needed for access to IDFA value) - // - AdServices.framework (needed in case you are running ASA campaigns) - // - StoreKit.framework (needed for communication with SKAdNetwork framework) - // - AppTrackingTransparency.framework (needed for information about user's consent to be tracked) - // In case you don't need any of these, feel free to remove them from your app. - - if (AdjustSettings.iOSFrameworkAdSupport) - { - Debug.Log("[Adjust]: Adding AdSupport.framework to Xcode project."); - xcodeProject.AddFrameworkToProject(xcodeTarget, "AdSupport.framework", true); - Debug.Log("[Adjust]: AdSupport.framework added successfully."); - } - else - { - Debug.Log("[Adjust]: Skipping AdSupport.framework linking."); - } - if (AdjustSettings.iOSFrameworkAdServices) - { - Debug.Log("[Adjust]: Adding AdServices.framework to Xcode project."); - xcodeProject.AddFrameworkToProject(xcodeTarget, "AdServices.framework", true); - Debug.Log("[Adjust]: AdServices.framework added successfully."); - } - else - { - Debug.Log("[Adjust]: Skipping AdServices.framework linking."); - } - if (AdjustSettings.iOSFrameworkStoreKit) - { - Debug.Log("[Adjust]: Adding StoreKit.framework to Xcode project."); - xcodeProject.AddFrameworkToProject(xcodeTarget, "StoreKit.framework", true); - Debug.Log("[Adjust]: StoreKit.framework added successfully."); - } - else - { - Debug.Log("[Adjust]: Skipping StoreKit.framework linking."); - } - if (AdjustSettings.iOSFrameworkAppTrackingTransparency) - { - Debug.Log("[Adjust]: Adding AppTrackingTransparency.framework to Xcode project."); - xcodeProject.AddFrameworkToProject(xcodeTarget, "AppTrackingTransparency.framework", true); - Debug.Log("[Adjust]: AppTrackingTransparency.framework added successfully."); - } - else - { - Debug.Log("[Adjust]: Skipping AppTrackingTransparency.framework linking."); - } - - // The Adjust SDK needs to have -ObjC flag set in other linker flags section because of it's categories. - // OTHER_LDFLAGS -ObjC - // - // Seems that in newer Unity IDE versions adding -ObjC flag to Unity-iPhone target doesn't do the trick. - // Adding -ObjC to UnityFramework target however does make things work nicely again. - // This happens because Unity is linking SDK's static library into UnityFramework target. - // Check for presence of UnityFramework target and if there, include -ObjC flag inside of it. - Debug.Log("[Adjust]: Adding -ObjC flag to other linker flags (OTHER_LDFLAGS) of Unity-iPhone target."); - xcodeProject.AddBuildProperty(xcodeTarget, "OTHER_LDFLAGS", "-ObjC"); - Debug.Log("[Adjust]: -ObjC successfully added to other linker flags."); - string xcodeTargetUnityFramework = xcodeProject.TargetGuidByName("UnityFramework"); - if (!string.IsNullOrEmpty(xcodeTargetUnityFramework)) - { - Debug.Log("[Adjust]: Adding -ObjC flag to other linker flags (OTHER_LDFLAGS) of UnityFramework target."); - xcodeProject.AddBuildProperty(xcodeTargetUnityFramework, "OTHER_LDFLAGS", "-ObjC"); - Debug.Log("[Adjust]: -ObjC successfully added to other linker flags."); - } - - // The Adjust SDK needs to have Obj-C exceptions enabled. - // GCC_ENABLE_OBJC_EXCEPTIONS=YES - Debug.Log("[Adjust]: Enabling Obj-C exceptions by setting GCC_ENABLE_OBJC_EXCEPTIONS value to YES."); - xcodeProject.AddBuildProperty(xcodeTarget, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES"); - Debug.Log("[Adjust]: Obj-C exceptions enabled successfully."); - if (!string.IsNullOrEmpty(xcodeTargetUnityFramework)) - { - Debug.Log("[Adjust]: Enabling Obj-C exceptions by setting GCC_ENABLE_OBJC_EXCEPTIONS value to YES."); - xcodeProject.AddBuildProperty(xcodeTargetUnityFramework, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES"); - Debug.Log("[Adjust]: Obj-C exceptions enabled successfully."); - } - - if (xcodeProject.ContainsFileByProjectPath("Libraries/Adjust/iOS/AdjustSigSdk.a")) - { - if (!string.IsNullOrEmpty(xcodeTargetUnityFramework)) - { - xcodeProject.AddBuildProperty(xcodeTargetUnityFramework, "OTHER_LDFLAGS", "-force_load $(PROJECT_DIR)/Libraries/Adjust/iOS/AdjustSigSdk.a"); - } - else - { - xcodeProject.AddBuildProperty(xcodeTarget, "OTHER_LDFLAGS", "-force_load $(PROJECT_DIR)/Libraries/Adjust/iOS/AdjustSigSdk.a"); - } - } - - // Save the changes to Xcode project file. - xcodeProject.WriteToFile(xcodeProjectPath); -#endif - } - } - -#if UNITY_IOS - private static void HandlePlistIosChanges(string projectPath) - { - const string UserTrackingUsageDescriptionKey = "NSUserTrackingUsageDescription"; - - // Check if needs to do any info plist change. - bool hasUserTrackingDescription = - !string.IsNullOrEmpty(AdjustSettings.iOSUserTrackingUsageDescription); - bool hasUrlSchemesDeepLinksEnabled = AdjustSettings.iOSUrlSchemes.Length > 0; - - if (!hasUserTrackingDescription && !hasUrlSchemesDeepLinksEnabled) - { - return; - } - - // Get and read info plist. - var plistPath = Path.Combine(projectPath, "Info.plist"); - var plist = new PlistDocument(); - plist.ReadFromFile(plistPath); - var plistRoot = plist.root; - - // Do the info plist changes. - if (hasUserTrackingDescription) - { - if (plistRoot[UserTrackingUsageDescriptionKey] != null) - { - Debug.Log("[Adjust]: Overwritting User Tracking Usage Description."); - } - plistRoot.SetString(UserTrackingUsageDescriptionKey, - AdjustSettings.iOSUserTrackingUsageDescription); - } - - if (hasUrlSchemesDeepLinksEnabled) - { - AddUrlSchemesIOS(plistRoot, AdjustSettings.iOSUrlIdentifier, AdjustSettings.iOSUrlSchemes); - } - - // Write any info plist change. - File.WriteAllText(plistPath, plist.WriteToString()); - } - - private static void AddUrlSchemesIOS(PlistElementDict plistRoot, string urlIdentifier, string[] urlSchemes) - { - // Set Array for futher deeplink values. - var urlTypesArray = CreatePlistElementArray(plistRoot, "CFBundleURLTypes"); - - // Array will contain just one deeplink dictionary - var urlSchemesItems = CreatePlistElementDict(urlTypesArray); - urlSchemesItems.SetString("CFBundleURLName", urlIdentifier); - var urlSchemesArray = CreatePlistElementArray(urlSchemesItems, "CFBundleURLSchemes"); - - // Delete old deferred deeplinks URIs - Debug.Log("[Adjust]: Removing deeplinks that already exist in the array to avoid duplicates."); - foreach (var link in urlSchemes) - { - urlSchemesArray.values.RemoveAll( - element => element != null && element.AsString().Equals(link)); - } - - Debug.Log("[Adjust]: Adding new deep links."); - foreach (var link in urlSchemes.Distinct()) - { - urlSchemesArray.AddString(link); - } - } - - private static PlistElementArray CreatePlistElementArray(PlistElementDict root, string key) - { - if (!root.values.ContainsKey(key)) - { - Debug.Log(string.Format("[Adjust]: {0} not found in Info.plist. Creating a new one.", key)); - return root.CreateArray(key); - } - var result = root.values[key].AsArray(); - return result != null ? result : root.CreateArray(key); - } - - private static PlistElementDict CreatePlistElementDict(PlistElementArray rootArray) - { - if (rootArray.values.Count == 0) - { - Debug.Log("[Adjust]: Deeplinks array doesn't contain dictionary for deeplinks. Creating a new one."); - return rootArray.AddDict(); - } - - var urlSchemesItems = rootArray.values[0].AsDict(); - Debug.Log("[Adjust]: Reading deeplinks array"); - if (urlSchemesItems == null) - { - Debug.Log("[Adjust]: Deeplinks array doesn't contain dictionary for deeplinks. Creating a new one."); - urlSchemesItems = rootArray.AddDict(); - } - - return urlSchemesItems; - } - - private static void AddUniversalLinkDomains(PBXProject project, string xCodeProjectPath, string xCodeTarget) - { - string entitlementsFileName = "Unity-iPhone.entitlements"; - - Debug.Log("[Adjust]: Adding associated domains to entitlements file."); -#if UNITY_2019_3_OR_NEWER - var projectCapabilityManager = new ProjectCapabilityManager(xCodeProjectPath, entitlementsFileName, null, project.GetUnityMainTargetGuid()); -#else - var projectCapabilityManager = new ProjectCapabilityManager(xCodeProjectPath, entitlementsFileName, PBXProject.GetUnityTargetName()); -#endif - var uniqueDomains = AdjustSettings.iOSUniversalLinksDomains.Distinct().ToArray(); - const string applinksPrefix = "applinks:"; - for (int i = 0; i < uniqueDomains.Length; i++) - { - if (!uniqueDomains[i].StartsWith(applinksPrefix)) - { - uniqueDomains[i] = applinksPrefix + uniqueDomains[i]; - } - } - - projectCapabilityManager.AddAssociatedDomains(uniqueDomains); - projectCapabilityManager.WriteToFile(); - - Debug.Log("[Adjust]: Enabling Associated Domains capability with created entitlements file."); - project.AddCapability(xCodeTarget, PBXCapabilityType.AssociatedDomains, entitlementsFileName); - } -#endif -} diff --git a/Assets/Adjust/Editor/AdjustEditorPreprocessor.cs b/Assets/Adjust/Editor/AdjustEditorPreprocessor.cs deleted file mode 100644 index 0c8d9b14..00000000 --- a/Assets/Adjust/Editor/AdjustEditorPreprocessor.cs +++ /dev/null @@ -1,365 +0,0 @@ -using System.IO; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor.Build; -using UnityEditor; -using System.Xml; -using System; -using System.Text.RegularExpressions; -using System.Linq; - -#if UNITY_2018_1_OR_NEWER -public class AdjustEditorPreprocessor : IPreprocessBuildWithReport -#else -public class AdjustEditorPreprocessor : IPreprocessBuild -#endif -{ - public int callbackOrder - { - get - { - return 0; - } - } -#if UNITY_2018_1_OR_NEWER - public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report) - { - OnPreprocessBuild(report.summary.platform, string.Empty); - } -#endif - - public void OnPreprocessBuild(BuildTarget target, string path) - { - if (target == BuildTarget.Android) - { -#if UNITY_ANDROID - RunPostProcessTasksAndroid(); -#endif - } - } - -#if UNITY_ANDROID - private static void RunPostProcessTasksAndroid() - { - var isAdjustManifestUsed = false; - var androidPluginsPath = Path.Combine(Application.dataPath, "Plugins/Android"); - var adjustManifestPath = Path.Combine(Application.dataPath, "Adjust/Android/AdjustAndroidManifest.xml"); - var appManifestPath = Path.Combine(Application.dataPath, "Plugins/Android/AndroidManifest.xml"); - - // Check if user has already created AndroidManifest.xml file in its location. - // If not, use already predefined AdjustAndroidManifest.xml as default one. - if (!File.Exists(appManifestPath)) - { - if (!Directory.Exists(androidPluginsPath)) - { - Directory.CreateDirectory(androidPluginsPath); - } - - isAdjustManifestUsed = true; - File.Copy(adjustManifestPath, appManifestPath); - - Debug.Log("[Adjust]: User defined AndroidManifest.xml file not found in Plugins/Android folder."); - Debug.Log("[Adjust]: Creating default app's AndroidManifest.xml from AdjustAndroidManifest.xml file."); - } - else - { - Debug.Log("[Adjust]: User defined AndroidManifest.xml file located in Plugins/Android folder."); - } - - // Let's open the app's AndroidManifest.xml file. - var manifestFile = new XmlDocument(); - manifestFile.Load(appManifestPath); - - var manifestHasChanged = false; - - // If Adjust manifest is used, we have already set up everything in it so that - // our native Android SDK can be used properly. - if (!isAdjustManifestUsed) - { - // However, if you already had your own AndroidManifest.xml, we'll now run - // some checks on it and tweak it a bit if needed to add some stuff which - // our native Android SDK needs so that it can run properly. - - // Add needed permissions if they are missing. - manifestHasChanged |= AddPermissions(manifestFile); - - // Add intent filter to main activity if it is missing. - manifestHasChanged |= AddBroadcastReceiver(manifestFile); - } - - // Add intent filter to URL schemes for deeplinking - manifestHasChanged |= AddURISchemes(manifestFile); - - if (manifestHasChanged) - { - // Save the changes. - manifestFile.Save(appManifestPath); - - Debug.Log("[Adjust]: App's AndroidManifest.xml file check and potential modification completed."); - Debug.Log("[Adjust]: Please check if any error message was displayed during this process " - + "and make sure to fix all issues in order to properly use the Adjust SDK in your app."); - } - else - { - Debug.Log("[Adjust]: App's AndroidManifest.xml file check completed."); - Debug.Log("[Adjust]: No modifications performed due to app's AndroidManifest.xml file compatibility."); - } - } - - private static bool AddURISchemes(XmlDocument manifest) - { - if (AdjustSettings.AndroidUriSchemes.Length == 0) - { - return false; - } - Debug.Log("[Adjust]: Start addition of URI schemes"); - - var intentRoot = manifest.DocumentElement.SelectSingleNode("/manifest/application/activity[@android:name='com.unity3d.player.UnityPlayerActivity']", GetNamespaceManager(manifest)); - var usedIntentFiltersChanged = false; - var usedIntentFilters = GetIntentFilter(manifest); - foreach (var uriScheme in AdjustSettings.AndroidUriSchemes) - { - Uri uri; - try - { - // The first element is android:scheme and the second one is android:host. - uri = new Uri(uriScheme); - - // Uri class converts implicit file paths to explicit file paths with the file:// scheme. - if (!uriScheme.StartsWith(uri.Scheme)) - { - throw new UriFormatException(); - } - } - catch (UriFormatException) - { - Debug.LogError(string.Format("[Adjust]: Android deeplink URI scheme \"{0}\" is invalid and will be ignored.", uriScheme)); - Debug.LogWarning(string.Format("[Adjust]: Make sure that your URI scheme entry ends with ://")); - continue; - } - - if (!IsIntentFilterAlreadyExist(manifest, uri)) - { - Debug.Log("[Adjust]: Adding new URI with scheme: " + uri.Scheme + ", and host: " + uri.Host); - var androidSchemeNode = manifest.CreateElement("data"); - AddAndroidNamespaceAttribute(manifest, "scheme", uri.Scheme, androidSchemeNode); - AddAndroidNamespaceAttribute(manifest, "host", uri.Host, androidSchemeNode); - usedIntentFilters.AppendChild(androidSchemeNode); - usedIntentFiltersChanged = true; - - Debug.Log(string.Format("[Adjust]: Android deeplink URI scheme \"{0}\" successfully added to your app's AndroidManifest.xml file.", uriScheme)); - } - } - - if (usedIntentFiltersChanged && usedIntentFilters.ParentNode == null) - { - intentRoot.AppendChild(usedIntentFilters); - } - - return usedIntentFiltersChanged; - } - - private static XmlElement GetIntentFilter(XmlDocument manifest) - { - var xpath = "/manifest/application/activity/intent-filter[data/@android:scheme and data/@android:host]"; - var intentFilter = manifest.DocumentElement.SelectSingleNode(xpath, GetNamespaceManager(manifest)) as XmlElement; - if (intentFilter == null) - { - const string androidName = "name"; - const string category = "category"; - - intentFilter = manifest.CreateElement("intent-filter"); - - var actionElement = manifest.CreateElement("action"); - AddAndroidNamespaceAttribute(manifest, androidName, "android.intent.action.VIEW", actionElement); - intentFilter.AppendChild(actionElement); - - var defaultCategory = manifest.CreateElement(category); - AddAndroidNamespaceAttribute(manifest, androidName, "android.intent.category.DEFAULT", defaultCategory); - intentFilter.AppendChild(defaultCategory); - - var browsableCategory = manifest.CreateElement(category); - AddAndroidNamespaceAttribute(manifest, androidName, "android.intent.category.BROWSABLE", browsableCategory); - intentFilter.AppendChild(browsableCategory); - } - return intentFilter; - } - - private static bool IsIntentFilterAlreadyExist(XmlDocument manifest, Uri link) - { - var xpath = string.Format("/manifest/application/activity/intent-filter/data[@android:scheme='{0}' and @android:host='{1}']", link.Scheme, link.Host); - return manifest.DocumentElement.SelectSingleNode(xpath, GetNamespaceManager(manifest)) != null; - } - - private static bool AddPermissions(XmlDocument manifest) - { - // The Adjust SDK needs two permissions to be added to you app's manifest file: - // - // - // - // - - Debug.Log("[Adjust]: Checking if all permissions needed for the Adjust SDK are present in the app's AndroidManifest.xml file."); - - var manifestHasChanged = false; - - // If enabled by the user && android.permission.INTERNET permission is missing, add it. - if (AdjustSettings.androidPermissionInternet == true) - { - manifestHasChanged |= AddPermission(manifest, "android.permission.INTERNET"); - } - // If enabled by the user && com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE permission is missing, add it. - if (AdjustSettings.androidPermissionInstallReferrerService == true) - { - manifestHasChanged |= AddPermission(manifest, "com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE"); - } - // If enabled by the user && com.google.android.gms.permission.AD_ID permission is missing, add it. - if (AdjustSettings.androidPermissionAdId == true) - { - manifestHasChanged |= AddPermission(manifest, "com.google.android.gms.permission.AD_ID"); - } - // If enabled by the user && android.permission.ACCESS_NETWORK_STATE permission is missing, add it. - if (AdjustSettings.androidPermissionAccessNetworkState == true) - { - manifestHasChanged |= AddPermission(manifest, "android.permission.ACCESS_NETWORK_STATE"); - } - - return manifestHasChanged; - } - - private static bool AddPermission(XmlDocument manifest, string permissionValue) - { - if (DoesPermissionExist(manifest, permissionValue)) - { - Debug.Log(string.Format("[Adjust]: Your app's AndroidManifest.xml file already contains {0} permission.", permissionValue)); - return false; - } - - var element = manifest.CreateElement("uses-permission"); - AddAndroidNamespaceAttribute(manifest, "name", permissionValue, element); - manifest.DocumentElement.AppendChild(element); - Debug.Log(string.Format("[Adjust]: {0} permission successfully added to your app's AndroidManifest.xml file.", permissionValue)); - - return true; - } - - private static bool DoesPermissionExist(XmlDocument manifest, string permissionValue) - { - var xpath = string.Format("/manifest/uses-permission[@android:name='{0}']", permissionValue); - return manifest.DocumentElement.SelectSingleNode(xpath, GetNamespaceManager(manifest)) != null; - } - - private static bool AddBroadcastReceiver(XmlDocument manifest) - { - // We're looking for existence of broadcast receiver in the AndroidManifest.xml - // Check out the example below how that usually looks like: - - // > - // - // /> - // - // > - // - // - // - // - // - // - // - // - // - // - // - // > - // - // - - Debug.Log("[Adjust]: Checking if app's AndroidManifest.xml file contains receiver for INSTALL_REFERRER intent."); - - // Find the application node - var applicationNodeXpath = "/manifest/application"; - var applicationNode = manifest.DocumentElement.SelectSingleNode(applicationNodeXpath); - - // If there's no application node, something is really wrong with your AndroidManifest.xml. - if (applicationNode == null) - { - Debug.LogError("[Adjust]: Your app's AndroidManifest.xml file does not contain \"\" node."); - Debug.LogError("[Adjust]: Unable to add the Adjust broadcast receiver to AndroidManifest.xml."); - return false; - } - - // Okay, there's an application node in the AndroidManifest.xml file. - // Let's now check if user has already defined a receiver which is listening to INSTALL_REFERRER intent. - // If that is already defined, don't force the Adjust broadcast receiver to the manifest file. - // If not, add the Adjust broadcast receiver to the manifest file. - - var customBroadcastReceiversNodes = GetCustomRecieverNodes(manifest); - if (customBroadcastReceiversNodes.Count > 0) - { - if (DoesAdjustBroadcastReceiverExist(manifest)) - { - Debug.Log("[Adjust]: It seems like you are already using Adjust broadcast receiver. Yay."); - } - else - { - Debug.Log("[Adjust]: It seems like you are using your own broadcast receiver."); - Debug.Log("[Adjust]: Please, add the calls to the Adjust broadcast receiver like described in here: https://github.com/adjust/android_sdk/blob/master/doc/english/referrer.md"); - } - - return false; - } - - // Generate Adjust broadcast receiver entry and add it to the application node. - var receiverElement = manifest.CreateElement("receiver"); - AddAndroidNamespaceAttribute(manifest, "name", "com.adjust.sdk.AdjustReferrerReceiver", receiverElement); - AddAndroidNamespaceAttribute(manifest, "permission", "android.permission.INSTALL_PACKAGES", receiverElement); - AddAndroidNamespaceAttribute(manifest, "exported", "true", receiverElement); - - var intentFilterElement = manifest.CreateElement("intent-filter"); - var actionElement = manifest.CreateElement("action"); - AddAndroidNamespaceAttribute(manifest, "name", "com.android.vending.INSTALL_REFERRER", actionElement); - - intentFilterElement.AppendChild(actionElement); - receiverElement.AppendChild(intentFilterElement); - applicationNode.AppendChild(receiverElement); - - Debug.Log("[Adjust]: Adjust broadcast receiver successfully added to your app's AndroidManifest.xml file."); - - return true; - } - - private static bool DoesAdjustBroadcastReceiverExist(XmlDocument manifest) - { - var xpath = "/manifest/application/receiver[@android:name='com.adjust.sdk.AdjustReferrerReceiver']"; - return manifest.SelectSingleNode(xpath, GetNamespaceManager(manifest)) != null; - } - - private static List GetCustomRecieverNodes(XmlDocument manifest) - { - var xpath = "/manifest/application/receiver[intent-filter/action[@android:name='com.android.vending.INSTALL_REFERRER']]"; - return new List(manifest.DocumentElement.SelectNodes(xpath, GetNamespaceManager(manifest)).OfType()); - } - - private static void AddAndroidNamespaceAttribute(XmlDocument manifest, string key, string value, XmlElement node) - { - var androidSchemeAttribute = manifest.CreateAttribute("android", key, "http://schemas.android.com/apk/res/android"); - androidSchemeAttribute.InnerText = value; - node.SetAttributeNode(androidSchemeAttribute); - } - - private static XmlNamespaceManager GetNamespaceManager(XmlDocument manifest) - { - var namespaceManager = new XmlNamespaceManager(manifest.NameTable); - namespaceManager.AddNamespace("android", "http://schemas.android.com/apk/res/android"); - return namespaceManager; - } -#endif -} diff --git a/Assets/Adjust/Editor/AdjustSettings.cs b/Assets/Adjust/Editor/AdjustSettings.cs deleted file mode 100644 index 4d076444..00000000 --- a/Assets/Adjust/Editor/AdjustSettings.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Inspired by: https://github.com/facebook/facebook-sdk-for-unity/blob/master/Facebook.Unity.Settings/FacebookSettings.cs - -using System.Collections.Generic; -using UnityEditor; -using UnityEngine; - -public class AdjustSettings : ScriptableObject -{ - private static AdjustSettings instance; - - [SerializeField] - private bool _iOSFrameworkAdSupport = true; - [SerializeField] - private bool _iOSFrameworkAdServices = false; - [SerializeField] - private bool _iOSFrameworkAppTrackingTransparency = false; - [SerializeField] - private bool _iOSFrameworkStoreKit = false; - [SerializeField] - private bool _androidPermissionInternet = true; - [SerializeField] - private bool _androidPermissionInstallReferrerService = true; - [SerializeField] - private bool _androidPermissionAdId = true; - [SerializeField] - private bool _androidPermissionAccessNetworkState = false; - [SerializeField] - private string _iOSUserTrackingUsageDescription; - [SerializeField] - private string _iOSUrlIdentifier; - [SerializeField] - private string[] _iOSUrlSchemes = new string[0]; - [SerializeField] - private string[] _iOSUniversalLinksDomains = new string[0]; - [SerializeField] - private string[] androidUriSchemes = new string[0]; - - public static AdjustSettings Instance - { - get - { - instance = NullableInstance; - - if (instance == null) - { - // Create AdjustSettings.asset inside the folder in which AdjustSettings.cs reside. - instance = ScriptableObject.CreateInstance(); - var guids = AssetDatabase.FindAssets(string.Format("{0} t:script", "AdjustSettings")); - if (guids == null || guids.Length <= 0) - { - return instance; - } - var assetPath = AssetDatabase.GUIDToAssetPath(guids[0]).Replace("AdjustSettings.cs", "AdjustSettings.asset"); - AssetDatabase.CreateAsset(instance, assetPath); - } - - return instance; - } - } - - public static AdjustSettings NullableInstance - { - get - { - if (instance == null) - { - var guids = AssetDatabase.FindAssets(string.Format("{0} t:ScriptableObject", "AdjustSettings")); - if (guids == null || guids.Length <= 0) - { - return instance; - } - var assetPath = AssetDatabase.GUIDToAssetPath(guids[0]); - instance = (AdjustSettings)AssetDatabase.LoadAssetAtPath(assetPath, typeof(AdjustSettings)); - } - - return instance; - } - } - - public static bool iOSFrameworkAdSupport - { - get { return Instance._iOSFrameworkAdSupport; } - set { Instance._iOSFrameworkAdSupport = value; } - } - - public static bool iOSFrameworkAdServices - { - get { return Instance._iOSFrameworkAdServices; } - set { Instance._iOSFrameworkAdServices = value; } - } - - public static bool iOSFrameworkAppTrackingTransparency - { - get { return Instance._iOSFrameworkAppTrackingTransparency; } - set { Instance._iOSFrameworkAppTrackingTransparency = value; } - } - - public static bool iOSFrameworkStoreKit - { - get { return Instance._iOSFrameworkStoreKit; } - set { Instance._iOSFrameworkStoreKit = value; } - } - - public static bool androidPermissionInternet - { - get { return Instance._androidPermissionInternet; } - set { Instance._androidPermissionInternet = value; } - } - - public static bool androidPermissionInstallReferrerService - { - get { return Instance._androidPermissionInstallReferrerService; } - set { Instance._androidPermissionInstallReferrerService = value; } - } - - public static bool androidPermissionAdId - { - get { return Instance._androidPermissionAdId; } - set { Instance._androidPermissionAdId = value; } - } - - public static bool androidPermissionAccessNetworkState - { - get { return Instance._androidPermissionAccessNetworkState; } - set { Instance._androidPermissionAccessNetworkState = value; } - } - - public static string iOSUserTrackingUsageDescription - { - get { return Instance._iOSUserTrackingUsageDescription; } - set { Instance._iOSUserTrackingUsageDescription = value; } - } - - public static string iOSUrlIdentifier - { - get { return Instance._iOSUrlIdentifier; } - set { Instance._iOSUrlIdentifier = value; } - } - - public static string[] iOSUrlSchemes - { - get { return Instance._iOSUrlSchemes; } - set { Instance._iOSUrlSchemes = value; } - } - - public static string[] iOSUniversalLinksDomains - { - get { return Instance._iOSUniversalLinksDomains; } - set { Instance._iOSUniversalLinksDomains = value; } - } - - public static string[] AndroidUriSchemes - { - get { return Instance.androidUriSchemes; } - set { Instance.androidUriSchemes = value; } - } -} diff --git a/Assets/Adjust/iOS/Test.meta b/Assets/Adjust/Example.meta similarity index 77% rename from Assets/Adjust/iOS/Test.meta rename to Assets/Adjust/Example.meta index 22fdc0b7..ab395fc0 100644 --- a/Assets/Adjust/iOS/Test.meta +++ b/Assets/Adjust/Example.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 07ff6d23456964008b63ea28e23ff7cb +guid: e06bbe7d4e6ce4f4880af971623a389e folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Adjust/ExampleGUI/ExampleGUI.cs b/Assets/Adjust/Example/Example.cs similarity index 75% rename from Assets/Adjust/ExampleGUI/ExampleGUI.cs rename to Assets/Adjust/Example/Example.cs index 57a5490a..7d419c48 100644 --- a/Assets/Adjust/ExampleGUI/ExampleGUI.cs +++ b/Assets/Adjust/Example/Example.cs @@ -4,9 +4,9 @@ using System.Runtime.InteropServices; using UnityEngine; using UnityEngine.UI; -using com.adjust.sdk; +using AdjustSdk; -public class ExampleGUI : MonoBehaviour +public class Example : MonoBehaviour { private int numberOfButtons = 8; private bool isEnabled; @@ -27,15 +27,8 @@ void OnGUI() 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.setEventSuccessDelegate(EventSuccessCallback); - adjustConfig.setEventFailureDelegate(EventFailureCallback); - adjustConfig.setSessionSuccessDelegate(SessionSuccessCallback); - adjustConfig.setSessionFailureDelegate(SessionFailureCallback); - adjustConfig.setDeferredDeeplinkDelegate(DeferredDeeplinkCallback); - adjustConfig.setAttributionChangedDelegate(AttributionChangedCallback); - Adjust.start(adjustConfig); + adjustConfig.LogLevel = AdjustLogLevel.Verbose; + Adjust.InitSdk(adjustConfig); isEnabled = true; txtManualLaunch = "SDK Launched"; @@ -45,42 +38,42 @@ void OnGUI() 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); + 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); + 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); + 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); + 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); + Adjust.SwitchToOfflineMode(); txtSetOfflineMode = "Turn Offline Mode OFF"; } else { - Adjust.setOfflineMode(false); + Adjust.SwitchBackToOnlineMode(); txtSetOfflineMode = "Turn Offline Mode ON"; } } @@ -89,20 +82,23 @@ void OnGUI() { if (string.Equals(txtSetEnabled, "Disable SDK", StringComparison.OrdinalIgnoreCase)) { - Adjust.setEnabled(false); + Adjust.Disable(); txtSetEnabled = "Enable SDK"; } else { - Adjust.setEnabled(true); + Adjust.Enable(); 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; + Adjust.IsEnabled(enabled => + { + isEnabled = enabled; + showPopUp = true; + }); } } @@ -132,37 +128,33 @@ public void AttributionChangedCallback(AdjustAttribution attributionData) { Debug.Log("Attribution changed!"); - if (attributionData.trackerName != null) - { - Debug.Log("Tracker name: " + attributionData.trackerName); - } - if (attributionData.trackerToken != null) + if (attributionData.TrackerName != null) { - Debug.Log("Tracker token: " + attributionData.trackerToken); + Debug.Log("Tracker name: " + attributionData.TrackerName); } - if (attributionData.network != null) + if (attributionData.TrackerToken != null) { - Debug.Log("Network: " + attributionData.network); + Debug.Log("Tracker token: " + attributionData.TrackerToken); } - if (attributionData.campaign != null) + if (attributionData.Network != null) { - Debug.Log("Campaign: " + attributionData.campaign); + Debug.Log("Network: " + attributionData.Network); } - if (attributionData.adgroup != null) + if (attributionData.Campaign != null) { - Debug.Log("Adgroup: " + attributionData.adgroup); + Debug.Log("Campaign: " + attributionData.Campaign); } - if (attributionData.creative != null) + if (attributionData.Adgroup != null) { - Debug.Log("Creative: " + attributionData.creative); + Debug.Log("Adgroup: " + attributionData.Adgroup); } - if (attributionData.clickLabel != null) + if (attributionData.Creative != null) { - Debug.Log("Click label: " + attributionData.clickLabel); + Debug.Log("Creative: " + attributionData.Creative); } - if (attributionData.adid != null) + if (attributionData.ClickLabel != null) { - Debug.Log("ADID: " + attributionData.adid); + Debug.Log("Click label: " + attributionData.ClickLabel); } } @@ -192,7 +184,7 @@ public void EventSuccessCallback(AdjustEventSuccess eventSuccessData) } if (eventSuccessData.JsonResponse != null) { - Debug.Log("JsonResponse: " + eventSuccessData.GetJsonResponse()); + Debug.Log("JsonResponse: " + eventSuccessData.GetJsonResponseAsString()); } } @@ -222,7 +214,7 @@ public void EventFailureCallback(AdjustEventFailure eventFailureData) } if (eventFailureData.JsonResponse != null) { - Debug.Log("JsonResponse: " + eventFailureData.GetJsonResponse()); + Debug.Log("JsonResponse: " + eventFailureData.GetJsonResponseAsString()); } Debug.Log("WillRetry: " + eventFailureData.WillRetry.ToString()); @@ -246,7 +238,7 @@ public void SessionSuccessCallback(AdjustSessionSuccess sessionSuccessData) } if (sessionSuccessData.JsonResponse != null) { - Debug.Log("JsonResponse: " + sessionSuccessData.GetJsonResponse()); + Debug.Log("JsonResponse: " + sessionSuccessData.GetJsonResponseAsString()); } } @@ -268,7 +260,7 @@ public void SessionFailureCallback(AdjustSessionFailure sessionFailureData) } if (sessionFailureData.JsonResponse != null) { - Debug.Log("JsonResponse: " + sessionFailureData.GetJsonResponse()); + Debug.Log("JsonResponse: " + sessionFailureData.GetJsonResponseAsString()); } Debug.Log("WillRetry: " + sessionFailureData.WillRetry.ToString()); diff --git a/Assets/Adjust/Unity/AdjustPurchaseVerificationInfo.cs.meta b/Assets/Adjust/Example/Example.cs.meta similarity index 83% rename from Assets/Adjust/Unity/AdjustPurchaseVerificationInfo.cs.meta rename to Assets/Adjust/Example/Example.cs.meta index 486c6410..948bf416 100644 --- a/Assets/Adjust/Unity/AdjustPurchaseVerificationInfo.cs.meta +++ b/Assets/Adjust/Example/Example.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c0c97a5152b31474d89bc1ba521644de +guid: 8e666decc46d44e7e98c2edc2493173b MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Adjust/ExampleGUI/ExampleGUI.prefab b/Assets/Adjust/Example/Example.prefab similarity index 92% rename from Assets/Adjust/ExampleGUI/ExampleGUI.prefab rename to Assets/Adjust/Example/Example.prefab index 377b5082..9376beb4 100644 --- a/Assets/Adjust/ExampleGUI/ExampleGUI.prefab +++ b/Assets/Adjust/Example/Example.prefab @@ -10,7 +10,7 @@ GameObject: - component: {fileID: 400000} - component: {fileID: 11400000} m_Layer: 0 - m_Name: ExampleGUI + m_Name: Example m_TagString: MainCamera m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -37,7 +37,7 @@ MonoBehaviour: m_GameObject: {fileID: 100000} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 196c5c89d4b1e46dfbf423ae77d31a68, type: 3} + m_Script: {fileID: 11500000, guid: 8e666decc46d44e7e98c2edc2493173b, type: 3} m_Name: m_EditorClassIdentifier: --- !u!1001 &100100000 diff --git a/Assets/Adjust/Example/Example.prefab.meta b/Assets/Adjust/Example/Example.prefab.meta new file mode 100644 index 00000000..613dfb5c --- /dev/null +++ b/Assets/Adjust/Example/Example.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f587a7d44cc924584a3dc4ab3f9201c3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/ExampleGUI/ExampleGUI.unity b/Assets/Adjust/Example/Example.unity similarity index 68% rename from Assets/Adjust/ExampleGUI/ExampleGUI.unity rename to Assets/Adjust/Example/Example.unity index 5026f265..99506cf7 100644 --- a/Assets/Adjust/ExampleGUI/ExampleGUI.unity +++ b/Assets/Adjust/Example/Example.unity @@ -150,7 +150,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 415478, guid: a3267720e82aa41c1a05ab29824902b4, type: 2} propertyPath: m_RootOrder - value: 2 + value: 0 objectReference: {fileID: 0} - target: {fileID: 11482148, guid: a3267720e82aa41c1a05ab29824902b4, type: 2} propertyPath: startManually @@ -167,126 +167,45 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: a3267720e82aa41c1a05ab29824902b4, type: 2} m_IsPrefabParent: 0 ---- !u!1 &231489158 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 231489162} - - component: {fileID: 231489161} - - component: {fileID: 231489160} - - component: {fileID: 231489159} - m_Layer: 0 - m_Name: Camera - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &231489159 -AudioListener: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 231489158} - m_Enabled: 1 ---- !u!124 &231489160 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 231489158} - m_Enabled: 1 ---- !u!20 &231489161 -Camera: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 231489158} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &231489162 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 231489158} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &1861285553 +--- !u!1001 &1605594768 Prefab: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2} + - target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2} + - target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2} propertyPath: m_LocalPosition.y value: 1 objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2} + - target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2} propertyPath: m_LocalPosition.z value: -10 objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2} + - target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2} + - target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2} + - target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2} + - target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2} + - target: {fileID: 400000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2} propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 50b53da2a7a154d63a33a49ad08c24a8, type: 2} + m_ParentPrefab: {fileID: 100100000, guid: f587a7d44cc924584a3dc4ab3f9201c3, type: 2} m_IsPrefabParent: 0 diff --git a/Assets/Adjust/Example/Example.unity.meta b/Assets/Adjust/Example/Example.unity.meta new file mode 100644 index 00000000..c336b0fb --- /dev/null +++ b/Assets/Adjust/Example/Example.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 145310088cc5045318beea91f1fd7d1f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/ExampleGUI.meta b/Assets/Adjust/ExampleGUI.meta deleted file mode 100644 index efca979c..00000000 --- a/Assets/Adjust/ExampleGUI.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: c173c46523b75714d945d694e8b89742 -folderAsset: yes -timeCreated: 1578652520 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/ExampleGUI/ExampleGUI.cs.meta b/Assets/Adjust/ExampleGUI/ExampleGUI.cs.meta deleted file mode 100644 index b52508ef..00000000 --- a/Assets/Adjust/ExampleGUI/ExampleGUI.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 196c5c89d4b1e46dfbf423ae77d31a68 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Adjust/ExampleGUI/ExampleGUI.prefab.meta b/Assets/Adjust/ExampleGUI/ExampleGUI.prefab.meta deleted file mode 100644 index e70eb6c2..00000000 --- a/Assets/Adjust/ExampleGUI/ExampleGUI.prefab.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 50b53da2a7a154d63a33a49ad08c24a8 -NativeFormatImporter: - userData: diff --git a/Assets/Adjust/ExampleGUI/ExampleGUI.unity.meta b/Assets/Adjust/ExampleGUI/ExampleGUI.unity.meta deleted file mode 100644 index 60d5d95f..00000000 --- a/Assets/Adjust/ExampleGUI/ExampleGUI.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6aa8afcd558084586bce9f8efd3eb5d6 -timeCreated: 1447689503 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Android/Test.meta b/Assets/Adjust/Native.meta similarity index 77% rename from Assets/Adjust/Android/Test.meta rename to Assets/Adjust/Native.meta index 28a6c61e..de5dab9b 100644 --- a/Assets/Adjust/Android/Test.meta +++ b/Assets/Adjust/Native.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c303274dc3c624cd2a312c713fa2b8bc +guid: 48d8fb88fe43540d48dd33b18a151507 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Adjust/Windows/Test.meta b/Assets/Adjust/Native/Android.meta similarity index 77% rename from Assets/Adjust/Windows/Test.meta rename to Assets/Adjust/Native/Android.meta index 7d03f873..bc71354a 100644 --- a/Assets/Adjust/Windows/Test.meta +++ b/Assets/Adjust/Native/Android.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4707311d117c447a4a581c93f28013f1 +guid: 99903aebed26d46a2aa9f9aa2b17a339 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Adjust/Android/AdjustAndroidManifest.xml b/Assets/Adjust/Native/Android/AdjustAndroidManifest.xml similarity index 100% rename from Assets/Adjust/Android/AdjustAndroidManifest.xml rename to Assets/Adjust/Native/Android/AdjustAndroidManifest.xml diff --git a/Assets/Adjust/Android/AdjustAndroidManifest.xml.meta b/Assets/Adjust/Native/Android/AdjustAndroidManifest.xml.meta similarity index 100% rename from Assets/Adjust/Android/AdjustAndroidManifest.xml.meta rename to Assets/Adjust/Native/Android/AdjustAndroidManifest.xml.meta diff --git a/Assets/Adjust/Native/Editor.meta b/Assets/Adjust/Native/Editor.meta new file mode 100644 index 00000000..c29b1d4c --- /dev/null +++ b/Assets/Adjust/Native/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c11a8a7fc7bfd4937bac95b31f1fb273 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/Native/Editor/Dependencies.xml b/Assets/Adjust/Native/Editor/Dependencies.xml new file mode 100644 index 00000000..34a8abe1 --- /dev/null +++ b/Assets/Adjust/Native/Editor/Dependencies.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assets/Adjust/Native/Editor/Dependencies.xml.meta b/Assets/Adjust/Native/Editor/Dependencies.xml.meta new file mode 100644 index 00000000..1574ab1f --- /dev/null +++ b/Assets/Adjust/Native/Editor/Dependencies.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d4241857b233d46ee874c8f80bb65fdb +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/Native/iOS.meta b/Assets/Adjust/Native/iOS.meta new file mode 100644 index 00000000..9d5773ab --- /dev/null +++ b/Assets/Adjust/Native/iOS.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c8400ff077d6c4583b0f85a46cd1d50b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/Native/iOS/AdjustUnity.h b/Assets/Adjust/Native/iOS/AdjustUnity.h new file mode 100644 index 00000000..c1c70408 --- /dev/null +++ b/Assets/Adjust/Native/iOS/AdjustUnity.h @@ -0,0 +1,37 @@ +// +// AdjustUnity.h +// Adjust SDK +// +// Created by Pedro Silva (@nonelse) on 27th March 2014. +// Copyright © 2012-2018 Adjust GmbH. All rights reserved. +// + +/** + * @brief The main interface to Adjust Unity bridge. + */ +@interface AdjustUnity : NSObject + +// app callbacks as method parameters +typedef void (*AdjustDelegateIsEnabledGetter)(bool isEnabled); +typedef void (*AdjustDelegateAttributionGetter)(const char* attribution); +typedef void (*AdjustDelegateAdidGetter)(const char* adid); +typedef void (*AdjustDelegateIdfaGetter)(const char* idfa); +typedef void (*AdjustDelegateIdfvGetter)(const char* idfv); +typedef void (*AdjustDelegateLastDeeplinkGetter)(const char* lastDeeplink); +typedef void (*AdjustDelegateSdkVersionGetter)(const char* sdkVersion); +typedef void (*AdjustDelegateAttCallback)(int status); +typedef void (*AdjustDelegatePurchaseVerificationCallback)(const char* verificationResult); +typedef void (*AdjustDelegateVerifyAndTrackCallback)(const char* verificationResult); +typedef void (*AdjustDelegateResolvedDeeplinkCallback)(const char* deeplink); +typedef void (*AdjustDelegateSkanErrorCallback)(const char* error); + +// app callbacks as subscriptions +typedef void (*AdjustDelegateAttributionCallback)(const char* attribution); +typedef void (*AdjustDelegateSessionSuccessCallback)(const char* sessionSuccess); +typedef void (*AdjustDelegateSessionFailureCallback)(const char* sessionFailure); +typedef void (*AdjustDelegateEventSuccessCallback)(const char* eventSuccess); +typedef void (*AdjustDelegateEventFailureCallback)(const char* eventFailure); +typedef void (*AdjustDelegateDeferredDeeplinkCallback)(const char* deeplink); +typedef void (*AdjustDelegateSkanUpdatedCallback)(const char* skanData); + +@end diff --git a/Assets/Adjust/Windows/Test/TestLibrary.dll.meta b/Assets/Adjust/Native/iOS/AdjustUnity.h.meta similarity index 90% rename from Assets/Adjust/Windows/Test/TestLibrary.dll.meta rename to Assets/Adjust/Native/iOS/AdjustUnity.h.meta index 0ebf459e..0d8a5668 100644 --- a/Assets/Adjust/Windows/Test/TestLibrary.dll.meta +++ b/Assets/Adjust/Native/iOS/AdjustUnity.h.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1f651b59f6d7dbf4a97f2aa0ce03778d +guid: 9ffff8839c6ab418b983add4c597fb87 PluginImporter: externalObjects: {} serializedVersion: 2 @@ -22,7 +22,7 @@ PluginImporter: Exclude WebGL: 1 Exclude Win: 1 Exclude Win64: 1 - Exclude iOS: 1 + Exclude iOS: 0 Exclude tvOS: 1 - first: Android: Android @@ -91,16 +91,10 @@ PluginImporter: enabled: 0 settings: CPU: None - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - first: iPhone: iOS second: - enabled: 0 + enabled: 1 settings: CompileFlags: FrameworkDependencies: diff --git a/Assets/Adjust/Native/iOS/AdjustUnity.mm b/Assets/Adjust/Native/iOS/AdjustUnity.mm new file mode 100644 index 00000000..aebcaac7 --- /dev/null +++ b/Assets/Adjust/Native/iOS/AdjustUnity.mm @@ -0,0 +1,875 @@ +// +// AdjustUnity.mm +// Adjust SDK +// +// Created by Pedro Silva (@nonelse) on 27th March 2014. +// Copyright © 2012-2018 Adjust GmbH. All rights reserved. +// + +#import +#import "AdjustUnity.h" +#import "AdjustUnityDelegate.h" +#import "AdjustUnityAppDelegate.h" + +@implementation AdjustUnity + +#pragma mark - Object lifecycle methods + ++ (void)load { + // swizzle AppDelegate on the load + // it should be done as early as possible + [AdjustUnityAppDelegate swizzleAppDelegateCallbacks]; +} + +@end + +#pragma mark - Helper C methods + +// method for converting JSON stirng parameters into NSArray object +NSArray* convertArrayParameters(const char* cStringJsonArrayParameters) { + if (cStringJsonArrayParameters == NULL) { + return nil; + } + + NSError *error = nil; + NSArray *arrayParameters = nil; + NSString *stringJsonArrayParameters = [NSString stringWithUTF8String:cStringJsonArrayParameters]; + + if (stringJsonArrayParameters != nil) { + NSData *dataJson = [stringJsonArrayParameters dataUsingEncoding:NSUTF8StringEncoding]; + arrayParameters = [NSJSONSerialization JSONObjectWithData:dataJson options:0 error:&error]; + } + if (error != nil) { + NSString *errorMessage = @"Failed to parse json parameters!"; + NSLog(@"%@", errorMessage); + } + + 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; +} + +void addValueOrEmpty(NSMutableDictionary *dictionary, NSString *key, NSObject *value) { + if (nil != value) { + if ([value isKindOfClass:[NSString class]]) { + [dictionary setObject:[NSString stringWithFormat:@"%@", value] forKey:key]; + } else if ([value isKindOfClass:[NSNumber class]]) { + [dictionary setObject:[NSString stringWithFormat:@"%@", [((NSNumber *)value) stringValue]] forKey:key]; + } else { + [dictionary setObject:@"" forKey:key]; + } + } else { + [dictionary setObject:@"" forKey:key]; + } +} + +#pragma mark - Publicly available C methods + +extern "C" +{ + void _AdjustInitSdk( + const char* appToken, + const char* environment, + const char* sdkPrefix, + const char* defaultTracker, + const char* externalDeviceId, + const char* jsonUrlStrategyDomains, + int allowSuppressLogLevel, + int logLevel, + int attConsentWaitingInterval, + int eventDeduplicationIdsMaxSize, + int shouldUseSubdomains, + int isCoppaComplianceEnabled, + int isDataResidency, + int isSendingInBackgroundEnabled, + int isAdServicesEnabled, + int isIdfaReadingEnabled, + int isSkanAttributionEnabled, + int isLinkMeEnabled, + int isCostDataInAttributionEnabled, + int isDeviceIdsReadingOnceEnabled, + int isDeferredDeeplinkOpeningEnabled, + AdjustDelegateAttributionCallback attributionCallback, + AdjustDelegateEventSuccessCallback eventSuccessCallback, + AdjustDelegateEventFailureCallback eventFailureCallback, + AdjustDelegateSessionSuccessCallback sessionSuccessCallback, + AdjustDelegateSessionFailureCallback sessionFailureCallback, + AdjustDelegateDeferredDeeplinkCallback deferredDeeplinkCallback, + AdjustDelegateSkanUpdatedCallback skanUpdatedCallback) { + NSString *strAppToken = isStringValid(appToken) == true ? [NSString stringWithUTF8String:appToken] : nil; + NSString *strEnvironment = isStringValid(environment) == true ? [NSString stringWithUTF8String:environment] : nil; + NSString *strSdkPrefix = isStringValid(sdkPrefix) == true ? [NSString stringWithUTF8String:sdkPrefix] : nil; + NSString *strDefaultTracker = isStringValid(defaultTracker) == true ? [NSString stringWithUTF8String:defaultTracker] : nil; + NSString *strExternalDeviceId = isStringValid(externalDeviceId) == true ? [NSString stringWithUTF8String:externalDeviceId] : nil; + + ADJConfig *adjustConfig; + + if (allowSuppressLogLevel != -1) { + adjustConfig = [[ADJConfig alloc] initWithAppToken:strAppToken + environment:strEnvironment + suppressLogLevel:(BOOL)allowSuppressLogLevel]; + } else { + adjustConfig = [[ADJConfig alloc] initWithAppToken:strAppToken + environment:strEnvironment]; + } + + // set SDK prefix + [adjustConfig setSdkPrefix:strSdkPrefix]; + + // check if user has selected to implement any of the callbacks + if (attributionCallback != nil || + sessionSuccessCallback != nil || + sessionFailureCallback != nil || + eventSuccessCallback != nil || + eventFailureCallback != nil || + deferredDeeplinkCallback != nil || + skanUpdatedCallback != nil) { + [adjustConfig setDelegate: + [AdjustUnityDelegate getInstanceWithAttributionCallback:attributionCallback + eventSuccessCallback:eventSuccessCallback + eventFailureCallback:eventFailureCallback + sessionSuccessCallback:sessionSuccessCallback + sessionFailureCallback:sessionFailureCallback + deferredDeeplinkCallback:deferredDeeplinkCallback + skanUpdatedCallback:skanUpdatedCallback + shouldLaunchDeferredDeeplink:isDeferredDeeplinkOpeningEnabled]]; + } + + // log level + if (logLevel != -1) { + [adjustConfig setLogLevel:(ADJLogLevel)logLevel]; + } + + // COPPA compliance. + if (isCoppaComplianceEnabled != -1) { + if ((BOOL)isCoppaComplianceEnabled == YES) { + [adjustConfig enableCoppaCompliance]; + } + } + + // Send in background. + if (isSendingInBackgroundEnabled != -1) { + if ((BOOL)isSendingInBackgroundEnabled == YES) { + [adjustConfig enableSendingInBackground]; + } + } + + // AdServices.framework handling + if (isAdServicesEnabled != -1) { + if ((BOOL)isAdServicesEnabled == NO) { + [adjustConfig disableAdServices]; + } + } + + // SKAN attribution + if (isSkanAttributionEnabled != -1) { + if ((BOOL)isSkanAttributionEnabled == NO) { + [adjustConfig disableSkanAttribution]; + } + } + + // IDFA reading + if (isIdfaReadingEnabled != -1) { + if ((BOOL)isIdfaReadingEnabled == NO) { + [adjustConfig disableIdfaReading]; + } + } + + // LinkMe + if (isLinkMeEnabled != -1) { + if ((BOOL)isLinkMeEnabled == YES) { + [adjustConfig enableLinkMe]; + } + } + + // ATT dialog delay + if (attConsentWaitingInterval != -1) { + [adjustConfig setAttConsentWaitingInterval:attConsentWaitingInterval]; + } + + // deduplication IDs max number + if (eventDeduplicationIdsMaxSize != -1) { + [adjustConfig setEventDeduplicationIdsMaxSize:eventDeduplicationIdsMaxSize]; + } + + // cost data in attribution callback + if (isCostDataInAttributionEnabled != -1) { + if ((BOOL)isCostDataInAttributionEnabled == YES) { + [adjustConfig enableCostDataInAttribution]; + } + } + + // read device info only once + if (isDeviceIdsReadingOnceEnabled != -1) { + if ((BOOL)isDeviceIdsReadingOnceEnabled == YES) { + [adjustConfig enableDeviceIdsReadingOnce]; + } + } + + // default tracker + if (strDefaultTracker != nil) { + [adjustConfig setDefaultTracker:strDefaultTracker]; + } + + // external device identifier + if (strExternalDeviceId != nil) { + [adjustConfig setExternalDeviceId:strExternalDeviceId]; + } + + // URL strategy + if (shouldUseSubdomains != -1 && isDataResidency != -1) { + NSArray *urlStrategyDomains = convertArrayParameters(jsonUrlStrategyDomains); + if (urlStrategyDomains != nil) { + [adjustConfig setUrlStrategy:urlStrategyDomains + useSubdomains:(BOOL)shouldUseSubdomains + isDataResidency:(BOOL)isDataResidency]; + } + } + + // initialize the SDK + [Adjust initSdk:adjustConfig]; + } + + void _AdjustTrackEvent(const char* eventToken, + double revenue, + const char* currency, + const char* productId, + const char* transactionId, + const char* callbackId, + const char* deduplicationId, + const char* jsonCallbackParameters, + const char* jsonPartnerParameters) { + NSString *strEventToken = isStringValid(eventToken) == true ? [NSString stringWithUTF8String:eventToken] : nil; + ADJEvent *event = [[ADJEvent alloc] initWithEventToken:strEventToken]; + + // revenue and currency + if (revenue != -1 && currency != NULL) { + NSString *stringCurrency = [NSString stringWithUTF8String:currency]; + [event setRevenue:revenue currency:stringCurrency]; + } + + // callback parameters + NSArray *arrayCallbackParameters = convertArrayParameters(jsonCallbackParameters); + if (arrayCallbackParameters != nil) { + NSUInteger count = [arrayCallbackParameters count]; + for (int i = 0; i < count;) { + NSString *key = arrayCallbackParameters[i++]; + NSString *value = arrayCallbackParameters[i++]; + [event addCallbackParameter:key value:value]; + } + } + + // partner parameters + NSArray *arrayPartnerParameters = convertArrayParameters(jsonPartnerParameters); + if (arrayPartnerParameters != nil) { + NSUInteger count = [arrayPartnerParameters count]; + for (int i = 0; i < count;) { + NSString *key = arrayPartnerParameters[i++]; + NSString *value = arrayPartnerParameters[i++]; + [event addPartnerParameter:key value:value]; + } + } + + // transaction ID + if (transactionId != NULL) { + NSString *strTransactionId = [NSString stringWithUTF8String:transactionId]; + [event setTransactionId:strTransactionId]; + } + + // product ID + if (productId != NULL) { + NSString *strProductId = [NSString stringWithUTF8String:productId]; + [event setProductId:strProductId]; + } + + // callback ID + if (callbackId != NULL) { + NSString *strCallbackId = [NSString stringWithUTF8String:callbackId]; + [event setCallbackId:strCallbackId]; + } + + // deduplication ID + if (deduplicationId != NULL) { + NSString *strDeduplicationId = [NSString stringWithUTF8String:deduplicationId]; + [event setDeduplicationId:strDeduplicationId]; + } + + // track event + [Adjust trackEvent:event]; + } + + void _AdjustTrackSubsessionStart() { + [Adjust trackSubsessionStart]; + } + + void _AdjustTrackSubsessionEnd() { + [Adjust trackSubsessionEnd]; + } + + void _AdjustEnable() { + [Adjust enable]; + } + + void _AdjustDisable() { + [Adjust disable]; + } + + void _AdjustSwitchToOfflineMode() { + [Adjust switchToOfflineMode]; + } + + void _AdjustSwitchBackToOnlineMode() { + [Adjust switchBackToOnlineMode]; + } + + void _AdjustSetPushToken(const char* pushToken) { + if (pushToken != NULL) { + NSString *strPushToken = [NSString stringWithUTF8String:pushToken]; + [Adjust setPushTokenAsString:strPushToken]; + } + } + + void _AdjustProcessDeeplink(const char* deeplink) { + if (deeplink != NULL) { + NSString *strDeeplink = [NSString stringWithUTF8String:deeplink]; + NSURL *urlDeeplink; + if ([NSString instancesRespondToSelector:@selector(stringByAddingPercentEncodingWithAllowedCharacters:)]) { + urlDeeplink = [NSURL URLWithString:[strDeeplink stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]]; + } else { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + urlDeeplink = [NSURL URLWithString:[strDeeplink stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; + } +#pragma clang diagnostic pop + + ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:urlDeeplink]; + [Adjust processDeeplink:deeplink]; + } + } + + void _AdjustIsEnabled(AdjustDelegateIsEnabledGetter callback) { + [Adjust isEnabledWithCompletionHandler:^(BOOL isEnabled) { + callback(isEnabled); + }]; + } + + void _AdjustGetAttribution(AdjustDelegateAttributionGetter callback) { + [Adjust attributionWithCompletionHandler:^(ADJAttribution * _Nullable attribution) { + // TODO: nil checks + NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; + addValueOrEmpty(dictionary, @"trackerToken", attribution.trackerToken); + addValueOrEmpty(dictionary, @"trackerName", attribution.trackerName); + addValueOrEmpty(dictionary, @"network", attribution.network); + addValueOrEmpty(dictionary, @"campaign", attribution.campaign); + addValueOrEmpty(dictionary, @"creative", attribution.creative); + addValueOrEmpty(dictionary, @"adgroup", attribution.adgroup); + addValueOrEmpty(dictionary, @"clickLabel", attribution.clickLabel); + addValueOrEmpty(dictionary, @"costType", attribution.costType); + addValueOrEmpty(dictionary, @"costAmount", attribution.costAmount); + addValueOrEmpty(dictionary, @"costCurrency", attribution.costCurrency); + NSData *dataAttribution = [NSJSONSerialization dataWithJSONObject:dictionary + options:0 + error:nil]; + NSString *stringAttribution = [[NSString alloc] initWithBytes:[dataAttribution bytes] + length:[dataAttribution length] + encoding:NSUTF8StringEncoding]; + const char* attributionCString = [stringAttribution UTF8String]; + callback(attributionCString); + }]; + } + + void _AdjustGetAdid(AdjustDelegateAdidGetter callback) { + [Adjust adidWithCompletionHandler:^(NSString * _Nullable adid) { + // TODO: nil checks + callback([adid UTF8String]); + }]; + } + + void _AdjustGetIdfa(AdjustDelegateIdfaGetter callback) { + [Adjust idfaWithCompletionHandler:^(NSString * _Nullable idfa) { + // TODO: nil checks + callback([idfa UTF8String]); + }]; + } + + void _AdjustGetIdfv(AdjustDelegateIdfvGetter callback) { + [Adjust idfvWithCompletionHandler:^(NSString * _Nullable idfv) { + // TODO: nil checks + callback([idfv UTF8String]); + }]; + } + + void _AdjustGetLastDeeplink(AdjustDelegateLastDeeplinkGetter callback) { + [Adjust lastDeeplinkWithCompletionHandler:^(NSURL * _Nullable lastDeeplink) { + // TODO: nil checks + NSString *strLastDeeplink = [lastDeeplink absoluteString]; + callback([strLastDeeplink UTF8String]); + }]; + } + + void _AdjustGetSdkVersion(AdjustDelegateSdkVersionGetter callback) { + [Adjust sdkVersionWithCompletionHandler:^(NSString * _Nullable sdkVersion) { + // TODO: nil checks + callback([sdkVersion UTF8String]); + }]; + } + + void _AdjustGdprForgetMe() { + [Adjust gdprForgetMe]; + } + + void _AdjustAddGlobalPartnerParameter(const char* key, const char* value) { + if (key != NULL && value != NULL) { + NSString *strKey = [NSString stringWithUTF8String:key]; + NSString *strValue = [NSString stringWithUTF8String:value]; + [Adjust addGlobalPartnerParameter:strValue forKey:strKey]; + } + } + + void _AdjustAddGlobalCallbackParameter(const char* key, const char* value) { + if (key != NULL && value != NULL) { + NSString *strKey = [NSString stringWithUTF8String:key]; + NSString *strValue = [NSString stringWithUTF8String:value]; + [Adjust addGlobalCallbackParameter:strValue forKey:strKey]; + } + } + + void _AdjustRemoveGlobalPartnerParameter(const char* key) { + if (key != NULL) { + NSString *strKey = [NSString stringWithUTF8String:key]; + [Adjust removeGlobalPartnerParameterForKey:strKey]; + } + } + + void _AdjustRemoveGlobalCallbackParameter(const char* key) { + if (key != NULL) { + NSString *strKey = [NSString stringWithUTF8String:key]; + [Adjust removeGlobalCallbackParameterForKey:strKey]; + } + } + + void _AdjustRemoveGlobalPartnerParameters() { + [Adjust removeGlobalPartnerParameters]; + } + + void _AdjustRemoveGlobalCallbackParameters() { + [Adjust removeGlobalCallbackParameters]; + } + + void _AdjustTrackAdRevenue(const char* source, + double revenue, + const char* currency, + int adImpressionsCount, + const char* adRevenueNetwork, + const char* adRevenueUnit, + const char* adRevenuePlacement, + const char* jsonCallbackParameters, + const char* jsonPartnerParameters) { + NSString *stringSource = isStringValid(source) == true ? [NSString stringWithUTF8String:source] : nil; + ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:stringSource]; + + // revenue and currency + if (revenue != -1 && currency != NULL) { + NSString *stringCurrency = [NSString stringWithUTF8String:currency]; + [adRevenue setRevenue:revenue currency:stringCurrency]; + } + + // ad impressions count + if (adImpressionsCount != -1) { + [adRevenue setAdImpressionsCount:adImpressionsCount]; + } + + // ad revenue network + if (adRevenueNetwork != NULL) { + NSString *stringAdRevenueNetwork = [NSString stringWithUTF8String:adRevenueNetwork]; + [adRevenue setAdRevenueNetwork:stringAdRevenueNetwork]; + } + + // ad revenue unit + if (adRevenueUnit != NULL) { + NSString *stringAdRevenueUnit = [NSString stringWithUTF8String:adRevenueUnit]; + [adRevenue setAdRevenueUnit:stringAdRevenueUnit]; + } + + // ad revenue placement + if (adRevenuePlacement != NULL) { + NSString *stringAdRevenuePlacement = [NSString stringWithUTF8String:adRevenuePlacement]; + [adRevenue setAdRevenuePlacement:stringAdRevenuePlacement]; + } + + // callback parameters + NSArray *arrayCallbackParameters = convertArrayParameters(jsonCallbackParameters); + if (arrayCallbackParameters != nil) { + NSUInteger count = [arrayCallbackParameters count]; + for (int i = 0; i < count;) { + NSString *key = arrayCallbackParameters[i++]; + NSString *value = arrayCallbackParameters[i++]; + [adRevenue addCallbackParameter:key value:value]; + } + } + + // partner parameters + NSArray *arrayPartnerParameters = convertArrayParameters(jsonPartnerParameters); + if (arrayPartnerParameters != nil) { + NSUInteger count = [arrayPartnerParameters count]; + for (int i = 0; i < count;) { + NSString *key = arrayPartnerParameters[i++]; + NSString *value = arrayPartnerParameters[i++]; + [adRevenue addPartnerParameter:key value:value]; + } + } + + // track ad revenue + [Adjust trackAdRevenue:adRevenue]; + } + + // TODO: consider non-string types for some fields? + void _AdjustTrackAppStoreSubscription(const char* price, + const char* currency, + const char* transactionId, + const char* transactionDate, + const char* salesRegion, + const char* jsonCallbackParameters, + const char* jsonPartnerParameters) { + // mandatory fields + NSDecimalNumber *mPrice; + NSString *mCurrency; + NSString *mTransactionId; + + // price + if (price != NULL) { + mPrice = [NSDecimalNumber decimalNumberWithString:[NSString stringWithUTF8String:price]]; + } + + // currency + if (currency != NULL) { + mCurrency = [NSString stringWithUTF8String:currency]; + } + + // transaction ID + if (transactionId != NULL) { + mTransactionId = [NSString stringWithUTF8String:transactionId]; + } + + ADJAppStoreSubscription *subscription = + [[ADJAppStoreSubscription alloc] initWithPrice:mPrice + currency:mCurrency + transactionId:mTransactionId]; + + // optional fields below + + // transaction date + if (transactionDate != NULL) { + NSTimeInterval transactionDateInterval = [[NSString stringWithUTF8String:transactionDate] doubleValue] / 1000.0; + NSDate *oTransactionDate = [NSDate dateWithTimeIntervalSince1970:transactionDateInterval]; + [subscription setTransactionDate:oTransactionDate]; + } + + // sales region + if (salesRegion != NULL) { + NSString *oSalesRegion = [NSString stringWithUTF8String:salesRegion]; + [subscription setSalesRegion:oSalesRegion]; + } + + // callback parameters + NSArray *arrayCallbackParameters = convertArrayParameters(jsonCallbackParameters); + if (arrayCallbackParameters != nil) { + NSUInteger count = [arrayCallbackParameters count]; + for (int i = 0; i < count;) { + NSString *key = arrayCallbackParameters[i++]; + NSString *value = arrayCallbackParameters[i++]; + [subscription addCallbackParameter:key value:value]; + } + } + + // partner parameters + NSArray *arrayPartnerParameters = convertArrayParameters(jsonPartnerParameters); + if (arrayPartnerParameters != nil) { + NSUInteger count = [arrayPartnerParameters count]; + for (int i = 0; i < count;) { + NSString *key = arrayPartnerParameters[i++]; + NSString *value = arrayPartnerParameters[i++]; + [subscription addPartnerParameter:key value:value]; + } + } + + // track subscription + [Adjust trackAppStoreSubscription:subscription]; + } + + void _AdjustTrackThirdPartySharing(int enabled, const char* jsonGranularOptions, const char* jsonPartnerSharingSettings) { + NSNumber *nEnabled = enabled >= 0 ? [NSNumber numberWithInt:enabled] : nil; + ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabled:nEnabled]; + + NSArray *arrayGranularOptions = convertArrayParameters(jsonGranularOptions); + if (arrayGranularOptions != nil) { + for (int i = 0; i < [arrayGranularOptions count];) { + NSString *partnerName = arrayGranularOptions[i++]; + NSString *key = arrayGranularOptions[i++]; + NSString *value = arrayGranularOptions[i++]; + [adjustThirdPartySharing addGranularOption:partnerName + key:key + value:value]; + } + } + + NSArray *arrayPartnerSharingSettings = convertArrayParameters(jsonPartnerSharingSettings); + if (arrayPartnerSharingSettings != nil) { + for (int i = 0; i < [arrayPartnerSharingSettings count];) { + NSString *partnerName = arrayPartnerSharingSettings[i++]; + NSString *key = arrayPartnerSharingSettings[i++]; + NSString *value = arrayPartnerSharingSettings[i++]; + [adjustThirdPartySharing addPartnerSharingSetting:partnerName + key:key + value:[value boolValue]]; + } + } + + [Adjust trackThirdPartySharing:adjustThirdPartySharing]; + } + + void _AdjustTrackMeasurementConsent(int enabled) { + BOOL bEnabled = (BOOL)enabled; + [Adjust trackMeasurementConsent:bEnabled]; + } + + void _AdjustRequestAppTrackingAuthorization(AdjustDelegateAttCallback callback) { + [Adjust requestAppTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) { + callback((int)status); + }]; + } + + void _AdjustUpdateSkanConversionValue(int conversionValue, + const char* coarseValue, + int lockWindow, + AdjustDelegateSkanErrorCallback callback) { + if (coarseValue != NULL) { + NSString *strCoarseValue = [NSString stringWithUTF8String:coarseValue]; + BOOL bLockWindow = (BOOL)lockWindow; + [Adjust updateSkanConversionValue:conversionValue + coarseValue:strCoarseValue + lockWindow:[NSNumber numberWithBool:bLockWindow] + withCompletionHandler:^(NSError * _Nullable error) { + // TODO: nil checks + NSString *errorString = [error localizedDescription]; + const char* errorChar = [errorString UTF8String]; + callback(errorChar); + }]; + } + } + + int _AdjustGetAppTrackingAuthorizationStatus() { + return [Adjust appTrackingAuthorizationStatus]; + } + + void _AdjustVerifyAppStorePurchase(const char* transactionId, + const char* productId, + AdjustDelegatePurchaseVerificationCallback callback) { + NSString *strTransactionId; + NSString *strProductId; + + // transaction ID + if (transactionId != NULL) { + strTransactionId = [NSString stringWithUTF8String:transactionId]; + } + + // product ID + if (productId != NULL) { + strProductId = [NSString stringWithUTF8String:productId]; + } + + // verify the purchase + ADJAppStorePurchase *purchase = + [[ADJAppStorePurchase alloc] initWithTransactionId:strTransactionId + productId:strProductId]; + + [Adjust verifyAppStorePurchase:purchase + withCompletionHandler:^(ADJPurchaseVerificationResult * _Nonnull verificationResult) { + // TODO: nil checks + NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; + addValueOrEmpty(dictionary, @"verificationStatus", verificationResult.verificationStatus); + addValueOrEmpty(dictionary, @"code", [NSString stringWithFormat:@"%d", verificationResult.code]); + addValueOrEmpty(dictionary, @"message", verificationResult.message); + + NSData *dataVerificationInfo = [NSJSONSerialization dataWithJSONObject:dictionary + options:0 + error:nil]; + NSString *strVerificationInfo = [[NSString alloc] initWithBytes:[dataVerificationInfo bytes] + length:[dataVerificationInfo length] + encoding:NSUTF8StringEncoding]; + const char* verificationInfoCString = [strVerificationInfo UTF8String]; + callback(verificationInfoCString); + }]; + } + + void _AdjustProcessAndResolveDeeplink(const char* deeplink, AdjustDelegateResolvedDeeplinkCallback callback) { + if (deeplink != NULL) { + NSString *strDeeplink = [NSString stringWithUTF8String:deeplink]; + NSURL *urlDeeplink; + if ([NSString instancesRespondToSelector:@selector(stringByAddingPercentEncodingWithAllowedCharacters:)]) { + urlDeeplink = [NSURL URLWithString:[strDeeplink stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]]; + } else { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + urlDeeplink = [NSURL URLWithString:[strDeeplink stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; + } +#pragma clang diagnostic pop + + ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:urlDeeplink]; + [Adjust processAndResolveDeeplink:deeplink withCompletionHandler:^(NSString * _Nullable resolvedLink) { + // TODO: nil checks + const char* resolvedLinkCString = [resolvedLink UTF8String]; + callback(resolvedLinkCString); + }]; + } + } + + void _AdjustVerifyAndTrackAppStorePurchase( + const char* eventToken, + double revenue, + const char* currency, + const char* productId, + const char* transactionId, + const char* callbackId, + const char* deduplicationId, + const char* jsonCallbackParameters, + const char* jsonPartnerParameters, + AdjustDelegateVerifyAndTrackCallback callback) { + NSString *strEventToken = isStringValid(eventToken) == true ? [NSString stringWithUTF8String:eventToken] : nil; + ADJEvent *event = [[ADJEvent alloc] initWithEventToken:strEventToken]; + + // revenue and currency + if (revenue != -1 && currency != NULL) { + NSString *stringCurrency = [NSString stringWithUTF8String:currency]; + [event setRevenue:revenue currency:stringCurrency]; + } + + // callback parameters + NSArray *arrayCallbackParameters = convertArrayParameters(jsonCallbackParameters); + if (arrayCallbackParameters != nil) { + NSUInteger count = [arrayCallbackParameters count]; + for (int i = 0; i < count;) { + NSString *key = arrayCallbackParameters[i++]; + NSString *value = arrayCallbackParameters[i++]; + [event addCallbackParameter:key value:value]; + } + } + + // partner parameters + NSArray *arrayPartnerParameters = convertArrayParameters(jsonPartnerParameters); + if (arrayPartnerParameters != nil) { + NSUInteger count = [arrayPartnerParameters count]; + for (int i = 0; i < count;) { + NSString *key = arrayPartnerParameters[i++]; + NSString *value = arrayPartnerParameters[i++]; + [event addPartnerParameter:key value:value]; + } + } + + // transaction ID + if (transactionId != NULL) { + NSString *strTransactionId = [NSString stringWithUTF8String:transactionId]; + [event setTransactionId:strTransactionId]; + } + + // product ID + if (productId != NULL) { + NSString *strProductId = [NSString stringWithUTF8String:productId]; + [event setProductId:strProductId]; + } + + // callback ID + if (callbackId != NULL) { + NSString *strCallbackId = [NSString stringWithUTF8String:callbackId]; + [event setCallbackId:strCallbackId]; + } + + // deduplication ID + if (deduplicationId != NULL) { + NSString *strDeduplicationId = [NSString stringWithUTF8String:deduplicationId]; + [event setDeduplicationId:strDeduplicationId]; + } + + [Adjust verifyAndTrackAppStorePurchase:event + withCompletionHandler:^(ADJPurchaseVerificationResult * _Nonnull verificationResult) { + // TODO: nil checks + NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; + addValueOrEmpty(dictionary, @"verificationStatus", verificationResult.verificationStatus); + addValueOrEmpty(dictionary, @"code", [NSString stringWithFormat:@"%d", verificationResult.code]); + addValueOrEmpty(dictionary, @"message", verificationResult.message); + + NSData *dataVerificationInfo = [NSJSONSerialization dataWithJSONObject:dictionary + options:0 + error:nil]; + NSString *strVerificationInfo = [[NSString alloc] initWithBytes:[dataVerificationInfo bytes] + length:[dataVerificationInfo length] + encoding:NSUTF8StringEncoding]; + const char* verificationInfoCString = [strVerificationInfo UTF8String]; + callback(verificationInfoCString); + }]; + } + + void _AdjustSetTestOptions(const char* overwriteUrl, + const char* extraPath, + long timerIntervalInMilliseconds, + long timerStartInMilliseconds, + long sessionIntervalInMilliseconds, + long subsessionIntervalInMilliseconds, + int teardown, + int deleteState, + int noBackoffWait, + int adServicesFrameworkEnabled, + int attStatus, + const char *idfa) { + NSMutableDictionary *testOptions = [NSMutableDictionary dictionary]; + + NSString *strOverwriteUrl = isStringValid(overwriteUrl) == true ? [NSString stringWithUTF8String:overwriteUrl] : nil; + if (strOverwriteUrl != nil) { + testOptions[@"testUrlOverwrite"] = strOverwriteUrl; + } + NSString *strExtraPath = isStringValid(extraPath) == true ? [NSString stringWithUTF8String:extraPath] : nil; + if (strExtraPath != nil && [strExtraPath length] > 0) { + testOptions[@"extraPath"] = strExtraPath; + } + NSString *strIdfa = isStringValid(idfa) == true ? [NSString stringWithUTF8String:idfa] : nil; + if (strIdfa != nil && [strIdfa length] > 0) { + testOptions[@"idfa"] = strIdfa; + } + + testOptions[@"timerIntervalInMilliseconds"] = [NSNumber numberWithLong:timerIntervalInMilliseconds]; + testOptions[@"timerStartInMilliseconds"] = [NSNumber numberWithLong:timerStartInMilliseconds]; + testOptions[@"sessionIntervalInMilliseconds"] = [NSNumber numberWithLong:sessionIntervalInMilliseconds]; + testOptions[@"subsessionIntervalInMilliseconds"] = [NSNumber numberWithLong:subsessionIntervalInMilliseconds]; + testOptions[@"attStatusInt"] = [NSNumber numberWithInt:attStatus]; + + if (teardown != -1) { + [AdjustUnityDelegate teardown]; + testOptions[@"teardown"] = [NSNumber numberWithInt:teardown]; + } + if (deleteState != -1) { + testOptions[@"deleteState"] = [NSNumber numberWithInt:deleteState]; + } + if (noBackoffWait != -1) { + testOptions[@"noBackoffWait"] = [NSNumber numberWithInt:noBackoffWait]; + } + if (adServicesFrameworkEnabled != -1) { + testOptions[@"adServicesFrameworkEnabled"] = [NSNumber numberWithInt:adServicesFrameworkEnabled]; + } + + [Adjust setTestOptions:testOptions]; + } +} diff --git a/Assets/Adjust/Windows/Stubs/WinWsInterface.dll.meta b/Assets/Adjust/Native/iOS/AdjustUnity.mm.meta similarity index 86% rename from Assets/Adjust/Windows/Stubs/WinWsInterface.dll.meta rename to Assets/Adjust/Native/iOS/AdjustUnity.mm.meta index c9c268b9..4651ffe8 100644 --- a/Assets/Adjust/Windows/Stubs/WinWsInterface.dll.meta +++ b/Assets/Adjust/Native/iOS/AdjustUnity.mm.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 28d42f4475bd4c9498aea78c129a80b7 +guid: 3e17e20d987e4449489d9e3accbd8602 PluginImporter: externalObjects: {} serializedVersion: 2 @@ -14,7 +14,7 @@ PluginImporter: enabled: 0 settings: Exclude Android: 1 - Exclude Editor: 0 + Exclude Editor: 1 Exclude Linux: 1 Exclude Linux64: 1 Exclude LinuxUniversal: 1 @@ -24,8 +24,7 @@ PluginImporter: Exclude WebGL: 1 Exclude Win: 1 Exclude Win64: 1 - Exclude WindowsStoreApps: 1 - Exclude iOS: 1 + Exclude iOS: 0 Exclude tvOS: 1 - first: '': Editor @@ -48,7 +47,7 @@ PluginImporter: - first: Editor: Editor second: - enabled: 1 + enabled: 0 settings: CPU: AnyCPU DefaultValueInitialized: true @@ -113,20 +112,10 @@ PluginImporter: enabled: 0 settings: CPU: None - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - DontProcess: False - PlaceholderPath: - SDK: AnySDK - ScriptingBackend: AnyScriptingBackend - first: iPhone: iOS second: - enabled: 0 + enabled: 1 settings: CompileFlags: FrameworkDependencies: diff --git a/Assets/Adjust/iOS/AdjustUnityAppDelegate.h b/Assets/Adjust/Native/iOS/AdjustUnityAppDelegate.h similarity index 100% rename from Assets/Adjust/iOS/AdjustUnityAppDelegate.h rename to Assets/Adjust/Native/iOS/AdjustUnityAppDelegate.h diff --git a/Assets/Adjust/Windows/Test/TestLibraryInterface.dll.meta b/Assets/Adjust/Native/iOS/AdjustUnityAppDelegate.h.meta similarity index 92% rename from Assets/Adjust/Windows/Test/TestLibraryInterface.dll.meta rename to Assets/Adjust/Native/iOS/AdjustUnityAppDelegate.h.meta index 096fa260..e1c7c3ca 100644 --- a/Assets/Adjust/Windows/Test/TestLibraryInterface.dll.meta +++ b/Assets/Adjust/Native/iOS/AdjustUnityAppDelegate.h.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9f06be001f8466146ae1d27e29d0f275 +guid: ac4b0b80967dd499b94e6bd430ac6662 PluginImporter: externalObjects: {} serializedVersion: 2 @@ -22,7 +22,7 @@ PluginImporter: Exclude WebGL: 1 Exclude Win: 1 Exclude Win64: 1 - Exclude iOS: 1 + Exclude iOS: 0 Exclude tvOS: 1 - first: Android: Android @@ -92,15 +92,14 @@ PluginImporter: settings: CPU: None - first: - Windows Store Apps: WindowsStoreApps + WebGL: WebGL second: enabled: 0 - settings: - CPU: AnyCPU + settings: {} - first: iPhone: iOS second: - enabled: 0 + enabled: 1 settings: CompileFlags: FrameworkDependencies: diff --git a/Assets/Adjust/iOS/AdjustUnityAppDelegate.m b/Assets/Adjust/Native/iOS/AdjustUnityAppDelegate.m similarity index 97% rename from Assets/Adjust/iOS/AdjustUnityAppDelegate.m rename to Assets/Adjust/Native/iOS/AdjustUnityAppDelegate.m index 989a3b02..5a4319a2 100644 --- a/Assets/Adjust/iOS/AdjustUnityAppDelegate.m +++ b/Assets/Adjust/Native/iOS/AdjustUnityAppDelegate.m @@ -6,7 +6,7 @@ // #import -#import "Adjust.h" +#import #import "AdjustUnityAppDelegate.h" typedef BOOL (*openURL_t)(id, SEL, UIApplication *, NSURL *, NSDictionary *); @@ -56,7 +56,7 @@ + (IMP)swizzleOriginalSelector:(SEL)originalSelector - (BOOL)adjust_application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options { - [Adjust appWillOpenUrl:url]; + [Adjust processDeeplink:url]; return original_openURL ? original_openURL(self, _cmd, application, url, options) : YES; } @@ -65,7 +65,7 @@ - (BOOL)adjust_application:(UIApplication *)application restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { NSURL *url = [userActivity webpageURL]; - [Adjust appWillOpenUrl:url]; + [Adjust processDeeplink:url]; } return original_continueUserActivity ? original_continueUserActivity(self, _cmd, application, userActivity, restorationHandler) : YES; } diff --git a/Assets/Adjust/iOS/Test/ATLControlChannel.h.meta b/Assets/Adjust/Native/iOS/AdjustUnityAppDelegate.m.meta similarity index 90% rename from Assets/Adjust/iOS/Test/ATLControlChannel.h.meta rename to Assets/Adjust/Native/iOS/AdjustUnityAppDelegate.m.meta index 4e8f9fba..a15a43ec 100644 --- a/Assets/Adjust/iOS/Test/ATLControlChannel.h.meta +++ b/Assets/Adjust/Native/iOS/AdjustUnityAppDelegate.m.meta @@ -1,15 +1,12 @@ fileFormatVersion: 2 -guid: 9e44bfcf755a745239d1590123c39975 +guid: ea1bc374f78b747f8a81fcc82cd77d96 PluginImporter: externalObjects: {} serializedVersion: 2 iconMap: {} executionOrder: {} - defineConstraints: [] isPreloaded: 0 isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 platformData: - first: '': Any @@ -22,9 +19,11 @@ PluginImporter: Exclude Linux64: 1 Exclude LinuxUniversal: 1 Exclude OSXUniversal: 1 + Exclude WebGL: 1 Exclude Win: 1 Exclude Win64: 1 Exclude iOS: 0 + Exclude tvOS: 1 - first: Any: second: @@ -89,6 +88,11 @@ PluginImporter: second: enabled: 1 settings: {} + - first: + tvOS: tvOS + second: + enabled: 0 + settings: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Adjust/Native/iOS/AdjustUnityDelegate.h b/Assets/Adjust/Native/iOS/AdjustUnityDelegate.h new file mode 100644 index 00000000..7d3a8617 --- /dev/null +++ b/Assets/Adjust/Native/iOS/AdjustUnityDelegate.h @@ -0,0 +1,60 @@ +// +// AdjustUnityDelegate.h +// Adjust SDK +// +// Created by Uglješa Erceg (@uerceg) on 5th December 2016. +// Copyright © 2012-Present Adjust GmbH. All rights reserved. +// + +#import +#import "AdjustUnity.h" + +/** + * @brief The main interface to Adjust Unity delegate. Used to do callback methods swizzling where needed. + */ +@interface AdjustUnityDelegate : NSObject + +/** + * @brief Boolean indicating whether deferred deep link should be launched by SDK or not. + */ +@property (nonatomic) BOOL shouldLaunchDeferredDeeplink; + +@property (nonatomic) AdjustDelegateAttributionCallback attributionCallback; +@property (nonatomic) AdjustDelegateEventSuccessCallback eventSuccessCallback; +@property (nonatomic) AdjustDelegateEventFailureCallback eventFailureCallback; +@property (nonatomic) AdjustDelegateSessionSuccessCallback sessionSuccessCallback; +@property (nonatomic) AdjustDelegateSessionFailureCallback sessionFailureCallback; +@property (nonatomic) AdjustDelegateDeferredDeeplinkCallback deferredDeeplinkCallback; +@property (nonatomic) AdjustDelegateSkanUpdatedCallback skanUpdatedCallback; + +/** + * @brief Get instance of the AdjustUnityDelegate with properly swizzled callback methods. + * + * @param swizzleAttributionCallback Indicator whether attribution callback should be swizzled or not. + * @param swizzleEventSuccessCallback Indicator whether event success callback should be swizzled or not. + * @param swizzleEventFailureCallback Indicator whether event failure callback should be swizzled or not. + * @param swizzleSessionSuccessCallback Indicator whether session success callback should be swizzled or not. + * @param swizzleSessionFailureCallback Indicator whether session failure callback should be swizzled or not. + * @param swizzleDeferredDeeplinkCallback Indicator whether deferred deep link callback should be swizzled or not. + * @param swizzleSkanUpdatedCallback Indicator whether SKAD conversion value update callback should be swizzled or not. + * @param shouldLaunchDeferredDeeplink Indicator whether SDK should launch deferred deep link by default or not. + * @param adjustUnityGameObjectName Name of the Unity game object that loads Adjust script. + * + * @return AdjustUnityDelegate object instance with properly swizzled callback methods. + */ ++ (id)getInstanceWithAttributionCallback:(AdjustDelegateAttributionCallback)attributionCallback + eventSuccessCallback:(AdjustDelegateEventSuccessCallback)eventSuccessCallback + eventFailureCallback:(AdjustDelegateEventFailureCallback)eventFailureCallback + sessionSuccessCallback:(AdjustDelegateSessionSuccessCallback)sessionSuccessCallback + sessionFailureCallback:(AdjustDelegateSessionFailureCallback)sessionFailureCallback + deferredDeeplinkCallback:(AdjustDelegateDeferredDeeplinkCallback)deferredDeeplinkCallback + skanUpdatedCallback:(AdjustDelegateSkanUpdatedCallback)skanUpdatedCallback + shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink; + +/** + * @brief Teardown method used to reset static AdjustUnityDelegate instance. + * Used for testing purposes only. + */ ++ (void)teardown; + +@end diff --git a/Assets/Adjust/Windows/Stubs/Win81Interface.dll.meta b/Assets/Adjust/Native/iOS/AdjustUnityDelegate.h.meta similarity index 86% rename from Assets/Adjust/Windows/Stubs/Win81Interface.dll.meta rename to Assets/Adjust/Native/iOS/AdjustUnityDelegate.h.meta index b3c62563..fd52fe4b 100644 --- a/Assets/Adjust/Windows/Stubs/Win81Interface.dll.meta +++ b/Assets/Adjust/Native/iOS/AdjustUnityDelegate.h.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4a3249a2bc5a2fc4b90ec1effe1d74ce +guid: 5d2beef19c617f74fbca612cc97e3c60 PluginImporter: externalObjects: {} serializedVersion: 2 @@ -14,7 +14,7 @@ PluginImporter: enabled: 0 settings: Exclude Android: 1 - Exclude Editor: 0 + Exclude Editor: 1 Exclude Linux: 1 Exclude Linux64: 1 Exclude LinuxUniversal: 1 @@ -24,8 +24,7 @@ PluginImporter: Exclude WebGL: 1 Exclude Win: 1 Exclude Win64: 1 - Exclude WindowsStoreApps: 1 - Exclude iOS: 1 + Exclude iOS: 0 Exclude tvOS: 1 - first: '': Editor @@ -48,7 +47,7 @@ PluginImporter: - first: Editor: Editor second: - enabled: 1 + enabled: 0 settings: CPU: AnyCPU DefaultValueInitialized: true @@ -113,20 +112,10 @@ PluginImporter: enabled: 0 settings: CPU: None - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - DontProcess: False - PlaceholderPath: - SDK: AnySDK - ScriptingBackend: AnyScriptingBackend - first: iPhone: iOS second: - enabled: 0 + enabled: 1 settings: CompileFlags: FrameworkDependencies: diff --git a/Assets/Adjust/Native/iOS/AdjustUnityDelegate.mm b/Assets/Adjust/Native/iOS/AdjustUnityDelegate.mm new file mode 100644 index 00000000..beb5df44 --- /dev/null +++ b/Assets/Adjust/Native/iOS/AdjustUnityDelegate.mm @@ -0,0 +1,335 @@ +// +// AdjustUnityDelegate.mm +// Adjust SDK +// +// Created by Uglješa Erceg (@uerceg) on 5th December 2016. +// Copyright © 2012-2018 Adjust GmbH. All rights reserved. +// + +#import +#import "AdjustUnityDelegate.h" + +static dispatch_once_t onceToken; +static AdjustUnityDelegate *defaultInstance = nil; + +@implementation AdjustUnityDelegate + +#pragma mark - Object lifecycle methods + +- (id)init { + self = [super init]; + if (nil == self) { + return nil; + } + return self; +} + +#pragma mark - Public methods + ++ (id)getInstanceWithAttributionCallback:(AdjustDelegateAttributionCallback)attributionCallback + eventSuccessCallback:(AdjustDelegateEventSuccessCallback)eventSuccessCallback + eventFailureCallback:(AdjustDelegateEventFailureCallback)eventFailureCallback + sessionSuccessCallback:(AdjustDelegateSessionSuccessCallback)sessionSuccessCallback + sessionFailureCallback:(AdjustDelegateSessionFailureCallback)sessionFailureCallback + deferredDeeplinkCallback:(AdjustDelegateDeferredDeeplinkCallback)deferredDeeplinkCallback + skanUpdatedCallback:(AdjustDelegateSkanUpdatedCallback)skanUpdatedCallback + shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink { + dispatch_once(&onceToken, ^{ + defaultInstance = [[AdjustUnityDelegate alloc] init]; + + // Do the swizzling where and if needed. + if (attributionCallback != nil) { + [defaultInstance swizzleOriginalSelector:@selector(adjustAttributionChanged:) + withSelector:@selector(adjustAttributionChangedWannabe:)]; + } + if (eventSuccessCallback != nil) { + [defaultInstance swizzleOriginalSelector:@selector(adjustEventTrackingSucceeded:) + withSelector:@selector(adjustEventTrackingSucceededWannabe:)]; + } + if (eventFailureCallback != nil) { + [defaultInstance swizzleOriginalSelector:@selector(adjustEventTrackingFailed:) + withSelector:@selector(adjustEventTrackingFailedWannabe:)]; + } + if (sessionSuccessCallback != nil) { + [defaultInstance swizzleOriginalSelector:@selector(adjustSessionTrackingSucceeded:) + withSelector:@selector(adjustSessionTrackingSucceededWannabe:)]; + } + if (sessionFailureCallback != nil) { + [defaultInstance swizzleOriginalSelector:@selector(adjustSessionTrackingFailed:) + withSelector:@selector(adjustSessionTrackingFailedWannabe:)]; + } + if (deferredDeeplinkCallback != nil) { + [defaultInstance swizzleOriginalSelector:@selector(adjustDeeplinkResponse:) + withSelector:@selector(adjustDeeplinkResponseWannabe:)]; + } + if (skanUpdatedCallback != nil) { + [defaultInstance swizzleOriginalSelector:@selector(adjustSkanUpdatedWithConversionData:) + withSelector:@selector(adjustSkanUpdatedWithConversionDataWannabe:)]; + } + + [defaultInstance setAttributionCallback:attributionCallback]; + [defaultInstance setEventSuccessCallback:eventSuccessCallback]; + [defaultInstance setEventFailureCallback:eventFailureCallback]; + [defaultInstance setSessionSuccessCallback:sessionSuccessCallback]; + [defaultInstance setSessionFailureCallback:sessionFailureCallback]; + [defaultInstance setDeferredDeeplinkCallback:deferredDeeplinkCallback]; + [defaultInstance setSkanUpdatedCallback:skanUpdatedCallback]; + [defaultInstance setShouldLaunchDeferredDeeplink:shouldLaunchDeferredDeeplink]; + }); + + return defaultInstance; +} + ++ (void)teardown { + defaultInstance = nil; + onceToken = 0; +} + +#pragma mark - Private & helper methods + +- (void)adjustAttributionChangedWannabe:(ADJAttribution *)attribution { + if (attribution == nil || _attributionCallback == nil) { + return; + } + + NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; + [self addValueOrEmpty:attribution.trackerToken + forKey:@"trackerToken" + toDictionary:dictionary]; + [self addValueOrEmpty:attribution.trackerName + forKey:@"trackerName" + toDictionary:dictionary]; + [self addValueOrEmpty:attribution.network + forKey:@"network" + toDictionary:dictionary]; + [self addValueOrEmpty:attribution.campaign + forKey:@"campaign" + toDictionary:dictionary]; + [self addValueOrEmpty:attribution.creative + forKey:@"creative" + toDictionary:dictionary]; + [self addValueOrEmpty:attribution.adgroup + forKey:@"adgroup" + toDictionary:dictionary]; + [self addValueOrEmpty:attribution.clickLabel + forKey:@"clickLabel" + toDictionary:dictionary]; + [self addValueOrEmpty:attribution.costType + forKey:@"costType" + toDictionary:dictionary]; + [self addValueOrEmpty:attribution.costAmount + forKey:@"costAmount" + toDictionary:dictionary]; + [self addValueOrEmpty:attribution.costCurrency + forKey:@"costCurrency" + toDictionary:dictionary]; + + NSData *dataAttribution = [NSJSONSerialization dataWithJSONObject:dictionary + options:0 + error:nil]; + NSString *stringAttribution = [[NSString alloc] initWithBytes:[dataAttribution bytes] + length:[dataAttribution length] + encoding:NSUTF8StringEncoding]; + const char* charArrayAttribution = [stringAttribution UTF8String]; + _attributionCallback(charArrayAttribution); +} + +- (void)adjustEventTrackingSucceededWannabe:(ADJEventSuccess *)eventSuccessResponseData { + if (nil == eventSuccessResponseData || _eventSuccessCallback == nil) { + return; + } + + NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; + [self addValueOrEmpty:eventSuccessResponseData.message + forKey:@"message" + toDictionary:dictionary]; + [self addValueOrEmpty:eventSuccessResponseData.timestamp + forKey:@"timestamp" + toDictionary:dictionary]; + [self addValueOrEmpty:eventSuccessResponseData.adid + forKey:@"adid" + toDictionary:dictionary]; + [self addValueOrEmpty:eventSuccessResponseData.eventToken + forKey:@"eventToken" + toDictionary:dictionary]; + [self addValueOrEmpty:eventSuccessResponseData.callbackId + forKey:@"callbackId" + toDictionary:dictionary]; + if (eventSuccessResponseData.jsonResponse != nil) { + [dictionary setObject:eventSuccessResponseData.jsonResponse + forKey:@"jsonResponse"]; + } + + NSData *dataEventSuccess = [NSJSONSerialization dataWithJSONObject:dictionary + options:0 + error:nil]; + NSString *stringEventSuccess = [[NSString alloc] initWithBytes:[dataEventSuccess bytes] + length:[dataEventSuccess length] + encoding:NSUTF8StringEncoding]; + const char* charArrayEventSuccess = [stringEventSuccess UTF8String]; + _eventSuccessCallback(charArrayEventSuccess); +} + +- (void)adjustEventTrackingFailedWannabe:(ADJEventFailure *)eventFailureResponseData { + if (nil == eventFailureResponseData || _eventFailureCallback == nil) { + return; + } + + NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; + [self addValueOrEmpty:eventFailureResponseData.message + forKey:@"message" + toDictionary:dictionary]; + [self addValueOrEmpty:eventFailureResponseData.timestamp + forKey:@"timestamp" + toDictionary:dictionary]; + [self addValueOrEmpty:eventFailureResponseData.adid + forKey:@"adid" + toDictionary:dictionary]; + [self addValueOrEmpty:eventFailureResponseData.eventToken + forKey:@"eventToken" + toDictionary:dictionary]; + [self addValueOrEmpty:eventFailureResponseData.callbackId + forKey:@"callbackId" + toDictionary:dictionary]; + [dictionary setObject:(eventFailureResponseData.willRetry ? @"true" : @"false") + forKey:@"willRetry"]; + if (eventFailureResponseData.jsonResponse != nil) { + [dictionary setObject:eventFailureResponseData.jsonResponse + forKey:@"jsonResponse"]; + } + + NSData *dataEventFailure = [NSJSONSerialization dataWithJSONObject:dictionary + options:0 + error:nil]; + NSString *stringEventFailure = [[NSString alloc] initWithBytes:[dataEventFailure bytes] + length:[dataEventFailure length] + encoding:NSUTF8StringEncoding]; + const char* charArrayEventFailure = [stringEventFailure UTF8String]; + _eventFailureCallback(charArrayEventFailure); +} + +- (void)adjustSessionTrackingSucceededWannabe:(ADJSessionSuccess *)sessionSuccessResponseData { + if (nil == sessionSuccessResponseData || _sessionSuccessCallback == nil) { + return; + } + + NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; + [self addValueOrEmpty:sessionSuccessResponseData.message + forKey:@"message" + toDictionary:dictionary]; + [self addValueOrEmpty:sessionSuccessResponseData.timestamp + forKey:@"timestamp" + toDictionary:dictionary]; + [self addValueOrEmpty:sessionSuccessResponseData.adid + forKey:@"adid" + toDictionary:dictionary]; + if (sessionSuccessResponseData.jsonResponse != nil) { + [dictionary setObject:sessionSuccessResponseData.jsonResponse + forKey:@"jsonResponse"]; + } + + NSData *dataSessionSuccess = [NSJSONSerialization dataWithJSONObject:dictionary + options:0 + error:nil]; + NSString *stringSessionSuccess = [[NSString alloc] initWithBytes:[dataSessionSuccess bytes] + length:[dataSessionSuccess length] + encoding:NSUTF8StringEncoding]; + const char* charArraySessionSuccess = [stringSessionSuccess UTF8String]; + _sessionSuccessCallback(charArraySessionSuccess); +} + +- (void)adjustSessionTrackingFailedWannabe:(ADJSessionFailure *)sessionFailureResponseData { + if (nil == sessionFailureResponseData || _sessionFailureCallback == nil) { + return; + } + + NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; + [self addValueOrEmpty:sessionFailureResponseData.message + forKey:@"message" + toDictionary:dictionary]; + [self addValueOrEmpty:sessionFailureResponseData.timestamp + forKey:@"timestamp" + toDictionary:dictionary]; + [self addValueOrEmpty:sessionFailureResponseData.adid + forKey:@"adid" + toDictionary:dictionary]; + [dictionary setObject:(sessionFailureResponseData.willRetry ? @"true" : @"false") + forKey:@"willRetry"]; + if (sessionFailureResponseData.jsonResponse != nil) { + [dictionary setObject:sessionFailureResponseData.jsonResponse + forKey:@"jsonResponse"]; + } + + NSData *dataSessionFailure = [NSJSONSerialization dataWithJSONObject:dictionary + options:0 + error:nil]; + NSString *stringSessionFailure = [[NSString alloc] initWithBytes:[dataSessionFailure bytes] + length:[dataSessionFailure length] + encoding:NSUTF8StringEncoding]; + const char* charArraySessionFailure = [stringSessionFailure UTF8String]; + _sessionFailureCallback(charArraySessionFailure); +} + +- (BOOL)adjustDeeplinkResponseWannabe:(NSURL *)deeplink { + if (_deferredDeeplinkCallback != nil) { + NSString *stringDeeplink = [deeplink absoluteString]; + const char* charDeeplink = [stringDeeplink UTF8String]; + _deferredDeeplinkCallback(charDeeplink); + } + return _shouldLaunchDeferredDeeplink; +} + +- (void)adjustSkanUpdatedWithConversionDataWannabe:(NSDictionary *)data { + if (data == nil || _skanUpdatedCallback == nil) { + return; + } + + NSData *dataSkanUpdatedData = [NSJSONSerialization dataWithJSONObject:data + options:0 + error:nil]; + NSString *strSkanUpdatedData = [[NSString alloc] initWithBytes:[dataSkanUpdatedData bytes] + length:[dataSkanUpdatedData length] + encoding:NSUTF8StringEncoding]; + const char* charSkanUpdatedData = [strSkanUpdatedData UTF8String]; + _skanUpdatedCallback(charSkanUpdatedData); +} + +- (void)swizzleOriginalSelector:(SEL)originalSelector + withSelector:(SEL)swizzledSelector { + Class className = [self class]; + Method originalMethod = class_getInstanceMethod(className, originalSelector); + Method swizzledMethod = class_getInstanceMethod(className, swizzledSelector); + + BOOL didAddMethod = class_addMethod(className, + originalSelector, + method_getImplementation(swizzledMethod), + method_getTypeEncoding(swizzledMethod)); + if (didAddMethod) { + class_replaceMethod(className, + swizzledSelector, + method_getImplementation(originalMethod), + method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, swizzledMethod); + } +} + +- (void)addValueOrEmpty:(NSObject *)value + forKey:(NSString *)key + toDictionary:(NSMutableDictionary *)dictionary { + if (nil != value) { + if ([value isKindOfClass:[NSString class]]) { + [dictionary setObject:[NSString stringWithFormat:@"%@", value] + forKey:key]; + } else if ([value isKindOfClass:[NSNumber class]]) { + [dictionary setObject:[NSString stringWithFormat:@"%@", [((NSNumber *)value) stringValue]] + forKey:key]; + } else { + [dictionary setObject:@"" forKey:key]; + } + } else { + [dictionary setObject:@"" forKey:key]; + } +} + +@end diff --git a/Assets/Adjust/Windows/Stubs/Win10Interface.dll.meta b/Assets/Adjust/Native/iOS/AdjustUnityDelegate.mm.meta similarity index 84% rename from Assets/Adjust/Windows/Stubs/Win10Interface.dll.meta rename to Assets/Adjust/Native/iOS/AdjustUnityDelegate.mm.meta index 21ae70cf..4d65f995 100644 --- a/Assets/Adjust/Windows/Stubs/Win10Interface.dll.meta +++ b/Assets/Adjust/Native/iOS/AdjustUnityDelegate.mm.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 437f3d4f145f71f48ad0468a8cdd840a +guid: 81438eed05b2e4b489f13efc94d5476a PluginImporter: externalObjects: {} serializedVersion: 2 @@ -14,7 +14,7 @@ PluginImporter: enabled: 0 settings: Exclude Android: 1 - Exclude Editor: 0 + Exclude Editor: 1 Exclude Linux: 1 Exclude Linux64: 1 Exclude LinuxUniversal: 1 @@ -24,8 +24,7 @@ PluginImporter: Exclude WebGL: 1 Exclude Win: 1 Exclude Win64: 1 - Exclude WindowsStoreApps: 1 - Exclude iOS: 1 + Exclude iOS: 0 Exclude tvOS: 1 - first: '': Editor @@ -48,11 +47,9 @@ PluginImporter: - first: Editor: Editor second: - enabled: 1 + enabled: 0 settings: - CPU: AnyCPU DefaultValueInitialized: true - OS: AnyOS - first: Facebook: Win second: @@ -113,20 +110,10 @@ PluginImporter: enabled: 0 settings: CPU: None - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - DontProcess: False - PlaceholderPath: - SDK: AnySDK - ScriptingBackend: AnyScriptingBackend - first: iPhone: iOS second: - enabled: 0 + enabled: 1 settings: CompileFlags: FrameworkDependencies: diff --git a/Assets/Adjust/Scripts.meta b/Assets/Adjust/Scripts.meta new file mode 100644 index 00000000..dc956eb9 --- /dev/null +++ b/Assets/Adjust/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0e5ecfef4e691483199f0cdae3eebff2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/Scripts/Adjust.cs b/Assets/Adjust/Scripts/Adjust.cs new file mode 100644 index 00000000..f812d258 --- /dev/null +++ b/Assets/Adjust/Scripts/Adjust.cs @@ -0,0 +1,746 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace AdjustSdk +{ + public class Adjust : MonoBehaviour + { + private const string errorMsgEditor = "[Adjust]: SDK can not be used in Editor."; + 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 and iOS apps."; + + // [Header("SDK SETTINGS:")] + // [Space(5)] + // [Tooltip("If selected, it is expected from you to initialize Adjust SDK from your app code. " + + // "Any SDK configuration settings from prefab will be ignored in that case.")] + [HideInInspector] + public bool startManually = true; + [HideInInspector] + public string appToken; + [HideInInspector] + public AdjustEnvironment environment = AdjustEnvironment.Sandbox; + [HideInInspector] + public AdjustLogLevel logLevel = AdjustLogLevel.Info; + [HideInInspector] + public bool coppaCompliance = false; + [HideInInspector] + public bool sendInBackground = false; + [HideInInspector] + public bool launchDeferredDeeplink = true; + [HideInInspector] + public bool costDataInAttribution = false; + [HideInInspector] + public bool linkMe = false; + [HideInInspector] + public string defaultTracker; + + // [Header("ANDROID SPECIFIC FEATURES:")] + // [Space(5)] + [HideInInspector] + public bool preinstallTracking = false; + [HideInInspector] + public string preinstallFilePath; + + // [Header("iOS SPECIFIC FEATURES:")] + // [Space(5)] + [HideInInspector] + public bool adServices = true; + [HideInInspector] + public bool idfaReading = true; + [HideInInspector] + public bool skanAttribution = true; + + void Awake() + { + if (IsEditor()) + { + return; + } + + DontDestroyOnLoad(transform.gameObject); + + // TODO: double-check the state of Unity on deep linking nowadays +#if UNITY_ANDROID && UNITY_2019_2_OR_NEWER + Application.deepLinkActivated += (deeplink) => + { + Adjust.ProcessDeeplink(new AdjustDeeplink(deeplink)); + }; + if (!string.IsNullOrEmpty(Application.absoluteURL)) + { + // cold start and Application.absoluteURL not null so process deep link + Adjust.ProcessDeeplink(new AdjustDeeplink(Application.absoluteURL)); + } +#endif + + if (!this.startManually) + { + AdjustConfig adjustConfig = new AdjustConfig( + this.appToken, + this.environment, + (this.logLevel == AdjustLogLevel.Suppress)); + adjustConfig.LogLevel = this.logLevel; + adjustConfig.IsSendingInBackgroundEnabled = this.sendInBackground; + adjustConfig.IsDeferredDeeplinkOpeningEnabled = this.launchDeferredDeeplink; + adjustConfig.DefaultTracker = this.defaultTracker; + // TODO: URL strategy + adjustConfig.IsCoppaComplianceEnabled = this.coppaCompliance; + adjustConfig.IsCostDataInAttributionEnabled = this.costDataInAttribution; + adjustConfig.IsPreinstallTrackingEnabled = this.preinstallTracking; + adjustConfig.PreinstallFilePath = this.preinstallFilePath; + adjustConfig.IsAdServicesEnabled = this.adServices; + adjustConfig.IsIdfaReadingEnabled = this.idfaReading; + adjustConfig.IsLinkMeEnabled = this.linkMe; + adjustConfig.IsSkanAttributionEnabled = this.skanAttribution; + Adjust.InitSdk(adjustConfig); + } + } + + public static void InitSdk(AdjustConfig adjustConfig) + { + if (IsEditor()) + { + return; + } + + if (adjustConfig == null) + { + Debug.Log("[Adjust]: Missing config to start."); + return; + } + +#if UNITY_IOS + AdjustiOS.InitSdk(adjustConfig); +#elif UNITY_ANDROID + AdjustAndroid.InitSdk(adjustConfig); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void TrackEvent(AdjustEvent adjustEvent) + { + if (IsEditor()) + { + return; + } + + if (adjustEvent == null) + { + Debug.Log("[Adjust]: Missing event to track."); + return; + } +#if UNITY_IOS + AdjustiOS.TrackEvent(adjustEvent); +#elif UNITY_ANDROID + AdjustAndroid.TrackEvent(adjustEvent); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void Enable() + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.Enable(); +#elif UNITY_ANDROID + AdjustAndroid.Enable(); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void Disable() + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.Disable(); +#elif UNITY_ANDROID + AdjustAndroid.Disable(); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void EnablePlayStoreKidsApp() + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + Debug.Log("[Adjust]: Marking apps as Play Store kids app is only supported for Android platform."); +#elif UNITY_ANDROID + AdjustAndroid.EnablePlayStoreKidsApp(); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void DisablePlayStoreKidsApp() + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + Debug.Log("[Adjust]: Marking apps as Play Store kids app is only supported for Android platform."); +#elif UNITY_ANDROID + AdjustAndroid.DisablePlayStoreKidsApp(); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void IsEnabled(Action callback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.IsEnabled(callback); +#elif UNITY_ANDROID + AdjustAndroid.IsEnabled(callback); +#else + Debug.Log(errorMsgPlatform); + return; +#endif + } + + public static void SwitchToOfflineMode() + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.SwitchToOfflineMode(); +#elif UNITY_ANDROID + AdjustAndroid.SwitchToOfflineMode(); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void SwitchBackToOnlineMode() + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.SwitchBackToOnlineMode(); +#elif UNITY_ANDROID + AdjustAndroid.SwitchBackToOnlineMode(); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void SetPushToken(string pushToken) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.SetPushToken(pushToken); +#elif UNITY_ANDROID + AdjustAndroid.SetPushToken(pushToken); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void GdprForgetMe() + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.GdprForgetMe(); +#elif UNITY_ANDROID + AdjustAndroid.GdprForgetMe(); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void ProcessDeeplink(AdjustDeeplink deeplink) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.ProcessDeeplink(deeplink); +#elif UNITY_ANDROID + AdjustAndroid.ProcessDeeplink(deeplink); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void AddGlobalPartnerParameter(string key, string value) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.AddGlobalPartnerParameter(key, value); +#elif UNITY_ANDROID + AdjustAndroid.AddGlobalPartnerParameter(key, value); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void AddGlobalCallbackParameter(string key, string value) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.AddGlobalCallbackParameter(key, value); +#elif UNITY_ANDROID + AdjustAndroid.AddGlobalCallbackParameter(key, value); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void RemoveGlobalPartnerParameter(string key) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.RemoveGlobalPartnerParameter(key); +#elif UNITY_ANDROID + AdjustAndroid.RemoveGlobalPartnerParameter(key); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void RemoveGlobalCallbackParameter(string key) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.RemoveGlobalCallbackParameter(key); +#elif UNITY_ANDROID + AdjustAndroid.RemoveGlobalCallbackParameter(key); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void RemoveGlobalPartnerParameters() + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.RemoveGlobalPartnerParameters(); +#elif UNITY_ANDROID + AdjustAndroid.RemoveGlobalPartnerParameters(); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void RemoveGlobalCallbackParameters() + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.RemoveGlobalCallbackParameters(); +#elif UNITY_ANDROID + AdjustAndroid.RemoveGlobalCallbackParameters(); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void TrackAdRevenue(AdjustAdRevenue adRevenue) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.TrackAdRevenue(adRevenue); +#elif UNITY_ANDROID + AdjustAndroid.TrackAdRevenue(adRevenue); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void TrackAppStoreSubscription(AdjustAppStoreSubscription subscription) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.TrackAppStoreSubscription(subscription); +#elif UNITY_ANDROID + Debug.Log("[Adjust]: App Store subscription tracking is only supported for iOS platform."); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void TrackPlayStoreSubscription(AdjustPlayStoreSubscription subscription) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + Debug.Log("[Adjust]: Play Store subscription tracking is only supported for Android platform."); +#elif UNITY_ANDROID + AdjustAndroid.TrackPlayStoreSubscription(subscription); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void TrackThirdPartySharing(AdjustThirdPartySharing thirdPartySharing) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.TrackThirdPartySharing(thirdPartySharing); +#elif UNITY_ANDROID + AdjustAndroid.TrackThirdPartySharing(thirdPartySharing); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void TrackMeasurementConsent(bool measurementConsent) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.TrackMeasurementConsent(measurementConsent); +#elif UNITY_ANDROID + AdjustAndroid.TrackMeasurementConsent(measurementConsent); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void RequestAppTrackingAuthorization(Action callback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.RequestAppTrackingAuthorization(callback); +#elif UNITY_ANDROID + Debug.Log("[Adjust]: Requesting tracking authorization is only supported for iOS platform."); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void UpdateSkanConversionValue( + int conversionValue, + string coarseValue, + bool lockWindow, + Action callback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.UpdateSkanConversionValue(conversionValue, coarseValue, lockWindow, callback); +#elif UNITY_ANDROID + Debug.Log("[Adjust]: Updating SKAdNetwork conversion value is only supported for iOS platform."); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static int GetAppTrackingAuthorizationStatus() + { + if (IsEditor()) + { + return -1; + } + +#if UNITY_IOS + return AdjustiOS.GetAppTrackingAuthorizationStatus(); +#elif UNITY_ANDROID + Debug.Log("[Adjust]: Error! App tracking authorization status is only supported for iOS platform."); + return -1; +#else + Debug.Log(errorMsgPlatform); + return -1; +#endif + } + + public static void GetAdid(Action callback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.GetAdid(callback); +#elif UNITY_ANDROID + AdjustAndroid.GetAdid(callback); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void GetAttribution(Action callback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.GetAttribution(callback); +#elif UNITY_ANDROID + AdjustAndroid.GetAttribution(callback); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void GetIdfa(Action callback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.GetIdfa(callback); +#elif UNITY_ANDROID + Debug.Log("[Adjust]: Error! IDFA is not available on Android platform."); + return; +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void GetIdfv(Action callback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.GetIdfv(callback); +#elif UNITY_ANDROID + Debug.Log("[Adjust]: Error! IDFV is not available on Android platform."); + return; +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void GetSdkVersion(Action callback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.GetSdkVersion(callback); +#elif UNITY_ANDROID + AdjustAndroid.GetSdkVersion(callback); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void GetLastDeeplink(Action callback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.GetLastDeeplink(callback); +#elif UNITY_ANDROID + Debug.Log("[Adjust]: Error! Last deeplink getter is not available on Android platform."); + return; +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void VerifyAppStorePurchase( + AdjustAppStorePurchase purchase, + Action callback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.VerifyAppStorePurchase(purchase, callback); +#elif UNITY_ANDROID + Debug.Log("[Adjust]: App Store purchase verification is only supported for iOS platform."); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void VerifyPlayStorePurchase( + AdjustPlayStorePurchase purchase, + Action verificationResultCallback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + Debug.Log("[Adjust]: Play Store purchase verification is only supported for Android platform."); +#elif UNITY_ANDROID + AdjustAndroid.VerifyPlayStorePurchase(purchase, verificationResultCallback); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void ProcessAndResolveDeeplink(AdjustDeeplink deeplink, Action callback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.ProcessAndResolveDeeplink(deeplink, callback); +#elif UNITY_ANDROID + AdjustAndroid.ProcessAndResolveDeeplink(deeplink, callback); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void VerifyAndTrackAppStorePurchase( + AdjustEvent adjustEvent, + Action callback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.VerifyAndTrackAppStorePurchase(adjustEvent, callback); +#elif UNITY_ANDROID + Debug.Log("[Adjust]: App Store purchase verification is only supported for iOS platform."); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + public static void VerifyAndTrackPlayStorePurchase( + AdjustEvent adjustEvent, + Action verificationResultCallback) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + Debug.Log("[Adjust]: Play Store purchase verification is only supported for Android platform."); +#elif UNITY_ANDROID + AdjustAndroid.VerifyAndTrackPlayStorePurchase(adjustEvent, verificationResultCallback); +#else + Debug.Log(errorMsgPlatform); +#endif + } + + private static bool IsEditor() + { +#if UNITY_EDITOR + Debug.Log(errorMsgEditor); + return true; +#else + return false; +#endif + } + + public static void SetTestOptions(Dictionary testOptions) + { + if (IsEditor()) + { + return; + } + +#if UNITY_IOS + AdjustiOS.SetTestOptions(testOptions); +#elif UNITY_ANDROID + AdjustAndroid.SetTestOptions(testOptions); +#else + Debug.Log("[Adjust]: Cannot run integration tests. None of the supported platforms selected."); +#endif + } + } +} diff --git a/Assets/Adjust/Unity/Adjust.cs.meta b/Assets/Adjust/Scripts/Adjust.cs.meta similarity index 100% rename from Assets/Adjust/Unity/Adjust.cs.meta rename to Assets/Adjust/Scripts/Adjust.cs.meta diff --git a/Assets/Adjust/Scripts/AdjustAdRevenue.cs b/Assets/Adjust/Scripts/AdjustAdRevenue.cs new file mode 100644 index 00000000..7c13bd01 --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustAdRevenue.cs @@ -0,0 +1,78 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace AdjustSdk +{ + public class AdjustAdRevenue + { + private List innerCallbackParameters; + private List innerPartnerParameters; + + public string Source { get; private set; } + public double? Revenue { get; private set; } + public string Currency { get; private set; } + public int? AdImpressionsCount { get; set; } + public string AdRevenueNetwork { get; set; } + public string AdRevenueUnit { get; set; } + public string AdRevenuePlacement { get; set; } + public ReadOnlyCollection CallbackParameters + { + get + { + if (innerCallbackParameters == null) + { + return null; + } + else + { + return innerCallbackParameters.AsReadOnly(); + } + } + } + public ReadOnlyCollection PartnerParameters + { + get + { + if (innerPartnerParameters == null) + { + return null; + } + else + { + return innerPartnerParameters.AsReadOnly(); + } + } + } + + public AdjustAdRevenue(string source) + { + this.Source = source; + } + + public void SetRevenue(double revenue, string currency) + { + this.Revenue = revenue; + this.Currency = currency; + } + + public void AddCallbackParameter(string key, string value) + { + if (this.innerCallbackParameters == null) + { + this.innerCallbackParameters = new List(); + } + this.innerCallbackParameters.Add(key); + this.innerCallbackParameters.Add(value); + } + + public void AddPartnerParameter(string key, string value) + { + if (this.innerPartnerParameters == null) + { + this.innerPartnerParameters = new List(); + } + this.innerPartnerParameters.Add(key); + this.innerPartnerParameters.Add(value); + } + } +} diff --git a/Assets/Adjust/Unity/AdjustAdRevenue.cs.meta b/Assets/Adjust/Scripts/AdjustAdRevenue.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustAdRevenue.cs.meta rename to Assets/Adjust/Scripts/AdjustAdRevenue.cs.meta diff --git a/Assets/Adjust/Scripts/AdjustAndroid.cs b/Assets/Adjust/Scripts/AdjustAndroid.cs new file mode 100644 index 00000000..e671cc1e --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustAndroid.cs @@ -0,0 +1,1226 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace AdjustSdk +{ +#if UNITY_ANDROID + public class AdjustAndroid + { + private const string sdkPrefix = "unity5.0.0"; + private static bool isDeferredDeeplinkOpeningEnabled = true; + private static AndroidJavaClass ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); + private static AndroidJavaObject ajoCurrentActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic("currentActivity"); + private static DeferredDeeplinkListener onDeferredDeeplinkListener; + private static AttributionChangedListener onAttributionChangedListener; + private static EventTrackingFailedListener onEventTrackingFailedListener; + private static EventTrackingSucceededListener onEventTrackingSucceededListener; + private static SessionTrackingFailedListener onSessionTrackingFailedListener; + private static SessionTrackingSucceededListener onSessionTrackingSucceededListener; + private static VerificationResultListener onVerificationResultListener; + private static VerificationResultListener onVerifyAndTrackListener; + private static DeeplinkResolutionListener onDeeplinkResolvedListener; + + public static void InitSdk(AdjustConfig adjustConfig) + { + // thank you, Unity 2019.2.0, for breaking this + // AndroidJavaObject ajoEnvironment = adjustConfig.environment == AdjustEnvironment.Sandbox ? + // new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic("ENVIRONMENT_SANDBOX") : + // new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic("ENVIRONMENT_PRODUCTION"); + + // get environment variable + string ajoEnvironment = adjustConfig.Environment == AdjustEnvironment.Production ? "production" : "sandbox"; + + // create config object + AndroidJavaObject ajoAdjustConfig; + + // check if suppress log level is supported + if (adjustConfig.AllowSuppressLogLevel != null) + { + ajoAdjustConfig = new AndroidJavaObject("com.adjust.sdk.AdjustConfig", ajoCurrentActivity, adjustConfig.AppToken, ajoEnvironment, adjustConfig.AllowSuppressLogLevel); + } + else + { + ajoAdjustConfig = new AndroidJavaObject("com.adjust.sdk.AdjustConfig", ajoCurrentActivity, adjustConfig.AppToken, ajoEnvironment); + } + + // check if deferred deeplink should be launched by the SDK + if (adjustConfig.IsDeferredDeeplinkOpeningEnabled != null) + { + isDeferredDeeplinkOpeningEnabled = (bool)adjustConfig.IsDeferredDeeplinkOpeningEnabled; + } + + // check log level + if (adjustConfig.LogLevel != null) + { + AndroidJavaObject ajoLogLevel; + if (adjustConfig.LogLevel.Value.ToUppercaseString().Equals("SUPPRESS")) + { + ajoLogLevel = new AndroidJavaClass("com.adjust.sdk.LogLevel").GetStatic("SUPRESS"); + } + else + { + ajoLogLevel = new AndroidJavaClass("com.adjust.sdk.LogLevel").GetStatic(adjustConfig.LogLevel.Value.ToUppercaseString()); + } + + if (ajoLogLevel != null) + { + ajoAdjustConfig.Call("setLogLevel", ajoLogLevel); + } + } + + // set Unity SDK prefix + ajoAdjustConfig.Call("setSdkPrefix", sdkPrefix); + + // check read device IDs only once + if (adjustConfig.IsDeviceIdsReadingOnceEnabled != null) + { + if (adjustConfig.IsDeviceIdsReadingOnceEnabled == true) + { + ajoAdjustConfig.Call("enableDeviceIdsReadingOnce"); + } + } + + // check if COPPA compliance is enabled + if (adjustConfig.IsCoppaComplianceEnabled != null) + { + if (adjustConfig.IsCoppaComplianceEnabled == true) + { + ajoAdjustConfig.Call("enableCoppaCompliance"); + } + } + + // check if Play Store Kids compliance is enabled + if (adjustConfig.IsPlayStoreKidsComplianceEnabled != null) + { + if (adjustConfig.IsPlayStoreKidsComplianceEnabled == true) + { + ajoAdjustConfig.Call("enablePlayStoreKidsCompliance"); + } + } + + // check if user enabled sening in the background + if (adjustConfig.IsSendingInBackgroundEnabled != null) + { + if (adjustConfig.IsSendingInBackgroundEnabled == true) + { + ajoAdjustConfig.Call("enableSendingInBackground"); + } + } + + // check if user wants to get cost data in attribution callback + if (adjustConfig.IsCostDataInAttributionEnabled != null) + { + if (adjustConfig.IsCostDataInAttributionEnabled == true) + { + ajoAdjustConfig.Call("enableCostDataInAttribution"); + } + } + + // check if user wants to run preinstall campaigns + if (adjustConfig.IsPreinstallTrackingEnabled != null) + { + if (adjustConfig.IsPreinstallTrackingEnabled == true) + { + ajoAdjustConfig.Call("enablePreinstallTracking"); + } + } + + // check if user has set custom preinstall file path + if (adjustConfig.PreinstallFilePath != null) + { + ajoAdjustConfig.Call("setPreinstallFilePath", adjustConfig.PreinstallFilePath); + } + + // check if FB app ID has been set + if (adjustConfig.FbAppId != null) + { + ajoAdjustConfig.Call("setFbAppId", adjustConfig.FbAppId); + } + + // check if user has set default tracker token + if (adjustConfig.DefaultTracker != null) + { + ajoAdjustConfig.Call("setDefaultTracker", adjustConfig.DefaultTracker); + } + + // check if user has set external device identifier + if (adjustConfig.ExternalDeviceId != null) + { + ajoAdjustConfig.Call("setExternalDeviceId", adjustConfig.ExternalDeviceId); + } + + // check if user has set max number of event deduplication IDs + if (adjustConfig.EventDeduplicationIdsMaxSize != null) + { + AndroidJavaObject ajoEventDeduplicationIdsMaxSize = new AndroidJavaObject("java.lang.Integer", adjustConfig.EventDeduplicationIdsMaxSize); + ajoAdjustConfig.Call("setEventDeduplicationIdsMaxSize", ajoEventDeduplicationIdsMaxSize); + } + + // check if user has set custom URL strategy + if (adjustConfig.UrlStrategyDomains != null && + adjustConfig.ShouldUseSubdomains != null && + adjustConfig.IsDataResidency != null) + { + var ajoUrlStrategyDomains = new AndroidJavaObject("java.util.ArrayList"); + foreach (string domain in adjustConfig.UrlStrategyDomains) + { + ajoUrlStrategyDomains.Call("add", domain); + } + ajoAdjustConfig.Call("setUrlStrategy", + ajoUrlStrategyDomains, + adjustConfig.ShouldUseSubdomains, + adjustConfig.IsDataResidency); + } + + // check attribution changed delagate + if (adjustConfig.AttributionChangedDelegate != null) + { + onAttributionChangedListener = new AttributionChangedListener(adjustConfig.AttributionChangedDelegate); + ajoAdjustConfig.Call("setOnAttributionChangedListener", onAttributionChangedListener); + } + + // check event success delegate + if (adjustConfig.EventSuccessDelegate != null) + { + onEventTrackingSucceededListener = new EventTrackingSucceededListener(adjustConfig.EventSuccessDelegate); + ajoAdjustConfig.Call("setOnEventTrackingSucceededListener", onEventTrackingSucceededListener); + } + + // check event failure delagate + if (adjustConfig.EventFailureDelegate != null) + { + onEventTrackingFailedListener = new EventTrackingFailedListener(adjustConfig.EventFailureDelegate); + ajoAdjustConfig.Call("setOnEventTrackingFailedListener", onEventTrackingFailedListener); + } + + // check session success delegate + if (adjustConfig.SessionSuccessDelegate != null) + { + onSessionTrackingSucceededListener = new SessionTrackingSucceededListener(adjustConfig.SessionSuccessDelegate); + ajoAdjustConfig.Call("setOnSessionTrackingSucceededListener", onSessionTrackingSucceededListener); + } + + // check session failure delegate + if (adjustConfig.SessionFailureDelegate != null) + { + onSessionTrackingFailedListener = new SessionTrackingFailedListener(adjustConfig.SessionFailureDelegate); + ajoAdjustConfig.Call("setOnSessionTrackingFailedListener", onSessionTrackingFailedListener); + } + + // check deferred deeplink delegate + if (adjustConfig.DeferredDeeplinkDelegate != null) + { + onDeferredDeeplinkListener = new DeferredDeeplinkListener(adjustConfig.DeferredDeeplinkDelegate); + ajoAdjustConfig.Call("setOnDeferredDeeplinkResponseListener", onDeferredDeeplinkListener); + } + + // initialise and start the SDK + ajcAdjust.CallStatic("initSdk", ajoAdjustConfig); + } + + public static void TrackEvent(AdjustEvent adjustEvent) + { + AndroidJavaObject ajoAdjustEvent = new AndroidJavaObject("com.adjust.sdk.AdjustEvent", adjustEvent.EventToken); + + // check if user has set revenue for the event + if (adjustEvent.Revenue != null) + { + ajoAdjustEvent.Call("setRevenue", (double)adjustEvent.Revenue, adjustEvent.Currency); + } + + // check if user has added any callback parameters to the event + if (adjustEvent.CallbackParameters != null) + { + for (int i = 0; i < adjustEvent.CallbackParameters.Count; i += 2) + { + string key = adjustEvent.CallbackParameters[i]; + string value = adjustEvent.CallbackParameters[i + 1]; + ajoAdjustEvent.Call("addCallbackParameter", key, value); + } + } + + // check if user has added any partner parameters to the event + if (adjustEvent.PartnerParameters != null) + { + for (int i = 0; i < adjustEvent.PartnerParameters.Count; i += 2) + { + string key = adjustEvent.PartnerParameters[i]; + string value = adjustEvent.PartnerParameters[i + 1]; + ajoAdjustEvent.Call("addPartnerParameter", key, value); + } + } + + // check if user has set deduplication ID for the event + if (adjustEvent.DeduplicationId != null) + { + ajoAdjustEvent.Call("setDeduplicationId", adjustEvent.DeduplicationId); + } + + // check if user has added callback ID to the event + if (adjustEvent.CallbackId != null) + { + ajoAdjustEvent.Call("setCallbackId", adjustEvent.CallbackId); + } + + // check if user has added product ID to the event + if (adjustEvent.ProductId != null) + { + ajoAdjustEvent.Call("setProductId", adjustEvent.ProductId); + } + + // check if user has added purchase token to the event + if (adjustEvent.PurchaseToken != null) + { + ajoAdjustEvent.Call("setPurchaseToken", adjustEvent.PurchaseToken); + } + + // Track the event. + ajcAdjust.CallStatic("trackEvent", ajoAdjustEvent); + } + + public static void Enable() + { + ajcAdjust.CallStatic("enable"); + } + + public static void Disable() + { + ajcAdjust.CallStatic("disable"); + } + + public static void SwitchToOfflineMode() + { + ajcAdjust.CallStatic("switchToOfflineMode"); + } + + public static void SwitchBackToOnlineMode() + { + ajcAdjust.CallStatic("switchBackToOnlineMode"); + } + + public static void EnableCoppaCompliance() + { + ajcAdjust.CallStatic("enableCoppaCompliance", ajoCurrentActivity); + } + + public static void DisableCoppaCompliance() + { + ajcAdjust.CallStatic("disableCoppaCompliance", ajoCurrentActivity); + } + + public static void EnablePlayStoreKidsApp() + { + ajcAdjust.CallStatic("enablePlayStoreKidsApp", ajoCurrentActivity); + } + + public static void DisablePlayStoreKidsApp() + { + ajcAdjust.CallStatic("disablePlayStoreKidsApp", ajoCurrentActivity); + } + + public static void SetPushToken(string pushToken) + { + ajcAdjust.CallStatic("setPushToken", pushToken, ajoCurrentActivity); + } + + public static void GdprForgetMe() + { + ajcAdjust.CallStatic("gdprForgetMe", ajoCurrentActivity); + } + + public static void AddGlobalPartnerParameter(string key, string value) + { + if (ajcAdjust == null) + { + ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); + } + ajcAdjust.CallStatic("addGlobalPartnerParameter", key, value); + } + + public static void AddGlobalCallbackParameter(string key, string value) + { + if (ajcAdjust == null) + { + ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); + } + ajcAdjust.CallStatic("addGlobalCallbackParameter", key, value); + } + + public static void RemoveGlobalPartnerParameter(string key) + { + if (ajcAdjust == null) + { + ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); + } + ajcAdjust.CallStatic("removeGlobalPartnerParameter", key); + } + + public static void RemoveGlobalCallbackParameter(string key) + { + if (ajcAdjust == null) + { + ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); + } + ajcAdjust.CallStatic("removeGlobalCallbackParameter", key); + } + + public static void RemoveGlobalPartnerParameters() + { + if (ajcAdjust == null) + { + ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); + } + ajcAdjust.CallStatic("removeGlobalPartnerParameters"); + } + + public static void RemoveGlobalCallbackParameters() + { + if (ajcAdjust == null) + { + ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); + } + ajcAdjust.CallStatic("removeGlobalCallbackParameters"); + } + + public static void ProcessDeeplink(AdjustDeeplink deeplink) + { + AndroidJavaClass ajcUri = new AndroidJavaClass("android.net.Uri"); + AndroidJavaObject ajoUri = ajcUri.CallStatic("parse", deeplink.Deeplink); + AndroidJavaObject ajoAdjustDeeplink = new AndroidJavaObject("com.adjust.sdk.AdjustDeeplink", ajoUri); + ajcAdjust.CallStatic("processDeeplink", ajoAdjustDeeplink, ajoCurrentActivity); + } + + public static void TrackAdRevenue(AdjustAdRevenue adRevenue) + { + AndroidJavaObject ajoAdjustAdRevenue = new AndroidJavaObject("com.adjust.sdk.AdjustAdRevenue", adRevenue.Source); + + // check if user has set revenue + if (adRevenue.Revenue != null) + { + AndroidJavaObject ajoRevenue = new AndroidJavaObject("java.lang.Double", adRevenue.Revenue); + ajoAdjustAdRevenue.Call("setRevenue", ajoRevenue, adRevenue.Currency); + } + + // check if user has set ad impressions count + if (adRevenue.AdImpressionsCount != null) + { + AndroidJavaObject ajoAdImpressionsCount = new AndroidJavaObject("java.lang.Integer", adRevenue.AdImpressionsCount); + ajoAdjustAdRevenue.Call("setAdImpressionsCount", ajoAdImpressionsCount); + } + + // check if user has set ad revenue network + if (adRevenue.AdRevenueNetwork != null) + { + ajoAdjustAdRevenue.Call("setAdRevenueNetwork", adRevenue.AdRevenueNetwork); + } + + // check if user has set ad revenue unit + if (adRevenue.AdRevenueUnit != null) + { + ajoAdjustAdRevenue.Call("setAdRevenueUnit", adRevenue.AdRevenueUnit); + } + + // check if user has set ad revenue placement + if (adRevenue.AdRevenuePlacement != null) + { + ajoAdjustAdRevenue.Call("setAdRevenuePlacement", adRevenue.AdRevenuePlacement); + } + + // check if user has added any callback parameters + if (adRevenue.CallbackParameters != null) + { + for (int i = 0; i < adRevenue.CallbackParameters.Count; i += 2) + { + string key = adRevenue.CallbackParameters[i]; + string value = adRevenue.CallbackParameters[i + 1]; + ajoAdjustAdRevenue.Call("addCallbackParameter", key, value); + } + } + + // check if user has added any partner parameters + if (adRevenue.PartnerParameters != null) + { + for (int i = 0; i < adRevenue.PartnerParameters.Count; i += 2) + { + string key = adRevenue.PartnerParameters[i]; + string value = adRevenue.PartnerParameters[i + 1]; + ajoAdjustAdRevenue.Call("addPartnerParameter", key, value); + } + } + + // track ad revenue. + ajcAdjust.CallStatic("trackAdRevenue", ajoAdjustAdRevenue); + } + + public static void TrackPlayStoreSubscription(AdjustPlayStoreSubscription subscription) + { + AndroidJavaObject ajoSubscription = new AndroidJavaObject("com.adjust.sdk.AdjustPlayStoreSubscription", + Convert.ToInt64(subscription.Price), + subscription.Currency, + subscription.ProductId, + subscription.OrderId, + subscription.Signature, + subscription.PurchaseToken); + + // check if user has set purchase time for subscription + if (subscription.PurchaseTime != null) + { + ajoSubscription.Call("setPurchaseTime", Convert.ToInt64(subscription.PurchaseTime)); + } + + // check if user has added any callback parameters to the subscription + if (subscription.CallbackParameters != null) + { + for (int i = 0; i < subscription.CallbackParameters.Count; i += 2) + { + string key = subscription.CallbackParameters[i]; + string value = subscription.CallbackParameters[i + 1]; + ajoSubscription.Call("addCallbackParameter", key, value); + } + } + + // check if user has added any partner parameters to the subscription + if (subscription.PartnerParameters != null) + { + for (int i = 0; i < subscription.PartnerParameters.Count; i += 2) + { + string key = subscription.PartnerParameters[i]; + string value = subscription.PartnerParameters[i + 1]; + ajoSubscription.Call("addPartnerParameter", key, value); + } + } + + // track the subscription + ajcAdjust.CallStatic("trackPlayStoreSubscription", ajoSubscription); + } + + public static void TrackThirdPartySharing(AdjustThirdPartySharing thirdPartySharing) + { + AndroidJavaObject ajoIsEnabled; + AndroidJavaObject ajoAdjustThirdPartySharing; + if (thirdPartySharing.IsEnabled != null) + { + ajoIsEnabled = new AndroidJavaObject("java.lang.Boolean", thirdPartySharing.IsEnabled.Value); + ajoAdjustThirdPartySharing = new AndroidJavaObject("com.adjust.sdk.AdjustThirdPartySharing", ajoIsEnabled); + } + else + { + string[] parameters = null; + ajoAdjustThirdPartySharing = new AndroidJavaObject("com.adjust.sdk.AdjustThirdPartySharing", parameters); + } + + if (thirdPartySharing.GranularOptions != null) + { + for (int i = 0; i < thirdPartySharing.GranularOptions.Count;) + { + string partnerName = thirdPartySharing.GranularOptions[i++]; + string key = thirdPartySharing.GranularOptions[i++]; + string value = thirdPartySharing.GranularOptions[i++]; + ajoAdjustThirdPartySharing.Call("addGranularOption", partnerName, key, value); + } + } + + if (thirdPartySharing.PartnerSharingSettings != null) + { + for (int i = 0; i < thirdPartySharing.PartnerSharingSettings.Count;) + { + string partnerName = thirdPartySharing.PartnerSharingSettings[i++]; + string key = thirdPartySharing.PartnerSharingSettings[i++]; + string value = thirdPartySharing.PartnerSharingSettings[i++]; + ajoAdjustThirdPartySharing.Call("addPartnerSharingSetting", partnerName, key, bool.Parse(value)); + } + } + + ajcAdjust.CallStatic("trackThirdPartySharing", ajoAdjustThirdPartySharing); + } + + public static void TrackMeasurementConsent(bool measurementConsent) + { + ajcAdjust.CallStatic("trackMeasurementConsent", measurementConsent); + } + + public static void IsEnabled(Action onIsEnabled) + { + IsEnabledListener isEnabledProxy = new IsEnabledListener(onIsEnabled); + ajcAdjust.CallStatic("isEnabled", ajoCurrentActivity, isEnabledProxy); + } + + public static void GetAdid(Action onAdidRead) + { + AdidReadListener onAdidReadProxy = new AdidReadListener(onAdidRead); + ajcAdjust.CallStatic("getAdid", onAdidReadProxy); + } + + public static void GetAttribution(Action onAttributionRead) + { + AttributionReadListener onAttributionReadProxy = new AttributionReadListener(onAttributionRead); + ajcAdjust.CallStatic("getAttribution", onAttributionReadProxy); + } + + // android specific methods + public static void GetGoogleAdId(Action onDeviceIdsRead) + { + DeviceIdsReadListener onDeviceIdsReadProxy = new DeviceIdsReadListener(onDeviceIdsRead); + ajcAdjust.CallStatic("getGoogleAdId", ajoCurrentActivity, onDeviceIdsReadProxy); + } + + public static void GetAmazonAdId(Action onAmazonAdIdRead) + { + AmazonAdIdReadListener onAmazonAdIdReadProxy = new AmazonAdIdReadListener(onAmazonAdIdRead); + ajcAdjust.CallStatic("getAmazonAdId", ajoCurrentActivity, onAmazonAdIdReadProxy); + } + + public static void GetSdkVersion(Action onSdkVersionRead) + { + SdkVersionReadListener onSdkVersionReadProxy = new SdkVersionReadListener(onSdkVersionRead, sdkPrefix); + ajcAdjust.CallStatic("getSdkVersion", onSdkVersionReadProxy); + } + + public static void VerifyPlayStorePurchase( + AdjustPlayStorePurchase purchase, + Action verificationInfoCallback) + { + AndroidJavaObject ajoPurchase = new AndroidJavaObject("com.adjust.sdk.AdjustPlayStorePurchase", + purchase.ProductId, + purchase.PurchaseToken); + onVerificationResultListener = new VerificationResultListener(verificationInfoCallback); + + ajcAdjust.CallStatic("verifyPlayStorePurchase", ajoPurchase, onVerificationResultListener); + } + + public static void ProcessAndResolveDeeplink(AdjustDeeplink deeplink, Action resolvedLinkCallback) + { + onDeeplinkResolvedListener = new DeeplinkResolutionListener(resolvedLinkCallback); + AndroidJavaClass ajcUri = new AndroidJavaClass("android.net.Uri"); + AndroidJavaObject ajoUri = ajcUri.CallStatic("parse", deeplink.Deeplink); + AndroidJavaObject ajoAdjustDeeplink = new AndroidJavaObject("com.adjust.sdk.AdjustDeeplink", ajoUri); + ajcAdjust.CallStatic("processAndResolveDeeplink", ajoAdjustDeeplink, ajoCurrentActivity, onDeeplinkResolvedListener); + } + + public static void VerifyAndTrackPlayStorePurchase( + AdjustEvent adjustEvent, + Action verificationInfoCallback) + { + AndroidJavaObject ajoAdjustEvent = new AndroidJavaObject("com.adjust.sdk.AdjustEvent", adjustEvent.EventToken); + + // check if user has set revenue for the event + if (adjustEvent.Revenue != null) + { + ajoAdjustEvent.Call("setRevenue", (double)adjustEvent.Revenue, adjustEvent.Currency); + } + + // check if user has added any callback parameters to the event + if (adjustEvent.CallbackParameters != null) + { + for (int i = 0; i < adjustEvent.CallbackParameters.Count; i += 2) + { + string key = adjustEvent.CallbackParameters[i]; + string value = adjustEvent.CallbackParameters[i + 1]; + ajoAdjustEvent.Call("addCallbackParameter", key, value); + } + } + + // check if user has added any partner parameters to the event + if (adjustEvent.PartnerParameters != null) + { + for (int i = 0; i < adjustEvent.PartnerParameters.Count; i += 2) + { + string key = adjustEvent.PartnerParameters[i]; + string value = adjustEvent.PartnerParameters[i + 1]; + ajoAdjustEvent.Call("addPartnerParameter", key, value); + } + } + + // check if user has set deduplication ID for the event + if (adjustEvent.DeduplicationId != null) + { + ajoAdjustEvent.Call("setDeduplicationId", adjustEvent.DeduplicationId); + } + + // check if user has added callback ID to the event + if (adjustEvent.CallbackId != null) + { + ajoAdjustEvent.Call("setCallbackId", adjustEvent.CallbackId); + } + + // check if user has added product ID to the event + if (adjustEvent.ProductId != null) + { + ajoAdjustEvent.Call("setProductId", adjustEvent.ProductId); + } + + // check if user has added purchase token to the event + if (adjustEvent.PurchaseToken != null) + { + ajoAdjustEvent.Call("setPurchaseToken", adjustEvent.PurchaseToken); + } + + onVerifyAndTrackListener = new VerificationResultListener(verificationInfoCallback); + + ajcAdjust.CallStatic("verifyAndTrackPlayStorePurchase", ajoAdjustEvent, onVerifyAndTrackListener); + } + + // used for testing only + public static void SetTestOptions(Dictionary testOptions) + { + AndroidJavaObject ajoTestOptions = AdjustUtils.TestOptionsMap2AndroidJavaObject(testOptions, ajoCurrentActivity); + ajcAdjust.CallStatic("setTestOptions", ajoTestOptions); + } + + public static void OnResume(string testingArgument = null) + { + if (testingArgument == "test") + { + ajcAdjust.CallStatic("onResume"); + } + } + + public static void OnPause(string testingArgument = null) + { + if (testingArgument == "test") + { + ajcAdjust.CallStatic("onPause"); + } + } + + // private & helper classes + // TODO: add AndroidJavaObject null instance handling to each proxy + private class AttributionChangedListener : AndroidJavaProxy + { + private Action callback; + + public AttributionChangedListener(Action pCallback) : base("com.adjust.sdk.OnAttributionChangedListener") + { + this.callback = pCallback; + } + + // method must be lowercase to match Android method signature + public void onAttributionChanged(AndroidJavaObject attribution) + { + if (callback == null) + { + return; + } + + AdjustAttribution adjustAttribution = new AdjustAttribution(); + adjustAttribution.TrackerName = attribution.Get(AdjustUtils.KeyTrackerName) == "" ? + null : attribution.Get(AdjustUtils.KeyTrackerName); + adjustAttribution.TrackerToken = attribution.Get(AdjustUtils.KeyTrackerToken) == "" ? + null : attribution.Get(AdjustUtils.KeyTrackerToken); + adjustAttribution.Network = attribution.Get(AdjustUtils.KeyNetwork) == "" ? + null : attribution.Get(AdjustUtils.KeyNetwork); + adjustAttribution.Campaign = attribution.Get(AdjustUtils.KeyCampaign) == "" ? + null : attribution.Get(AdjustUtils.KeyCampaign); + adjustAttribution.Adgroup = attribution.Get(AdjustUtils.KeyAdgroup) == "" ? + null : attribution.Get(AdjustUtils.KeyAdgroup); + adjustAttribution.Creative = attribution.Get(AdjustUtils.KeyCreative) == "" ? + null : attribution.Get(AdjustUtils.KeyCreative); + adjustAttribution.ClickLabel = attribution.Get(AdjustUtils.KeyClickLabel) == "" ? + null : attribution.Get(AdjustUtils.KeyClickLabel); + adjustAttribution.CostType = attribution.Get(AdjustUtils.KeyCostType) == "" ? + null : attribution.Get(AdjustUtils.KeyCostType); + AndroidJavaObject ajoCostAmount = attribution.Get(AdjustUtils.KeyCostAmount) == null ? + null : attribution.Get(AdjustUtils.KeyCostAmount); + if (ajoCostAmount == null) + { + adjustAttribution.CostAmount = null; + } + else + { + double costAmount = ajoCostAmount.Call("doubleValue"); + adjustAttribution.CostAmount = costAmount; + } + adjustAttribution.CostCurrency = attribution.Get(AdjustUtils.KeyCostCurrency) == "" ? + null : attribution.Get(AdjustUtils.KeyCostCurrency); + adjustAttribution.FbInstallReferrer = attribution.Get(AdjustUtils.KeyFbInstallReferrer) == "" ? + null : attribution.Get(AdjustUtils.KeyFbInstallReferrer); + callback(adjustAttribution); + } + } + + private class DeferredDeeplinkListener : AndroidJavaProxy + { + private Action callback; + + public DeferredDeeplinkListener(Action pCallback) : base("com.adjust.sdk.OnDeferredDeeplinkResponseListener") + { + this.callback = pCallback; + } + + // method must be lowercase to match Android method signature + public bool launchReceivedDeeplink(AndroidJavaObject deeplink) + { + if (callback == null) + { + return isDeferredDeeplinkOpeningEnabled; + } + + string deeplinkURL = deeplink.Call("toString"); + callback(deeplinkURL); + return isDeferredDeeplinkOpeningEnabled; + } + } + + private class EventTrackingSucceededListener : AndroidJavaProxy + { + private Action callback; + + public EventTrackingSucceededListener(Action pCallback) : base("com.adjust.sdk.OnEventTrackingSucceededListener") + { + this.callback = pCallback; + } + + // method must be lowercase to match Android method signature + public void onEventTrackingSucceeded(AndroidJavaObject eventSuccessData) + { + if (callback == null) + { + return; + } + if (eventSuccessData == null) + { + return; + } + + AdjustEventSuccess adjustEventSuccess = new AdjustEventSuccess(); + adjustEventSuccess.Adid = eventSuccessData.Get(AdjustUtils.KeyAdid) == "" ? + null : eventSuccessData.Get(AdjustUtils.KeyAdid); + adjustEventSuccess.Message = eventSuccessData.Get(AdjustUtils.KeyMessage) == "" ? + null : eventSuccessData.Get(AdjustUtils.KeyMessage); + adjustEventSuccess.Timestamp = eventSuccessData.Get(AdjustUtils.KeyTimestamp) == "" ? + null : eventSuccessData.Get(AdjustUtils.KeyTimestamp); + adjustEventSuccess.EventToken = eventSuccessData.Get(AdjustUtils.KeyEventToken) == "" ? + null : eventSuccessData.Get(AdjustUtils.KeyEventToken); + adjustEventSuccess.CallbackId = eventSuccessData.Get(AdjustUtils.KeyCallbackId) == "" ? + null : eventSuccessData.Get(AdjustUtils.KeyCallbackId); + + try + { + AndroidJavaObject ajoJsonResponse = eventSuccessData.Get(AdjustUtils.KeyJsonResponse); + string jsonResponseString = ajoJsonResponse.Call("toString"); + adjustEventSuccess.BuildJsonResponseFromString(jsonResponseString); + } + catch (Exception) + { + // JSON response reading failed. + // Native Android SDK should send empty JSON object if none available as of v4.12.5. + // Native Android SDK added special logic to send Unity friendly values as of v4.15.0. + } + + callback(adjustEventSuccess); + } + } + + private class EventTrackingFailedListener : AndroidJavaProxy + { + private Action callback; + + public EventTrackingFailedListener(Action pCallback) : base("com.adjust.sdk.OnEventTrackingFailedListener") + { + this.callback = pCallback; + } + + // method must be lowercase to match Android method signature + public void onEventTrackingFailed(AndroidJavaObject eventFailureData) + { + if (callback == null) + { + return; + } + if (eventFailureData == null) + { + return; + } + + AdjustEventFailure adjustEventFailure = new AdjustEventFailure(); + adjustEventFailure.Adid = eventFailureData.Get(AdjustUtils.KeyAdid) == "" ? + null : eventFailureData.Get(AdjustUtils.KeyAdid); + adjustEventFailure.Message = eventFailureData.Get(AdjustUtils.KeyMessage) == "" ? + null : eventFailureData.Get(AdjustUtils.KeyMessage); + adjustEventFailure.WillRetry = eventFailureData.Get(AdjustUtils.KeyWillRetry); + adjustEventFailure.Timestamp = eventFailureData.Get(AdjustUtils.KeyTimestamp) == "" ? + null : eventFailureData.Get(AdjustUtils.KeyTimestamp); + adjustEventFailure.EventToken = eventFailureData.Get(AdjustUtils.KeyEventToken) == "" ? + null : eventFailureData.Get(AdjustUtils.KeyEventToken); + adjustEventFailure.CallbackId = eventFailureData.Get(AdjustUtils.KeyCallbackId) == "" ? + null : eventFailureData.Get(AdjustUtils.KeyCallbackId); + + try + { + AndroidJavaObject ajoJsonResponse = eventFailureData.Get(AdjustUtils.KeyJsonResponse); + string jsonResponseString = ajoJsonResponse.Call("toString"); + adjustEventFailure.BuildJsonResponseFromString(jsonResponseString); + } + catch (Exception) + { + // JSON response reading failed. + // Native Android SDK should send empty JSON object if none available as of v4.12.5. + // Native Android SDK added special logic to send Unity friendly values as of v4.15.0. + } + + callback(adjustEventFailure); + } + } + + private class SessionTrackingSucceededListener : AndroidJavaProxy + { + private Action callback; + + public SessionTrackingSucceededListener(Action pCallback) : base("com.adjust.sdk.OnSessionTrackingSucceededListener") + { + this.callback = pCallback; + } + + // method must be lowercase to match Android method signature + public void onSessionTrackingSucceeded(AndroidJavaObject sessionSuccessData) + { + if (callback == null) + { + return; + } + if (sessionSuccessData == null) + { + return; + } + + AdjustSessionSuccess adjustSessionSuccess = new AdjustSessionSuccess(); + adjustSessionSuccess.Adid = sessionSuccessData.Get(AdjustUtils.KeyAdid) == "" ? + null : sessionSuccessData.Get(AdjustUtils.KeyAdid); + adjustSessionSuccess.Message = sessionSuccessData.Get(AdjustUtils.KeyMessage) == "" ? + null : sessionSuccessData.Get(AdjustUtils.KeyMessage); + adjustSessionSuccess.Timestamp = sessionSuccessData.Get(AdjustUtils.KeyTimestamp) == "" ? + null : sessionSuccessData.Get(AdjustUtils.KeyTimestamp); + + try + { + AndroidJavaObject ajoJsonResponse = sessionSuccessData.Get(AdjustUtils.KeyJsonResponse); + string jsonResponseString = ajoJsonResponse.Call("toString"); + adjustSessionSuccess.BuildJsonResponseFromString(jsonResponseString); + } + catch (Exception) + { + // JSON response reading failed. + // Native Android SDK should send empty JSON object if none available as of v4.12.5. + // Native Android SDK added special logic to send Unity friendly values as of v4.15.0. + } + + callback(adjustSessionSuccess); + } + } + + private class SessionTrackingFailedListener : AndroidJavaProxy + { + private Action callback; + + public SessionTrackingFailedListener(Action pCallback) : base("com.adjust.sdk.OnSessionTrackingFailedListener") + { + this.callback = pCallback; + } + + // method must be lowercase to match Android method signature + public void onSessionTrackingFailed(AndroidJavaObject sessionFailureData) + { + if (callback == null) + { + return; + } + if (sessionFailureData == null) + { + return; + } + + AdjustSessionFailure adjustSessionFailure = new AdjustSessionFailure(); + adjustSessionFailure.Adid = sessionFailureData.Get(AdjustUtils.KeyAdid) == "" ? + null : sessionFailureData.Get(AdjustUtils.KeyAdid); + adjustSessionFailure.Message = sessionFailureData.Get(AdjustUtils.KeyMessage) == "" ? + null : sessionFailureData.Get(AdjustUtils.KeyMessage); + adjustSessionFailure.WillRetry = sessionFailureData.Get(AdjustUtils.KeyWillRetry); + adjustSessionFailure.Timestamp = sessionFailureData.Get(AdjustUtils.KeyTimestamp) == "" ? + null : sessionFailureData.Get(AdjustUtils.KeyTimestamp); + + try + { + AndroidJavaObject ajoJsonResponse = sessionFailureData.Get(AdjustUtils.KeyJsonResponse); + string jsonResponseString = ajoJsonResponse.Call("toString"); + adjustSessionFailure.BuildJsonResponseFromString(jsonResponseString); + } + catch (Exception) + { + // JSON response reading failed. + // Native Android SDK should send empty JSON object if none available as of v4.12.5. + // Native Android SDK added special logic to send Unity friendly values as of v4.15.0. + } + + callback(adjustSessionFailure); + } + } + + private class DeviceIdsReadListener : AndroidJavaProxy + { + private Action onPlayAdIdReadCallback; + + public DeviceIdsReadListener(Action pCallback) : base("com.adjust.sdk.OnDeviceIdsRead") + { + this.onPlayAdIdReadCallback = pCallback; + } + + // method must be lowercase to match Android method signature + public void onGoogleAdIdRead(string playAdId) + { + if (onPlayAdIdReadCallback == null) + { + return; + } + + this.onPlayAdIdReadCallback(playAdId); + } + + // handling of null object + public void onGoogleAdIdRead(AndroidJavaObject ajoAdId) + { + if (ajoAdId == null) + { + string adId = null; + this.onGoogleAdIdRead(adId); + return; + } + + this.onGoogleAdIdRead(ajoAdId.Call("toString")); + } + } + + private class VerificationResultListener : AndroidJavaProxy + { + private Action callback; + + public VerificationResultListener(Action pCallback) : base("com.adjust.sdk.OnPurchaseVerificationFinishedListener") + { + this.callback = pCallback; + } + + public void onVerificationFinished(AndroidJavaObject verificationInfo) + { + AdjustPurchaseVerificationResult purchaseVerificationResult = new AdjustPurchaseVerificationResult(); + // verification status + purchaseVerificationResult.VerificationStatus = verificationInfo.Get(AdjustUtils.KeyVerificationStatus); + // status code + purchaseVerificationResult.Code = verificationInfo.Get(AdjustUtils.KeyCode); + // message + purchaseVerificationResult.Message = verificationInfo.Get(AdjustUtils.KeyMessage); + + if (callback != null) + { + callback(purchaseVerificationResult); + } + } + } + + private class DeeplinkResolutionListener : AndroidJavaProxy + { + private Action callback; + + public DeeplinkResolutionListener(Action pCallback) : base("com.adjust.sdk.OnDeeplinkResolvedListener") + { + this.callback = pCallback; + } + + public void onDeeplinkResolved(string resolvedLink) + { + if (callback != null) + { + callback(resolvedLink); + } + } + } + + private class AdidReadListener : AndroidJavaProxy + { + private Action onAdidReadCallback; + + public AdidReadListener(Action pCallback) : base("com.adjust.sdk.OnAdidReadListener") + { + this.onAdidReadCallback = pCallback; + } + + // method must be lowercase to match Android method signature + public void onAdidRead(string adid) + { + if (onAdidReadCallback == null) + { + return; + } + + this.onAdidReadCallback(adid); + } + + // handling of null object + public void onAdidRead(AndroidJavaObject ajoAdid) + { + if (ajoAdid == null) + { + string adid = null; + this.onAdidRead(adid); + return; + } + + this.onAdidRead(ajoAdid.Call("toString")); + } + } + + private class AttributionReadListener : AndroidJavaProxy + { + private Action onAttributionReadCallback; + + public AttributionReadListener(Action pCallback) : base("com.adjust.sdk.OnAttributionReadListener") + { + this.onAttributionReadCallback = pCallback; + } + + // method must be lowercase to match Android method signature + public void onAttributionRead(AndroidJavaObject ajoAttribution) + { + if (this.onAttributionReadCallback == null) + { + return; + } + + if (ajoAttribution == null) + { + this.onAttributionReadCallback(null); + return; + } + + AdjustAttribution adjustAttribution = new AdjustAttribution(); + adjustAttribution.TrackerName = ajoAttribution.Get(AdjustUtils.KeyTrackerName) == "" ? + null : ajoAttribution.Get(AdjustUtils.KeyTrackerName); + adjustAttribution.TrackerToken = ajoAttribution.Get(AdjustUtils.KeyTrackerToken) == "" ? + null : ajoAttribution.Get(AdjustUtils.KeyTrackerToken); + adjustAttribution.Network = ajoAttribution.Get(AdjustUtils.KeyNetwork) == "" ? + null : ajoAttribution.Get(AdjustUtils.KeyNetwork); + adjustAttribution.Campaign = ajoAttribution.Get(AdjustUtils.KeyCampaign) == "" ? + null : ajoAttribution.Get(AdjustUtils.KeyCampaign); + adjustAttribution.Adgroup = ajoAttribution.Get(AdjustUtils.KeyAdgroup) == "" ? + null : ajoAttribution.Get(AdjustUtils.KeyAdgroup); + adjustAttribution.Creative = ajoAttribution.Get(AdjustUtils.KeyCreative) == "" ? + null : ajoAttribution.Get(AdjustUtils.KeyCreative); + adjustAttribution.ClickLabel = ajoAttribution.Get(AdjustUtils.KeyClickLabel) == "" ? + null : ajoAttribution.Get(AdjustUtils.KeyClickLabel); + adjustAttribution.CostType = ajoAttribution.Get(AdjustUtils.KeyCostType) == "" ? + null : ajoAttribution.Get(AdjustUtils.KeyCostType); + AndroidJavaObject ajoCostAmount = ajoAttribution.Get(AdjustUtils.KeyCostAmount) == null ? + null : ajoAttribution.Get(AdjustUtils.KeyCostAmount); + if (ajoCostAmount == null) + { + adjustAttribution.CostAmount = null; + } + else + { + double costAmount = ajoCostAmount.Call("doubleValue"); + adjustAttribution.CostAmount = costAmount; + } + adjustAttribution.CostCurrency = ajoAttribution.Get(AdjustUtils.KeyCostCurrency) == "" ? + null : ajoAttribution.Get(AdjustUtils.KeyCostCurrency); + adjustAttribution.FbInstallReferrer = ajoAttribution.Get(AdjustUtils.KeyFbInstallReferrer) == "" ? + null : ajoAttribution.Get(AdjustUtils.KeyFbInstallReferrer); + + this.onAttributionReadCallback(adjustAttribution); + } + } + + private class AmazonAdIdReadListener : AndroidJavaProxy + { + private Action onAmazonAdIdReadCallback; + + public AmazonAdIdReadListener(Action pCallback) : base("com.adjust.sdk.OnAmazonAdIdReadListener") + { + this.onAmazonAdIdReadCallback = pCallback; + } + + // method must be lowercase to match Android method signature + public void onAmazonAdIdRead(string amazonAdId) + { + if (this.onAmazonAdIdReadCallback == null) + { + return; + } + + this.onAmazonAdIdReadCallback(amazonAdId); + } + + // handling of null object + public void onAmazonAdIdRead(AndroidJavaObject ajoAmazonAdId) + { + if (ajoAmazonAdId == null) + { + string amazonAdId = null; + this.onAmazonAdIdRead(amazonAdId); + return; + } + + this.onAmazonAdIdRead(ajoAmazonAdId.Call("toString")); + } + } + + private class SdkVersionReadListener : AndroidJavaProxy + { + private Action onSdkVersionReadCallback; + private string sdkPrefix; + + public SdkVersionReadListener(Action pCallback, string sdkPrefix) : base("com.adjust.sdk.OnSdkVersionReadListener") + { + this.onSdkVersionReadCallback = pCallback; + this.sdkPrefix = sdkPrefix; + } + + // method must be lowercase to match Android method signature + public void onSdkVersionRead(string sdkVersion) + { + if (this.onSdkVersionReadCallback == null) + { + return; + } + + this.onSdkVersionReadCallback(this.sdkPrefix + "@" + sdkVersion); + } + + // handling of null object + public void onSdkVersionRead(AndroidJavaObject ajoSdkVersion) + { + if (ajoSdkVersion == null) + { + string sdkVersion = null; + this.onSdkVersionRead(sdkVersion); + return; + } + + this.onSdkVersionRead(ajoSdkVersion.Call("toString")); + } + } + + private class IsEnabledListener : AndroidJavaProxy + { + private Action onIsEnabledCallback; + + public IsEnabledListener(Action pCallback) : base("com.adjust.sdk.OnIsEnabledListener") + { + this.onIsEnabledCallback = pCallback; + } + + // method must be lowercase to match Android method signature + public void onIsEnabledRead(bool isEnabled) + { + if (this.onIsEnabledCallback == null) + { + return; + } + + this.onIsEnabledCallback(isEnabled); + } + + // not handling null for primitive data type + } + } +#endif +} diff --git a/Assets/Adjust/Unity/AdjustUrlStrategy.cs.meta b/Assets/Adjust/Scripts/AdjustAndroid.cs.meta similarity index 71% rename from Assets/Adjust/Unity/AdjustUrlStrategy.cs.meta rename to Assets/Adjust/Scripts/AdjustAndroid.cs.meta index cd909196..5aa37418 100644 --- a/Assets/Adjust/Unity/AdjustUrlStrategy.cs.meta +++ b/Assets/Adjust/Scripts/AdjustAndroid.cs.meta @@ -1,7 +1,5 @@ fileFormatVersion: 2 -guid: 034243ca816f644dc97675a908e24e8c -timeCreated: 1617092915 -licenseType: Free +guid: 04f57a99ef137445992d048a89c36788 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Adjust/Scripts/AdjustAppStorePurchase.cs b/Assets/Adjust/Scripts/AdjustAppStorePurchase.cs new file mode 100644 index 00000000..ef345e1c --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustAppStorePurchase.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace AdjustSdk +{ + public class AdjustAppStorePurchase + { + public string TransactionId { get; private set; } + public string ProductId { get; private set; } + + public AdjustAppStorePurchase(string transactionId, string productId) + { + this.TransactionId = transactionId; + this.ProductId = productId; + } + } +} diff --git a/Assets/Adjust/Unity/AdjustAppStorePurchase.cs.meta b/Assets/Adjust/Scripts/AdjustAppStorePurchase.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustAppStorePurchase.cs.meta rename to Assets/Adjust/Scripts/AdjustAppStorePurchase.cs.meta diff --git a/Assets/Adjust/Scripts/AdjustAppStoreSubscription.cs b/Assets/Adjust/Scripts/AdjustAppStoreSubscription.cs new file mode 100644 index 00000000..a7bdcc56 --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustAppStoreSubscription.cs @@ -0,0 +1,72 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace AdjustSdk +{ + public class AdjustAppStoreSubscription + { + private List innerCallbackParameters; + private List innerPartnerParameters; + + public string Price { get; private set; } + public string Currency { get; private set; } + public string TransactionId { get; private set; } + public string TransactionDate { get; set; } + public string SalesRegion { get; set; } + public ReadOnlyCollection CallbackParameters + { + get + { + if (innerCallbackParameters == null) + { + return null; + } + else + { + return innerCallbackParameters.AsReadOnly(); + } + } + } + public ReadOnlyCollection PartnerParameters + { + get + { + if (innerPartnerParameters == null) + { + return null; + } + else + { + return innerPartnerParameters.AsReadOnly(); + } + } + } + + public AdjustAppStoreSubscription(string price, string currency, string transactionId) + { + this.Price = price; + this.Currency = currency; + this.TransactionId = transactionId; + } + + public void AddCallbackParameter(string key, string value) + { + if (this.innerCallbackParameters == null) + { + this.innerCallbackParameters = new List(); + } + this.innerCallbackParameters.Add(key); + this.innerCallbackParameters.Add(value); + } + + public void AddPartnerParameter(string key, string value) + { + if (this.innerPartnerParameters == null) + { + this.innerPartnerParameters = new List(); + } + this.innerPartnerParameters.Add(key); + this.innerPartnerParameters.Add(value); + } + } +} diff --git a/Assets/Adjust/Unity/AdjustAppStoreSubscription.cs.meta b/Assets/Adjust/Scripts/AdjustAppStoreSubscription.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustAppStoreSubscription.cs.meta rename to Assets/Adjust/Scripts/AdjustAppStoreSubscription.cs.meta diff --git a/Assets/Adjust/Scripts/AdjustAttribution.cs b/Assets/Adjust/Scripts/AdjustAttribution.cs new file mode 100644 index 00000000..dad2d92f --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustAttribution.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; + +namespace AdjustSdk +{ + public class AdjustAttribution + { + public string TrackerToken { get; set; } + public string TrackerName { get; set; } + public string Network { get; set; } + public string Campaign { get; set; } + public string Adgroup { get; set; } + public string Creative { get; set; } + public string ClickLabel { get; set; } + public string CostType { get; set; } + public double? CostAmount { get; set; } + public string CostCurrency { get; set; } + // Android only + public string FbInstallReferrer { get; set; } + + public AdjustAttribution() {} + + public AdjustAttribution(string jsonString) + { + var jsonNode = JSON.Parse(jsonString); + if (jsonNode == null) + { + return; + } + + this.TrackerName = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTrackerName); + this.TrackerToken = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTrackerToken); + this.Network = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyNetwork); + this.Campaign = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCampaign); + this.Adgroup = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdgroup); + this.Creative = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCreative); + this.ClickLabel = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyClickLabel); + this.CostType = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostType); + try + { + this.CostAmount = double.Parse( + AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostAmount), + System.Globalization.CultureInfo.InvariantCulture); + } + catch (Exception) + { + // attribution response doesn't contain cost amount attached + // value will default to null + } + this.CostCurrency = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostCurrency); + this.FbInstallReferrer = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyFbInstallReferrer); + } + + public AdjustAttribution(Dictionary dicAttributionData) + { + if (dicAttributionData == null) + { + return; + } + + this.TrackerName = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyTrackerName); + this.TrackerToken = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyTrackerToken); + this.Network = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyNetwork); + this.Campaign = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCampaign); + this.Adgroup = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyAdgroup); + this.Creative = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCreative); + this.ClickLabel = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyClickLabel); + this.CostType = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostType); + try + { + this.CostAmount = double.Parse( + AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostAmount), + System.Globalization.CultureInfo.InvariantCulture); + } + catch (Exception) + { + // attribution response doesn't contain cost amount attached + // value will default to null + } + this.CostCurrency = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostCurrency); + this.FbInstallReferrer = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyFbInstallReferrer); + } + } +} diff --git a/Assets/Adjust/Unity/AdjustAttribution.cs.meta b/Assets/Adjust/Scripts/AdjustAttribution.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustAttribution.cs.meta rename to Assets/Adjust/Scripts/AdjustAttribution.cs.meta diff --git a/Assets/Adjust/Scripts/AdjustConfig.cs b/Assets/Adjust/Scripts/AdjustConfig.cs new file mode 100644 index 00000000..ae9eb37e --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustConfig.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; + +namespace AdjustSdk +{ + public class AdjustConfig + { + public string AppToken { get; private set; } + public string DefaultTracker { get; set; } + public string ExternalDeviceId { get; set; } + public bool? IsCoppaComplianceEnabled { get; set; } + public bool? IsSendingInBackgroundEnabled { get; set; } + public bool? IsCostDataInAttributionEnabled { get; set; } + public bool? IsDeviceIdsReadingOnceEnabled { get; set; } + public bool? IsDeferredDeeplinkOpeningEnabled { get; set; } + public bool? AllowSuppressLogLevel { get; private set; } + public bool? IsDataResidency { get; private set; } + public bool? ShouldUseSubdomains { get; private set; } + public int? EventDeduplicationIdsMaxSize { get; set; } + public List UrlStrategyDomains { get; private set; } + public AdjustLogLevel? LogLevel { get; set; } + public AdjustEnvironment Environment { get; private set; } + public Action AttributionChangedDelegate { get; set; } + public Action EventSuccessDelegate { get; set; } + public Action EventFailureDelegate { get; set; } + public Action SessionSuccessDelegate { get; set; } + public Action SessionFailureDelegate { get; set; } + public Action DeferredDeeplinkDelegate { get; set; } + public Action> SkanUpdatedDelegate { get; set; } + + // iOS specific + public bool? IsAdServicesEnabled { get; set; } + public bool? IsIdfaReadingEnabled { get; set; } + public bool? IsSkanAttributionEnabled { get; set; } + public bool? IsLinkMeEnabled { get; set; } + public int? AttConsentWaitingInterval { get; set; } + + // Android specific + public bool? IsPlayStoreKidsComplianceEnabled { get; set; } + public bool? IsPreinstallTrackingEnabled { get; set; } + public string PreinstallFilePath { get; set; } + public string FbAppId { get; set; } + + public AdjustConfig(string appToken, AdjustEnvironment environment) + { + this.AppToken = appToken; + this.Environment = environment; + } + + public AdjustConfig(string appToken, AdjustEnvironment environment, bool allowSuppressLogLevel) + { + this.AppToken = appToken; + this.Environment = environment; + this.AllowSuppressLogLevel = allowSuppressLogLevel; + } + + public void SetUrlStrategy( + List urlStrategyDomains, + bool shouldUseSubdomains, + bool isDataResidency) + { + this.UrlStrategyDomains = urlStrategyDomains; + this.ShouldUseSubdomains = shouldUseSubdomains; + this.IsDataResidency = isDataResidency; + } + } +} diff --git a/Assets/Adjust/Unity/AdjustConfig.cs.meta b/Assets/Adjust/Scripts/AdjustConfig.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustConfig.cs.meta rename to Assets/Adjust/Scripts/AdjustConfig.cs.meta diff --git a/Assets/Adjust/Scripts/AdjustDeeplink.cs b/Assets/Adjust/Scripts/AdjustDeeplink.cs new file mode 100644 index 00000000..254c4fee --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustDeeplink.cs @@ -0,0 +1,14 @@ +using System; + +namespace AdjustSdk +{ + public class AdjustDeeplink + { + public string Deeplink { get; private set; } + + public AdjustDeeplink(string deeplink) + { + this.Deeplink = deeplink; + } + } +} diff --git a/Assets/Adjust/Scripts/AdjustDeeplink.cs.meta b/Assets/Adjust/Scripts/AdjustDeeplink.cs.meta new file mode 100644 index 00000000..e4c15972 --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustDeeplink.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 40e25efef61754d66a47cd3e62a7f6bc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/Unity/AdjustEnvironment.cs b/Assets/Adjust/Scripts/AdjustEnvironment.cs similarity index 95% rename from Assets/Adjust/Unity/AdjustEnvironment.cs rename to Assets/Adjust/Scripts/AdjustEnvironment.cs index 65f3555b..f57f3bf5 100644 --- a/Assets/Adjust/Unity/AdjustEnvironment.cs +++ b/Assets/Adjust/Scripts/AdjustEnvironment.cs @@ -1,4 +1,4 @@ -namespace com.adjust.sdk +namespace AdjustSdk { [System.Serializable] public enum AdjustEnvironment diff --git a/Assets/Adjust/Unity/AdjustEnvironment.cs.meta b/Assets/Adjust/Scripts/AdjustEnvironment.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustEnvironment.cs.meta rename to Assets/Adjust/Scripts/AdjustEnvironment.cs.meta diff --git a/Assets/Adjust/Scripts/AdjustEvent.cs b/Assets/Adjust/Scripts/AdjustEvent.cs new file mode 100644 index 00000000..0779e16e --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustEvent.cs @@ -0,0 +1,81 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace AdjustSdk +{ + public class AdjustEvent + { + private List innerCallbackParameters; + private List innerPartnerParameters; + + public string EventToken { get; private set; } + public double? Revenue { get; private set; } + public string Currency { get; private set; } + public string CallbackId { get; set; } + public string DeduplicationId { get; set; } + public string ProductId { get; set; } + public ReadOnlyCollection CallbackParameters + { + get + { + if (innerCallbackParameters == null) + { + return null; + } + else + { + return innerCallbackParameters.AsReadOnly(); + } + } + } + public ReadOnlyCollection PartnerParameters + { + get + { + if (innerPartnerParameters == null) + { + return null; + } + else + { + return innerPartnerParameters.AsReadOnly(); + } + } + } + // ios specific + public string TransactionId { get; set; } + // android specific + public string PurchaseToken; + + public AdjustEvent(string eventToken) + { + this.EventToken = eventToken; + } + + public void SetRevenue(double amount, string currency) + { + this.Revenue = amount; + this.Currency = currency; + } + + public void AddCallbackParameter(string key, string value) + { + if (this.innerCallbackParameters == null) + { + this.innerCallbackParameters = new List(); + } + this.innerCallbackParameters.Add(key); + this.innerCallbackParameters.Add(value); + } + + public void AddPartnerParameter(string key, string value) + { + if (this.innerPartnerParameters == null) + { + this.innerPartnerParameters = new List(); + } + this.innerPartnerParameters.Add(key); + this.innerPartnerParameters.Add(value); + } + } +} diff --git a/Assets/Adjust/Unity/AdjustEvent.cs.meta b/Assets/Adjust/Scripts/AdjustEvent.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustEvent.cs.meta rename to Assets/Adjust/Scripts/AdjustEvent.cs.meta diff --git a/Assets/Adjust/Unity/AdjustEventFailure.cs b/Assets/Adjust/Scripts/AdjustEventFailure.cs similarity index 62% rename from Assets/Adjust/Unity/AdjustEventFailure.cs rename to Assets/Adjust/Scripts/AdjustEventFailure.cs index 71d63afc..0320b8ac 100644 --- a/Assets/Adjust/Unity/AdjustEventFailure.cs +++ b/Assets/Adjust/Scripts/AdjustEventFailure.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace com.adjust.sdk +namespace AdjustSdk { public class AdjustEventFailure { @@ -22,23 +22,23 @@ public AdjustEventFailure(Dictionary eventFailureDataMap) return; } - Adid = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyAdid); - Message = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyMessage); - Timestamp = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyTimestamp); - EventToken = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyEventToken); - CallbackId = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyCallbackId); + this.Adid = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyAdid); + this.Message = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyMessage); + this.Timestamp = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyTimestamp); + this.EventToken = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyEventToken); + this.CallbackId = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyCallbackId); bool willRetry; if (bool.TryParse(AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyWillRetry), out willRetry)) { - WillRetry = willRetry; + this.WillRetry = willRetry; } string jsonResponseString = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyJsonResponse); var jsonResponseNode = JSON.Parse(jsonResponseString); if (jsonResponseNode != null && jsonResponseNode.AsObject != null) { - JsonResponse = new Dictionary(); + this.JsonResponse = new Dictionary(); AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse); } } @@ -51,12 +51,12 @@ public AdjustEventFailure(string jsonString) return; } - Adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid); - Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage); - Timestamp = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp); - EventToken = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyEventToken); - CallbackId = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCallbackId); - WillRetry = Convert.ToBoolean(AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyWillRetry)); + this.Adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid); + this.Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage); + this.Timestamp = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp); + this.EventToken = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyEventToken); + this.CallbackId = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCallbackId); + this.WillRetry = Convert.ToBoolean(AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyWillRetry)); var jsonResponseNode = jsonNode[AdjustUtils.KeyJsonResponse]; if (jsonResponseNode == null) @@ -68,7 +68,7 @@ public AdjustEventFailure(string jsonString) return; } - JsonResponse = new Dictionary(); + this.JsonResponse = new Dictionary(); AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse); } @@ -80,11 +80,11 @@ public void BuildJsonResponseFromString(string jsonResponseString) return; } - JsonResponse = new Dictionary(); + this.JsonResponse = new Dictionary(); AdjustUtils.WriteJsonResponseDictionary(jsonNode.AsObject, JsonResponse); } - public string GetJsonResponse() + public string GetJsonResponseAsString() { return AdjustUtils.GetJsonResponseCompact(JsonResponse); } diff --git a/Assets/Adjust/Unity/AdjustEventFailure.cs.meta b/Assets/Adjust/Scripts/AdjustEventFailure.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustEventFailure.cs.meta rename to Assets/Adjust/Scripts/AdjustEventFailure.cs.meta diff --git a/Assets/Adjust/Unity/AdjustEventSuccess.cs b/Assets/Adjust/Scripts/AdjustEventSuccess.cs similarity index 62% rename from Assets/Adjust/Unity/AdjustEventSuccess.cs rename to Assets/Adjust/Scripts/AdjustEventSuccess.cs index 3b152532..925ac49f 100644 --- a/Assets/Adjust/Unity/AdjustEventSuccess.cs +++ b/Assets/Adjust/Scripts/AdjustEventSuccess.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace com.adjust.sdk +namespace AdjustSdk { public class AdjustEventSuccess { @@ -10,7 +10,6 @@ public class AdjustEventSuccess public string Timestamp { get; set; } public string EventToken { get; set; } public string CallbackId { get; set; } - public Dictionary JsonResponse { get; set; } public AdjustEventSuccess() {} @@ -22,17 +21,17 @@ public AdjustEventSuccess(Dictionary eventSuccessDataMap) return; } - Adid = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyAdid); - Message = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyMessage); - Timestamp = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyTimestamp); - EventToken = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyEventToken); - CallbackId = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyCallbackId); + this.Adid = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyAdid); + this.Message = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyMessage); + this.Timestamp = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyTimestamp); + this.EventToken = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyEventToken); + this.CallbackId = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyCallbackId); string jsonResponseString = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyJsonResponse); var jsonResponseNode = JSON.Parse(jsonResponseString); if (jsonResponseNode != null && jsonResponseNode.AsObject != null) { - JsonResponse = new Dictionary(); + this.JsonResponse = new Dictionary(); AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse); } } @@ -45,11 +44,11 @@ public AdjustEventSuccess(string jsonString) return; } - Adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid); - Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage); - Timestamp = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp); - EventToken = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyEventToken); - CallbackId = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCallbackId); + this.Adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid); + this.Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage); + this.Timestamp = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp); + this.EventToken = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyEventToken); + this.CallbackId = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCallbackId); var jsonResponseNode = jsonNode[AdjustUtils.KeyJsonResponse]; if (jsonResponseNode == null) @@ -61,7 +60,7 @@ public AdjustEventSuccess(string jsonString) return; } - JsonResponse = new Dictionary(); + this.JsonResponse = new Dictionary(); AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse); } @@ -73,11 +72,11 @@ public void BuildJsonResponseFromString(string jsonResponseString) return; } - JsonResponse = new Dictionary(); + this.JsonResponse = new Dictionary(); AdjustUtils.WriteJsonResponseDictionary(jsonNode.AsObject, JsonResponse); } - public string GetJsonResponse() + public string GetJsonResponseAsString() { return AdjustUtils.GetJsonResponseCompact(JsonResponse); } diff --git a/Assets/Adjust/Unity/AdjustEventSuccess.cs.meta b/Assets/Adjust/Scripts/AdjustEventSuccess.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustEventSuccess.cs.meta rename to Assets/Adjust/Scripts/AdjustEventSuccess.cs.meta diff --git a/Assets/Adjust/Unity/AdjustLogLevel.cs b/Assets/Adjust/Scripts/AdjustLogLevel.cs similarity index 98% rename from Assets/Adjust/Unity/AdjustLogLevel.cs rename to Assets/Adjust/Scripts/AdjustLogLevel.cs index a61994d9..63adf165 100644 --- a/Assets/Adjust/Unity/AdjustLogLevel.cs +++ b/Assets/Adjust/Scripts/AdjustLogLevel.cs @@ -1,4 +1,4 @@ -namespace com.adjust.sdk +namespace AdjustSdk { [System.Serializable] public enum AdjustLogLevel diff --git a/Assets/Adjust/Unity/AdjustLogLevel.cs.meta b/Assets/Adjust/Scripts/AdjustLogLevel.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustLogLevel.cs.meta rename to Assets/Adjust/Scripts/AdjustLogLevel.cs.meta diff --git a/Assets/Adjust/Scripts/AdjustPlayStorePurchase.cs b/Assets/Adjust/Scripts/AdjustPlayStorePurchase.cs new file mode 100644 index 00000000..2d2dddee --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustPlayStorePurchase.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace AdjustSdk +{ + public class AdjustPlayStorePurchase + { + public string ProductId { get; private set; } + public string PurchaseToken { get; private set; } + + public AdjustPlayStorePurchase(string productId, string purchaseToken) + { + this.ProductId = productId; + this.PurchaseToken = purchaseToken; + } + } +} diff --git a/Assets/Adjust/Unity/AdjustPlayStorePurchase.cs.meta b/Assets/Adjust/Scripts/AdjustPlayStorePurchase.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustPlayStorePurchase.cs.meta rename to Assets/Adjust/Scripts/AdjustPlayStorePurchase.cs.meta diff --git a/Assets/Adjust/Scripts/AdjustPlayStoreSubscription.cs b/Assets/Adjust/Scripts/AdjustPlayStoreSubscription.cs new file mode 100644 index 00000000..a48d0170 --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustPlayStoreSubscription.cs @@ -0,0 +1,83 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace AdjustSdk +{ + public class AdjustPlayStoreSubscription + { + private List innerCallbackParameters; + private List innerPartnerParameters; + + public string Price { get; private set; } + public string Currency { get; private set; } + public string ProductId { get; private set; } + public string OrderId { get; private set; } + public string Signature { get; private set; } + public string PurchaseToken { get; private set; } + public string PurchaseTime { get; set; } + public ReadOnlyCollection CallbackParameters + { + get + { + if (innerCallbackParameters == null) + { + return null; + } + else + { + return innerCallbackParameters.AsReadOnly(); + } + } + } + public ReadOnlyCollection PartnerParameters + { + get + { + if (innerPartnerParameters == null) + { + return null; + } + else + { + return innerPartnerParameters.AsReadOnly(); + } + } + } + + public AdjustPlayStoreSubscription( + string price, + string currency, + string productId, + string orderId, + string signature, + string purchaseToken) + { + this.Price = price; + this.Currency = currency; + this.ProductId = productId; + this.OrderId = orderId; + this.Signature = signature; + this.PurchaseToken = purchaseToken; + } + + public void AddCallbackParameter(string key, string value) + { + if (this.innerCallbackParameters == null) + { + this.innerCallbackParameters = new List(); + } + this.innerCallbackParameters.Add(key); + this.innerCallbackParameters.Add(value); + } + + public void AddPartnerParameter(string key, string value) + { + if (this.innerPartnerParameters == null) + { + this.innerPartnerParameters = new List(); + } + this.innerPartnerParameters.Add(key); + this.innerPartnerParameters.Add(value); + } + } +} diff --git a/Assets/Adjust/Unity/AdjustPlayStoreSubscription.cs.meta b/Assets/Adjust/Scripts/AdjustPlayStoreSubscription.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustPlayStoreSubscription.cs.meta rename to Assets/Adjust/Scripts/AdjustPlayStoreSubscription.cs.meta diff --git a/Assets/Adjust/Scripts/AdjustPurchaseVerificationResult.cs b/Assets/Adjust/Scripts/AdjustPurchaseVerificationResult.cs new file mode 100644 index 00000000..6b5eb657 --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustPurchaseVerificationResult.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; + +namespace AdjustSdk +{ + public class AdjustPurchaseVerificationResult + { + public int Code { get; set; } + public string Message { get; set; } + public string VerificationStatus { get; set; } + + public AdjustPurchaseVerificationResult() {} + + public AdjustPurchaseVerificationResult(string jsonString) + { + var jsonNode = JSON.Parse(jsonString); + if (jsonNode == null) + { + return; + } + + string strCode = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCode); + this.Code = int.Parse(strCode); + this.Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage); + this.VerificationStatus = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyVerificationStatus); + } + } +} diff --git a/Assets/Adjust/Scripts/AdjustPurchaseVerificationResult.cs.meta b/Assets/Adjust/Scripts/AdjustPurchaseVerificationResult.cs.meta new file mode 100644 index 00000000..83cbb24c --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustPurchaseVerificationResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cbd451b59ec374fa7b72f226b1cef0b4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/Scripts/AdjustSdk.Scripts.asmdef b/Assets/Adjust/Scripts/AdjustSdk.Scripts.asmdef new file mode 100644 index 00000000..93b41c22 --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustSdk.Scripts.asmdef @@ -0,0 +1,6 @@ +{ + "name": "AdjustSdk.Scripts", + "references": [], + "includePlatforms": [], + "excludePlatforms": [] +} \ No newline at end of file diff --git a/Assets/Adjust/Scripts/AdjustSdk.Scripts.asmdef.meta b/Assets/Adjust/Scripts/AdjustSdk.Scripts.asmdef.meta new file mode 100644 index 00000000..99f43a5a --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustSdk.Scripts.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7d8924c6e6beb44e18f19e8c0b5068cd +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/Unity/AdjustSessionFailure.cs b/Assets/Adjust/Scripts/AdjustSessionFailure.cs similarity index 68% rename from Assets/Adjust/Unity/AdjustSessionFailure.cs rename to Assets/Adjust/Scripts/AdjustSessionFailure.cs index 6d062865..62c0ead4 100644 --- a/Assets/Adjust/Unity/AdjustSessionFailure.cs +++ b/Assets/Adjust/Scripts/AdjustSessionFailure.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace com.adjust.sdk +namespace AdjustSdk { public class AdjustSessionFailure { @@ -20,21 +20,21 @@ public AdjustSessionFailure(Dictionary sessionFailureDataMap) return; } - Adid = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyAdid); - Message = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyMessage); - Timestamp = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyTimestamp); + this.Adid = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyAdid); + this.Message = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyMessage); + this.Timestamp = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyTimestamp); bool willRetry; if (bool.TryParse(AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyWillRetry), out willRetry)) { - WillRetry = willRetry; + this.WillRetry = willRetry; } string jsonResponseString = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyJsonResponse); var jsonResponseNode = JSON.Parse(jsonResponseString); if (jsonResponseNode != null && jsonResponseNode.AsObject != null) { - JsonResponse = new Dictionary(); + this.JsonResponse = new Dictionary(); AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse); } } @@ -47,10 +47,10 @@ public AdjustSessionFailure(string jsonString) return; } - Adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid); - Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage); - Timestamp = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp); - WillRetry = Convert.ToBoolean(AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyWillRetry)); + this.Adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid); + this.Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage); + this.Timestamp = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp); + this.WillRetry = Convert.ToBoolean(AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyWillRetry)); var jsonResponseNode = jsonNode[AdjustUtils.KeyJsonResponse]; if (jsonResponseNode == null) @@ -62,7 +62,7 @@ public AdjustSessionFailure(string jsonString) return; } - JsonResponse = new Dictionary(); + this.JsonResponse = new Dictionary(); AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse); } @@ -74,11 +74,11 @@ public void BuildJsonResponseFromString(string jsonResponseString) return; } - JsonResponse = new Dictionary(); + this.JsonResponse = new Dictionary(); AdjustUtils.WriteJsonResponseDictionary(jsonNode.AsObject, JsonResponse); } - public string GetJsonResponse() + public string GetJsonResponseAsString() { return AdjustUtils.GetJsonResponseCompact(JsonResponse); } diff --git a/Assets/Adjust/Unity/AdjustSessionFailure.cs.meta b/Assets/Adjust/Scripts/AdjustSessionFailure.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustSessionFailure.cs.meta rename to Assets/Adjust/Scripts/AdjustSessionFailure.cs.meta diff --git a/Assets/Adjust/Unity/AdjustSessionSuccess.cs b/Assets/Adjust/Scripts/AdjustSessionSuccess.cs similarity index 68% rename from Assets/Adjust/Unity/AdjustSessionSuccess.cs rename to Assets/Adjust/Scripts/AdjustSessionSuccess.cs index fd55affe..f556ee27 100644 --- a/Assets/Adjust/Unity/AdjustSessionSuccess.cs +++ b/Assets/Adjust/Scripts/AdjustSessionSuccess.cs @@ -1,7 +1,6 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; -namespace com.adjust.sdk +namespace AdjustSdk { public class AdjustSessionSuccess { @@ -19,15 +18,15 @@ public AdjustSessionSuccess(Dictionary sessionSuccessDataMap) return; } - Adid = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyAdid); - Message = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyMessage); - Timestamp = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyTimestamp); + this.Adid = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyAdid); + this.Message = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyMessage); + this.Timestamp = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyTimestamp); string jsonResponseString = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyJsonResponse); var jsonResponseNode = JSON.Parse(jsonResponseString); if (jsonResponseNode != null && jsonResponseNode.AsObject != null) { - JsonResponse = new Dictionary(); + this.JsonResponse = new Dictionary(); AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse); } } @@ -40,9 +39,9 @@ public AdjustSessionSuccess(string jsonString) return; } - Adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid); - Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage); - Timestamp = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp); + this.Adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid); + this.Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage); + this.Timestamp = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp); var jsonResponseNode = jsonNode[AdjustUtils.KeyJsonResponse]; if (jsonResponseNode == null) @@ -54,7 +53,7 @@ public AdjustSessionSuccess(string jsonString) return; } - JsonResponse = new Dictionary(); + this.JsonResponse = new Dictionary(); AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse); } @@ -66,11 +65,11 @@ public void BuildJsonResponseFromString(string jsonResponseString) return; } - JsonResponse = new Dictionary(); + this.JsonResponse = new Dictionary(); AdjustUtils.WriteJsonResponseDictionary(jsonNode.AsObject, JsonResponse); } - public string GetJsonResponse() + public string GetJsonResponseAsString() { return AdjustUtils.GetJsonResponseCompact(JsonResponse); } diff --git a/Assets/Adjust/Unity/AdjustSessionSuccess.cs.meta b/Assets/Adjust/Scripts/AdjustSessionSuccess.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustSessionSuccess.cs.meta rename to Assets/Adjust/Scripts/AdjustSessionSuccess.cs.meta diff --git a/Assets/Adjust/Scripts/AdjustThirdPartySharing.cs b/Assets/Adjust/Scripts/AdjustThirdPartySharing.cs new file mode 100644 index 00000000..0243a835 --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustThirdPartySharing.cs @@ -0,0 +1,68 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace AdjustSdk +{ + public class AdjustThirdPartySharing + { + private List innerGranularOptions; + private List innerPartnerSharingSettings; + + public bool? IsEnabled { get; private set; } + public ReadOnlyCollection GranularOptions + { + get + { + if (innerGranularOptions == null) + { + return null; + } + else + { + return innerGranularOptions.AsReadOnly(); + } + } + } + public ReadOnlyCollection PartnerSharingSettings + { + get + { + if (innerPartnerSharingSettings == null) + { + return null; + } + else + { + return innerPartnerSharingSettings.AsReadOnly(); + } + } + } + + public AdjustThirdPartySharing(bool? isEnabled) + { + this.IsEnabled = isEnabled; + } + + public void AddGranularOption(string partnerName, string key, string value) + { + if (this.innerGranularOptions == null) + { + this.innerGranularOptions = new List(); + } + this.innerGranularOptions.Add(partnerName); + this.innerGranularOptions.Add(key); + this.innerGranularOptions.Add(value); + } + + public void AddPartnerSharingSetting(string partnerName, string key, bool value) + { + if (this.innerPartnerSharingSettings == null) + { + this.innerPartnerSharingSettings = new List(); + } + this.innerPartnerSharingSettings.Add(partnerName); + this.innerPartnerSharingSettings.Add(key); + this.innerPartnerSharingSettings.Add(value.ToString()); + } + } +} diff --git a/Assets/Adjust/Unity/AdjustThirdPartySharing.cs.meta b/Assets/Adjust/Scripts/AdjustThirdPartySharing.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustThirdPartySharing.cs.meta rename to Assets/Adjust/Scripts/AdjustThirdPartySharing.cs.meta diff --git a/Assets/Adjust/Unity/AdjustUtils.cs b/Assets/Adjust/Scripts/AdjustUtils.cs similarity index 74% rename from Assets/Adjust/Unity/AdjustUtils.cs rename to Assets/Adjust/Scripts/AdjustUtils.cs index d8971163..0925de4a 100644 --- a/Assets/Adjust/Unity/AdjustUtils.cs +++ b/Assets/Adjust/Scripts/AdjustUtils.cs @@ -1,9 +1,8 @@ -using System; -using System.Collections.Generic; - +using System.Collections.Generic; +using System.Collections.ObjectModel; using UnityEngine; -namespace com.adjust.sdk +namespace AdjustSdk { public class AdjustUtils { @@ -25,9 +24,9 @@ public class AdjustUtils public static string KeyCostAmount = "costAmount"; public static string KeyCostCurrency = "costCurrency"; public static string KeyFbInstallReferrer = "fbInstallReferrer"; - public static string KeySkadConversionValue = "fineValue"; - public static string KeySkadCoarseValue = "coarseValue"; - public static string KeySkadLockWindow = "lockWindow"; + public static string KeySkanConversionValue = "fineValue"; + public static string KeySkanCoarseValue = "coarseValue"; + public static string KeySkanLockWindow = "lockWindow"; public static string KeyCode = "code"; public static string KeyVerificationStatus = "verificationStatus"; @@ -51,6 +50,7 @@ public class AdjustUtils public static string KeyTestOptionsAdServicesFrameworkEnabled = "adServicesFrameworkEnabled"; public static string KeyTestOptionsAttStatus = "attStatus"; public static string KeyTestOptionsIdfa = "idfa"; + public static string KeyTestOptionsIgnoreSystemLifecycleBootstrap = "ignoreSystemLifecycleBootstrap"; public static int ConvertLogLevel(AdjustLogLevel? logLevel) { @@ -108,7 +108,37 @@ public static long ConvertLong(long? value) return (long)value; } - public static string ConvertListToJson(List list) + public static string ConvertReadOnlyCollectionToJson(ReadOnlyCollection list) + { + if (list == null) + { + return null; + } + + List processedList = new List(); + for (int i = 0; i < list.Count; i += 1) + { + string item = list[i]; + + if (item == null) + { + continue; + } + + processedList.Add(item); + } + + // create JSON array + var jsonArray = new JSONArray(); + foreach (var listItem in processedList) + { + jsonArray.Add(new JSONData(listItem)); + } + + return jsonArray.ToString(); + } + + public static string ConvertReadOnlyCollectionOfPairsToJson(ReadOnlyCollection list) { if (list == null) { @@ -120,11 +150,11 @@ public static string ConvertListToJson(List list) return null; } - List processedList = new List(); + List processedList = new List(); for (int i = 0; i < list.Count; i += 2) { - String key = list[i]; - String value = list[i + 1]; + string key = list[i]; + string value = list[i + 1]; if (key == null || value == null) { @@ -145,6 +175,45 @@ public static string ConvertListToJson(List list) return jsonArray.ToString(); } + public static string ConvertReadOnlyCollectionOfTripletsToJson(ReadOnlyCollection list) + { + if (list == null) + { + return null; + } + // list of third party sharing parameters must contain number of elements divisible by 3 + if (list.Count % 3 != 0) + { + return null; + } + + List processedList = new List(); + for (int i = 0; i < list.Count; i += 3) + { + string partnerName = list[i]; + string key = list[i + 1]; + string value = list[i + 2]; + + if (partnerName == null || key == null || value == null) + { + continue; + } + + processedList.Add(partnerName); + processedList.Add(key); + processedList.Add(value); + } + + // create JSON array + var jsonArray = new JSONArray(); + foreach (var listItem in processedList) + { + jsonArray.Add(new JSONData(listItem)); + } + + return jsonArray.ToString(); + } + public static string GetJsonResponseCompact(Dictionary dictionary) { string logJsonResponse = ""; @@ -160,7 +229,7 @@ public static string GetJsonResponseCompact(Dictionary dictionar foreach (KeyValuePair pair in dictionary) { - String valueString = pair.Value as string; + string valueString = pair.Value as string; if (valueString != null) { @@ -199,7 +268,7 @@ public static string GetJsonResponseCompact(Dictionary dictionar return logJsonResponse; } - public static String GetJsonString(JSONNode node, string key) + public static string GetJsonString(JSONNode node, string key) { if (node == null) { @@ -265,63 +334,37 @@ public static string TryGetValue(Dictionary dictionary, string k return null; } - public static int GetSkad4ConversionValue(string conversionValueUpdate) - { - var jsonNode = JSON.Parse(conversionValueUpdate); - if (jsonNode == null) - { - return -1; - } - - string strConversionValue = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeySkadConversionValue); - int conversionValue = 0; - if (Int32.TryParse(strConversionValue, out conversionValue)) - { - return conversionValue; - } - else - { - return -1; - } - } - - public static string GetSkad4CoarseValue(string conversionValueUpdate) + public static Dictionary GetSkanUpdateDataDictionary(string skanUpdateData) { - var jsonNode = JSON.Parse(conversionValueUpdate); - if (jsonNode == null) + Dictionary skanUpdateDataDictionary = new Dictionary(); + var skanUpdateDataNode = JSON.Parse(skanUpdateData); + if (skanUpdateDataNode != null && skanUpdateDataNode.AsObject != null) { - return null; - } - string coarseValue = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeySkadCoarseValue); - return coarseValue; - } - - public static bool GetSkad4LockWindow(string conversionValueUpdate) - { - var jsonNode = JSON.Parse(conversionValueUpdate); - if (jsonNode == null) - { - return false; + Dictionary temp = new Dictionary(); + AdjustUtils.WriteJsonResponseDictionary(skanUpdateDataNode.AsObject, temp); + foreach (KeyValuePair entry in temp) + { + skanUpdateDataDictionary.Add(entry.Key, entry.Value.ToString()); + } } - bool lockWindow = Convert.ToBoolean(AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeySkadLockWindow)); - return lockWindow; + return skanUpdateDataDictionary; } #if UNITY_ANDROID public static AndroidJavaObject TestOptionsMap2AndroidJavaObject(Dictionary testOptionsMap, AndroidJavaObject ajoCurrentActivity) { AndroidJavaObject ajoTestOptions = new AndroidJavaObject("com.adjust.sdk.AdjustTestOptions"); - ajoTestOptions.Set("baseUrl", testOptionsMap[KeyTestOptionsBaseUrl]); - ajoTestOptions.Set("gdprUrl", testOptionsMap[KeyTestOptionsGdprUrl]); - ajoTestOptions.Set("subscriptionUrl", testOptionsMap[KeyTestOptionsSubscriptionUrl]); - ajoTestOptions.Set("purchaseVerificationUrl", testOptionsMap[KeyTestOptionsPurchaseVerificationUrl]); + ajoTestOptions.Set("baseUrl", testOptionsMap[KeyTestOptionsBaseUrl]); + ajoTestOptions.Set("gdprUrl", testOptionsMap[KeyTestOptionsGdprUrl]); + ajoTestOptions.Set("subscriptionUrl", testOptionsMap[KeyTestOptionsSubscriptionUrl]); + ajoTestOptions.Set("purchaseVerificationUrl", testOptionsMap[KeyTestOptionsPurchaseVerificationUrl]); if (testOptionsMap.ContainsKey(KeyTestOptionsExtraPath) && !string.IsNullOrEmpty(testOptionsMap[KeyTestOptionsExtraPath])) { - ajoTestOptions.Set("basePath", testOptionsMap[KeyTestOptionsExtraPath]); - ajoTestOptions.Set("gdprPath", testOptionsMap[KeyTestOptionsExtraPath]); - ajoTestOptions.Set("subscriptionPath", testOptionsMap[KeyTestOptionsExtraPath]); - ajoTestOptions.Set("purchaseVerificationPath", testOptionsMap[KeyTestOptionsExtraPath]); + ajoTestOptions.Set("basePath", testOptionsMap[KeyTestOptionsExtraPath]); + ajoTestOptions.Set("gdprPath", testOptionsMap[KeyTestOptionsExtraPath]); + ajoTestOptions.Set("subscriptionPath", testOptionsMap[KeyTestOptionsExtraPath]); + ajoTestOptions.Set("purchaseVerificationPath", testOptionsMap[KeyTestOptionsExtraPath]); } if (testOptionsMap.ContainsKey(KeyTestOptionsDeleteState) && ajoCurrentActivity != null) { @@ -369,6 +412,13 @@ public static AndroidJavaObject TestOptionsMap2AndroidJavaObject(Dictionary("noBackoffWait", ajoNoBackoffWait); } + if (testOptionsMap.ContainsKey(KeyTestOptionsIgnoreSystemLifecycleBootstrap)) + { + // TODO: fix native logic not to have negation in naming throughout the chain of calls + bool doNotIgnoreSystemLifecycleBootstrap = testOptionsMap[KeyTestOptionsIgnoreSystemLifecycleBootstrap].ToLower() == "true"; + AndroidJavaObject ajoDoNotIgnoreSystemLifecycleBootstrap = new AndroidJavaObject("java.lang.Boolean", doNotIgnoreSystemLifecycleBootstrap); + ajoTestOptions.Set("ignoreSystemLifecycleBootstrap", ajoDoNotIgnoreSystemLifecycleBootstrap); + } return ajoTestOptions; } diff --git a/Assets/Adjust/Unity/AdjustUtils.cs.meta b/Assets/Adjust/Scripts/AdjustUtils.cs.meta similarity index 100% rename from Assets/Adjust/Unity/AdjustUtils.cs.meta rename to Assets/Adjust/Scripts/AdjustUtils.cs.meta diff --git a/Assets/Adjust/Scripts/AdjustiOS.cs b/Assets/Adjust/Scripts/AdjustiOS.cs new file mode 100644 index 00000000..3f7d483a --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustiOS.cs @@ -0,0 +1,886 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace AdjustSdk +{ +#if UNITY_IOS + public class AdjustiOS + { + private const string sdkPrefix = "unity5.0.0"; + + // app callbacks as method parameters + private static List> appIsEnabledGetterCallbacks; + private static List> appAttributionGetterCallbacks; + private static List> appAdidGetterCallbacks; + private static List> appIdfaGetterCallbacks; + private static List> appIdfvGetterCallbacks; + private static List> appLastDeeplinkGetterCallbacks; + private static List> appSdkVersionGetterCallbacks; + private static List> appAttCallbacks; + private static Action appPurchaseVerificationCallback; + private static Action appVerifyAndTrackCallback; + private static Action appResolvedDeeplinkCallback; + private static Action appSkanErrorCallback; + + // app callbacks as subscriptions + private static Action appAttributionCallback; + private static Action appSessionSuccessCallback; + private static Action appSessionFailureCallback; + private static Action appEventSuccessCallback; + private static Action appEventFailureCallback; + private static Action appDeferredDeeplinkCallback; + private static Action> appSkanUpdatedCallback; + + // extenral C methods + private delegate void AdjustDelegateAttributionCallback(string attribution); + private delegate void AdjustDelegateSessionSuccessCallback(string sessionSuccess); + private delegate void AdjustDelegateSessionFailureCallback(string sessionFailure); + private delegate void AdjustDelegateEventSuccessCallback(string eventSuccess); + private delegate void AdjustDelegateEventFailureCallback(string eventFailure); + private delegate void AdjustDelegateDeferredDeeplinkCallback(string callback); + private delegate void AdjustDelegateSkanUpdatedCallback(string callback); + [DllImport("__Internal")] + private static extern void _AdjustInitSdk( + string appToken, + string environment, + string sdkPrefix, + string defaultTracker, + string externalDeviceId, + string jsonUrlStrategyDomains, + int allowSuppressLogLevel, + int logLevel, + int attConsentWaitingInterval, + int eventDeduplicationIdsMaxSize, + int shouldUseSubdomains, + int isCoppaComplianceEnabled, + int isDataResidency, + int isSendingInBackgroundEnabled, + int isAdServicesEnabled, + int isIdfaReadingEnabled, + int isSkanAttributionEnabled, + int isLinkMeEnabled, + int isCostDataInAttributionEnabled, + int isDeviceIdsReadingOnceEnabled, + int isDeferredDeeplinkOpeningEnabled, + AdjustDelegateAttributionCallback attributionCallback, + AdjustDelegateEventSuccessCallback eventSuccessCallback, + AdjustDelegateEventFailureCallback eventFailureCallback, + AdjustDelegateSessionSuccessCallback sessionSuccessCallback, + AdjustDelegateSessionFailureCallback sessionFailureCallback, + AdjustDelegateDeferredDeeplinkCallback deferredDeeplinkCallback, + AdjustDelegateSkanUpdatedCallback skanUpdatedCallback); + + [DllImport("__Internal")] + private static extern void _AdjustTrackEvent( + string eventToken, + double revenue, + string currency, + string productId, + string transactionId, + string callbackId, + string deduplicationId, + string jsonCallbackParameters, + string jsonPartnerParameters); + + [DllImport("__Internal")] + private static extern void _AdjustEnable(); + + [DllImport("__Internal")] + private static extern void _AdjustDisable(); + + [DllImport("__Internal")] + private static extern void _AdjustSwitchToOfflineMode(); + + [DllImport("__Internal")] + private static extern void _AdjustSwitchBackToOnlineMode(); + + [DllImport("__Internal")] + private static extern void _AdjustSetPushToken(string pushToken); + + [DllImport("__Internal")] + private static extern void _AdjustProcessDeeplink(string deeplink); + + private delegate void AdjustDelegateResolvedDeeplinkCallback(string deeplink); + [DllImport("__Internal")] + private static extern void _AdjustProcessAndResolveDeeplink( + string deeplink, + AdjustDelegateResolvedDeeplinkCallback callback); + + private delegate void AdjustDelegateIsEnabledGetter(bool isEnabed); + [DllImport("__Internal")] + private static extern void _AdjustIsEnabled(AdjustDelegateIsEnabledGetter callback); + + private delegate void AdjustDelegateAttributionGetter(string attribution); + [DllImport("__Internal")] + private static extern void _AdjustGetAttribution(AdjustDelegateAttributionGetter callback); + + private delegate void AdjustDelegateAdidGetter(string adid); + [DllImport("__Internal")] + private static extern void _AdjustGetAdid(AdjustDelegateAdidGetter callback); + + private delegate void AdjustDelegateIdfaGetter(string idfa); + [DllImport("__Internal")] + private static extern void _AdjustGetIdfa(AdjustDelegateIdfaGetter callback); + + private delegate void AdjustDelegateIdfvGetter(string idfv); + [DllImport("__Internal")] + private static extern void _AdjustGetIdfv(AdjustDelegateIdfvGetter callback); + + private delegate void AdjustDelegateLastDeeplinkGetter(string lastDeeplink); + [DllImport("__Internal")] + private static extern void _AdjustGetLastDeeplink(AdjustDelegateLastDeeplinkGetter callback); + + private delegate void AdjustDelegateSdkVersionGetter(string sdkVersion); + [DllImport("__Internal")] + private static extern void _AdjustGetSdkVersion(AdjustDelegateSdkVersionGetter callback); + + [DllImport("__Internal")] + private static extern void _AdjustGdprForgetMe(); + + [DllImport("__Internal")] + private static extern void _AdjustAddGlobalPartnerParameter(string key, string value); + + [DllImport("__Internal")] + private static extern void _AdjustAddGlobalCallbackParameter(string key, string value); + + [DllImport("__Internal")] + private static extern void _AdjustRemoveGlobalPartnerParameter(string key); + + [DllImport("__Internal")] + private static extern void _AdjustRemoveGlobalCallbackParameter(string key); + + [DllImport("__Internal")] + private static extern void _AdjustRemoveGlobalPartnerParameters(); + + [DllImport("__Internal")] + private static extern void _AdjustRemoveGlobalCallbackParameters(); + + [DllImport("__Internal")] + private static extern void _AdjustTrackAdRevenue( + string source, + double revenue, + string currency, + int adImpressionsCount, + string adRevenueNetwork, + string adRevenueUnit, + string adRevenuePlacement, + string jsonCallbackParameters, + string jsonPartnerParameters); + + [DllImport("__Internal")] + private static extern void _AdjustTrackAppStoreSubscription( + string price, + string currency, + string transactionId, + string transactionDate, + string salesRegion, + string jsonCallbackParameters, + string jsonPartnerParameters); + + [DllImport("__Internal")] + private static extern void _AdjustTrackThirdPartySharing( + int enabled, + string jsonGranularOptions, + string jsonPartnerSharingSettings); + + [DllImport("__Internal")] + private static extern void _AdjustTrackMeasurementConsent(int enabled); + + [DllImport("__Internal")] + private static extern void _AdjustSetTestOptions( + string overwriteUrl, + string extraPath, + long timerIntervalInMilliseconds, + long timerStartInMilliseconds, + long sessionIntervalInMilliseconds, + long subsessionIntervalInMilliseconds, + int teardown, + int deleteState, + int noBackoffWait, + int adServicesFrameworkEnabled, + int attStatus, + string idfa); + + private delegate void AdjustDelegateAttCallback(int status); + [DllImport("__Internal")] + private static extern void _AdjustRequestAppTrackingAuthorization(AdjustDelegateAttCallback callback); + + private delegate void AdjustDelegateSkanErrorCallback(string error); + [DllImport("__Internal")] + private static extern void _AdjustUpdateSkanConversionValue( + int conversionValue, + string coarseValue, + int lockWindow, + AdjustDelegateSkanErrorCallback callback); + + [DllImport("__Internal")] + private static extern int _AdjustGetAppTrackingAuthorizationStatus(); + + [DllImport("__Internal")] + private static extern void _AdjustTrackSubsessionStart(); + + [DllImport("__Internal")] + private static extern void _AdjustTrackSubsessionEnd(); + + private delegate void AdjustDelegatePurchaseVerificationCallback(string verificationResult); + [DllImport("__Internal")] + private static extern void _AdjustVerifyAppStorePurchase( + string transactionId, + string productId, + AdjustDelegatePurchaseVerificationCallback callback); + + private delegate void AdjustDelegateVerifyAndTrackCallback(string verificationResult); + [DllImport("__Internal")] + private static extern void _AdjustVerifyAndTrackAppStorePurchase( + string eventToken, + double revenue, + string currency, + string productId, + string transactionId, + string callbackId, + string deduplicationId, + string jsonCallbackParameters, + string jsonPartnerParameters, + AdjustDelegatePurchaseVerificationCallback callback); + + // public API + public AdjustiOS() {} + + public static void InitSdk(AdjustConfig adjustConfig) + { + string appToken = adjustConfig.AppToken != null ? adjustConfig.AppToken : "ADJ_INVALID"; + string environment = adjustConfig.Environment.ToLowercaseString(); + string defaultTracker = adjustConfig.DefaultTracker != null ? adjustConfig.DefaultTracker : "ADJ_INVALID"; + string externalDeviceId = adjustConfig.ExternalDeviceId != null ? adjustConfig.ExternalDeviceId : "ADJ_INVALID"; + string stringJsonUrlStrategyDomains = AdjustUtils.ConvertReadOnlyCollectionToJson( + adjustConfig.UrlStrategyDomains != null ? adjustConfig.UrlStrategyDomains.AsReadOnly() : null); + int attConsentWaitingInterval = AdjustUtils.ConvertInt(adjustConfig.AttConsentWaitingInterval); + int eventDeduplicationIdsMaxSize = AdjustUtils.ConvertInt(adjustConfig.EventDeduplicationIdsMaxSize); + int logLevel = AdjustUtils.ConvertLogLevel(adjustConfig.LogLevel); + int isCoppaComplianceEnabled = AdjustUtils.ConvertBool(adjustConfig.IsCoppaComplianceEnabled); + int isSendingInBackgroundEnabled = AdjustUtils.ConvertBool(adjustConfig.IsSendingInBackgroundEnabled); + int isAdServicesEnabled = AdjustUtils.ConvertBool(adjustConfig.IsAdServicesEnabled); + int isIdfaReadingEnabled = AdjustUtils.ConvertBool(adjustConfig.IsIdfaReadingEnabled); + int allowSuppressLogLevel = AdjustUtils.ConvertBool(adjustConfig.AllowSuppressLogLevel); + int isDeferredDeeplinkOpeningEnabled = AdjustUtils.ConvertBool(adjustConfig.IsDeferredDeeplinkOpeningEnabled); + int isSkanAttributionEnabled = AdjustUtils.ConvertBool(adjustConfig.IsSkanAttributionEnabled); + int isLinkMeEnabled = AdjustUtils.ConvertBool(adjustConfig.IsLinkMeEnabled); + int isCostDataInAttributionEnabled = AdjustUtils.ConvertBool(adjustConfig.IsCostDataInAttributionEnabled); + int isDeviceIdsReadingOnceEnabled = AdjustUtils.ConvertBool(adjustConfig.IsDeviceIdsReadingOnceEnabled); + int shouldUseSubdomains = AdjustUtils.ConvertBool(adjustConfig.ShouldUseSubdomains); + int isDataResidency = AdjustUtils.ConvertBool(adjustConfig.IsDataResidency); + appAttributionCallback = adjustConfig.AttributionChangedDelegate; + appEventSuccessCallback = adjustConfig.EventSuccessDelegate; + appEventFailureCallback = adjustConfig.EventFailureDelegate; + appSessionSuccessCallback = adjustConfig.SessionSuccessDelegate; + appSessionFailureCallback = adjustConfig.SessionFailureDelegate; + appDeferredDeeplinkCallback = adjustConfig.DeferredDeeplinkDelegate; + appSkanUpdatedCallback = adjustConfig.SkanUpdatedDelegate; + + _AdjustInitSdk( + appToken, + environment, + sdkPrefix, + defaultTracker, + externalDeviceId, + stringJsonUrlStrategyDomains, + allowSuppressLogLevel, + logLevel, + attConsentWaitingInterval, + eventDeduplicationIdsMaxSize, + shouldUseSubdomains, + isCoppaComplianceEnabled, + isDataResidency, + isSendingInBackgroundEnabled, + isAdServicesEnabled, + isIdfaReadingEnabled, + isSkanAttributionEnabled, + isLinkMeEnabled, + isCostDataInAttributionEnabled, + isDeviceIdsReadingOnceEnabled, + isDeferredDeeplinkOpeningEnabled, + AttributionCallbackMonoPInvoke, + EventSuccessCallbackMonoPInvoke, + EventFailureCallbackMonoPInvoke, + SessionSuccessCallbackMonoPInvoke, + SessionFailureCallbackMonoPInvoke, + DeferredDeeplinkCallbackMonoPInvoke, + SkanUpdatedCallbackMonoPInvoke); + } + + public static void TrackEvent(AdjustEvent adjustEvent) + { + double revenue = AdjustUtils.ConvertDouble(adjustEvent.Revenue); + string eventToken = adjustEvent.EventToken; + string currency = adjustEvent.Currency; + string productId = adjustEvent.ProductId; + string transactionId = adjustEvent.TransactionId; + string callbackId = adjustEvent.CallbackId; + string deduplicationId = adjustEvent.DeduplicationId; + string stringJsonCallbackParameters = AdjustUtils.ConvertReadOnlyCollectionOfPairsToJson(adjustEvent.CallbackParameters); + string stringJsonPartnerParameters = AdjustUtils.ConvertReadOnlyCollectionOfPairsToJson(adjustEvent.PartnerParameters); + + _AdjustTrackEvent( + eventToken, + revenue, + currency, + productId, + transactionId, + callbackId, + deduplicationId, + stringJsonCallbackParameters, + stringJsonPartnerParameters); + } + + public static void Enable() + { + _AdjustEnable(); + } + + public static void Disable() + { + _AdjustDisable(); + } + + public static void SwitchToOfflineMode() + { + _AdjustSwitchToOfflineMode(); + } + + public static void SwitchBackToOnlineMode() + { + _AdjustSwitchBackToOnlineMode(); + } + + public static void ProcessDeeplink(AdjustDeeplink adjustDeeplink) + { + _AdjustProcessDeeplink(adjustDeeplink.Deeplink); + } + + public static void AddGlobalPartnerParameter(string key, string value) + { + _AdjustAddGlobalPartnerParameter(key, value); + } + + public static void AddGlobalCallbackParameter(string key, string value) + { + _AdjustAddGlobalCallbackParameter(key, value); + } + + public static void RemoveGlobalPartnerParameter(string key) + { + _AdjustRemoveGlobalPartnerParameter(key); + } + + public static void RemoveGlobalCallbackParameter(string key) + { + _AdjustRemoveGlobalCallbackParameter(key); + } + + public static void RemoveGlobalPartnerParameters() + { + _AdjustRemoveGlobalPartnerParameters(); + } + + public static void RemoveGlobalCallbackParameters() + { + _AdjustRemoveGlobalCallbackParameters(); + } + + public static void TrackAdRevenue(AdjustAdRevenue adRevenue) + { + string source = adRevenue.Source; + double revenue = AdjustUtils.ConvertDouble(adRevenue.Revenue); + string currency = adRevenue.Currency; + int adImpressionsCount = AdjustUtils.ConvertInt(adRevenue.AdImpressionsCount); + string adRevenueNetwork = adRevenue.AdRevenueNetwork; + string adRevenueUnit = adRevenue.AdRevenueUnit; + string adRevenuePlacement = adRevenue.AdRevenuePlacement; + string stringJsonCallbackParameters = AdjustUtils.ConvertReadOnlyCollectionOfPairsToJson(adRevenue.CallbackParameters); + string stringJsonPartnerParameters = AdjustUtils.ConvertReadOnlyCollectionOfPairsToJson(adRevenue.PartnerParameters); + + _AdjustTrackAdRevenue( + source, + revenue, + currency, + adImpressionsCount, + adRevenueNetwork, + adRevenueUnit, + adRevenuePlacement, + stringJsonCallbackParameters, + stringJsonPartnerParameters); + } + + public static void TrackAppStoreSubscription(AdjustAppStoreSubscription subscription) + { + string price = subscription.Price; + string currency = subscription.Currency; + string transactionId = subscription.TransactionId; + string transactionDate = subscription.TransactionDate; + string salesRegion = subscription.SalesRegion; + string stringJsonCallbackParameters = AdjustUtils.ConvertReadOnlyCollectionOfPairsToJson(subscription.CallbackParameters); + string stringJsonPartnerParameters = AdjustUtils.ConvertReadOnlyCollectionOfPairsToJson(subscription.PartnerParameters); + + _AdjustTrackAppStoreSubscription( + price, + currency, + transactionId, + transactionDate, + salesRegion, + stringJsonCallbackParameters, + stringJsonPartnerParameters); + } + + public static void TrackThirdPartySharing(AdjustThirdPartySharing thirdPartySharing) + { + int enabled = AdjustUtils.ConvertBool(thirdPartySharing.IsEnabled); + string stringJsonGranularOptions = AdjustUtils.ConvertReadOnlyCollectionOfTripletsToJson(thirdPartySharing.GranularOptions); + string stringJsonPartnerSharingSettings = AdjustUtils.ConvertReadOnlyCollectionOfTripletsToJson(thirdPartySharing.PartnerSharingSettings); + + _AdjustTrackThirdPartySharing( + enabled, + stringJsonGranularOptions, + stringJsonPartnerSharingSettings); + } + + public static void TrackMeasurementConsent(bool enabled) + { + _AdjustTrackMeasurementConsent(AdjustUtils.ConvertBool(enabled)); + } + + public static void RequestAppTrackingAuthorization(Action callback) + { + if (appAttCallbacks == null) + { + appAttCallbacks = new List>(); + } + appAttCallbacks.Add(callback); + _AdjustRequestAppTrackingAuthorization(AttCallbackMonoPInvoke); + } + + public static void UpdateSkanConversionValue( + int conversionValue, + string coarseValue, + bool lockedWindow, + Action callback) + { + appSkanErrorCallback = callback; + _AdjustUpdateSkanConversionValue( + conversionValue, + coarseValue, + AdjustUtils.ConvertBool(lockedWindow), + SkanErrorCallbackMonoPInvoke); + } + + // TODO: consider making async + public static int GetAppTrackingAuthorizationStatus() + { + return _AdjustGetAppTrackingAuthorizationStatus(); + } + + public static void SetPushToken(string pushToken) + { + _AdjustSetPushToken(pushToken); + } + + public static void IsEnabled(Action callback) + { + if (appIsEnabledGetterCallbacks == null) + { + appIsEnabledGetterCallbacks = new List>(); + } + appIsEnabledGetterCallbacks.Add(callback); + _AdjustIsEnabled(IsEnabledGetterMonoPInvoke); + } + + public static void GetAttribution(Action callback) + { + if (appAttributionGetterCallbacks == null) + { + appAttributionGetterCallbacks = new List>(); + } + appAttributionGetterCallbacks.Add(callback); + _AdjustGetAttribution(AttributionGetterMonoPInvoke); + } + + public static void GetAdid(Action callback) + { + if (appAdidGetterCallbacks == null) + { + appAdidGetterCallbacks = new List>(); + } + appAdidGetterCallbacks.Add(callback); + _AdjustGetAdid(AdidGetterMonoPInvoke); + } + + public static void GetIdfa(Action callback) + { + if (appIdfaGetterCallbacks == null) + { + appIdfaGetterCallbacks = new List>(); + } + appIdfaGetterCallbacks.Add(callback); + _AdjustGetIdfa(IdfaGetterMonoPInvoke); + } + + public static void GetIdfv(Action callback) + { + if (appIdfvGetterCallbacks == null) + { + appIdfvGetterCallbacks = new List>(); + } + appIdfvGetterCallbacks.Add(callback); + _AdjustGetIdfv(IdfvGetterMonoPInvoke); + } + + public static void GetLastDeeplink(Action callback) + { + if (appLastDeeplinkGetterCallbacks == null) + { + appLastDeeplinkGetterCallbacks = new List>(); + } + appLastDeeplinkGetterCallbacks.Add(callback); + _AdjustGetLastDeeplink(LastDeeplinkGetterMonoPInvoke); + } + + public static void GetSdkVersion(Action callback) + { + if (appSdkVersionGetterCallbacks == null) + { + appSdkVersionGetterCallbacks = new List>(); + } + appSdkVersionGetterCallbacks.Add(callback); + _AdjustGetSdkVersion(SdkVersionGetterMonoPInvoke); + } + + public static void GdprForgetMe() + { + _AdjustGdprForgetMe(); + } + + public static void VerifyAppStorePurchase( + AdjustAppStorePurchase purchase, + Action callback) + { + string transactionId = purchase.TransactionId; + string productId = purchase.ProductId; + appPurchaseVerificationCallback = callback; + + _AdjustVerifyAppStorePurchase( + transactionId, + productId, + PurchaseVerificationCallbackMonoPInvoke); + } + + public static void ProcessAndResolveDeeplink(AdjustDeeplink adjustDeeplink, Action callback) + { + appResolvedDeeplinkCallback = callback; + _AdjustProcessAndResolveDeeplink(adjustDeeplink.Deeplink, ResolvedDeeplinkCallbackMonoPInvoke); + } + + public static void VerifyAndTrackAppStorePurchase( + AdjustEvent adjustEvent, + Action callback) + { + double revenue = AdjustUtils.ConvertDouble(adjustEvent.Revenue); + string eventToken = adjustEvent.EventToken; + string currency = adjustEvent.Currency; + string productId = adjustEvent.ProductId; + string transactionId = adjustEvent.TransactionId; + string callbackId = adjustEvent.CallbackId; + string deduplicationId = adjustEvent.DeduplicationId; + string stringJsonCallbackParameters = AdjustUtils.ConvertReadOnlyCollectionOfPairsToJson(adjustEvent.CallbackParameters); + string stringJsonPartnerParameters = AdjustUtils.ConvertReadOnlyCollectionOfPairsToJson(adjustEvent.PartnerParameters); + appVerifyAndTrackCallback = callback; + + _AdjustVerifyAndTrackAppStorePurchase( + eventToken, + revenue, + currency, + productId, + transactionId, + callbackId, + deduplicationId, + stringJsonCallbackParameters, + stringJsonPartnerParameters, + VerifyAndTrackCallbackMonoPInvoke); + } + + // used for testing only (don't use this in your app) + public static void SetTestOptions(Dictionary testOptions) + { + string overwriteUrl = testOptions[AdjustUtils.KeyTestOptionsOverwriteUrl]; + string extraPath = testOptions.ContainsKey(AdjustUtils.KeyTestOptionsExtraPath) ? testOptions[AdjustUtils.KeyTestOptionsExtraPath] : null; + string idfa = testOptions.ContainsKey(AdjustUtils.KeyTestOptionsIdfa) ? testOptions[AdjustUtils.KeyTestOptionsIdfa] : null; + long timerIntervalMilis = -1; + long timerStartMilis = -1; + long sessionIntMilis = -1; + long subsessionIntMilis = -1; + bool teardown = false; + bool deleteState = false; + bool noBackoffWait = false; + bool adServicesFrameworkEnabled = false; + int attStatus = -1; + + if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsTimerIntervalInMilliseconds)) + { + timerIntervalMilis = long.Parse(testOptions[AdjustUtils.KeyTestOptionsTimerIntervalInMilliseconds]); + } + if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsTimerStartInMilliseconds)) + { + timerStartMilis = long.Parse(testOptions[AdjustUtils.KeyTestOptionsTimerStartInMilliseconds]); + } + if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsSessionIntervalInMilliseconds)) + { + sessionIntMilis = long.Parse(testOptions[AdjustUtils.KeyTestOptionsSessionIntervalInMilliseconds]); + } + if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsSubsessionIntervalInMilliseconds)) + { + subsessionIntMilis = long.Parse(testOptions[AdjustUtils.KeyTestOptionsSubsessionIntervalInMilliseconds]); + } + if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsTeardown)) + { + teardown = testOptions[AdjustUtils.KeyTestOptionsTeardown].ToLower() == "true"; + } + if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsDeleteState)) + { + deleteState = testOptions[AdjustUtils.KeyTestOptionsDeleteState].ToLower() == "true"; + } + if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsNoBackoffWait)) + { + noBackoffWait = testOptions[AdjustUtils.KeyTestOptionsNoBackoffWait].ToLower() == "true"; + } + if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsAdServicesFrameworkEnabled)) + { + adServicesFrameworkEnabled = testOptions[AdjustUtils.KeyTestOptionsAdServicesFrameworkEnabled].ToLower() == "true"; + } + if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsAttStatus)) + { + attStatus = int.Parse(testOptions[AdjustUtils.KeyTestOptionsAttStatus]); + } + + _AdjustSetTestOptions( + overwriteUrl, + extraPath, + timerIntervalMilis, + timerStartMilis, + sessionIntMilis, + subsessionIntMilis, + AdjustUtils.ConvertBool(teardown), + AdjustUtils.ConvertBool(deleteState), + AdjustUtils.ConvertBool(noBackoffWait), + AdjustUtils.ConvertBool(adServicesFrameworkEnabled), + attStatus, + idfa); + } + + public static void TrackSubsessionStart(string testingArgument = null) + { + if (testingArgument == "test") + { + _AdjustTrackSubsessionStart(); + } + } + + public static void TrackSubsessionEnd(string testingArgument = null) + { + if (testingArgument == "test") + { + _AdjustTrackSubsessionEnd(); + } + } + + // MonoPInvokeCallback methods as method parameters + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateIsEnabledGetter))] + private static void IsEnabledGetterMonoPInvoke(bool isEnabled) { + if (appIsEnabledGetterCallbacks != null) + { + foreach (Action callback in appIsEnabledGetterCallbacks) + { + callback(isEnabled); + } + appIsEnabledGetterCallbacks.Clear(); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateAttributionGetter))] + private static void AttributionGetterMonoPInvoke(string attribution) { + if (appAttributionGetterCallbacks != null) + { + foreach (Action callback in appAttributionGetterCallbacks) + { + callback(new AdjustAttribution(attribution)); + } + appAttributionGetterCallbacks.Clear(); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateAdidGetter))] + private static void AdidGetterMonoPInvoke(string adid) { + if (appAdidGetterCallbacks != null) + { + foreach (Action callback in appAdidGetterCallbacks) + { + callback(adid); + } + appAdidGetterCallbacks.Clear(); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateIdfaGetter))] + private static void IdfaGetterMonoPInvoke(string idfa) { + if (appIdfaGetterCallbacks != null) + { + foreach (Action callback in appIdfaGetterCallbacks) + { + callback(idfa); + } + appIdfaGetterCallbacks.Clear(); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateIdfvGetter))] + private static void IdfvGetterMonoPInvoke(string idfv) { + if (appIdfvGetterCallbacks != null) + { + foreach (Action callback in appIdfaGetterCallbacks) + { + callback(idfv); + } + appIdfvGetterCallbacks.Clear(); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateLastDeeplinkGetter))] + private static void LastDeeplinkGetterMonoPInvoke(string lastDeeplink) { + if (appLastDeeplinkGetterCallbacks != null) + { + foreach (Action callback in appLastDeeplinkGetterCallbacks) + { + callback(lastDeeplink); + } + appLastDeeplinkGetterCallbacks.Clear(); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateSdkVersionGetter))] + private static void SdkVersionGetterMonoPInvoke(string sdkVersion) { + if (appSdkVersionGetterCallbacks != null) + { + foreach (Action callback in appSdkVersionGetterCallbacks) + { + callback(sdkPrefix + "@" + sdkVersion); + } + appSdkVersionGetterCallbacks.Clear(); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateAttCallback))] + private static void AttCallbackMonoPInvoke(int status) { + if (appAttCallbacks != null) + { + foreach (Action callback in appAttCallbacks) + { + callback(status); + } + appAttCallbacks.Clear(); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegatePurchaseVerificationCallback))] + private static void PurchaseVerificationCallbackMonoPInvoke(string verificationResult) { + if (appPurchaseVerificationCallback != null) + { + appPurchaseVerificationCallback(new AdjustPurchaseVerificationResult(verificationResult)); + appPurchaseVerificationCallback = null; + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateVerifyAndTrackCallback))] + private static void VerifyAndTrackCallbackMonoPInvoke(string verificationResult) { + if (appVerifyAndTrackCallback != null) + { + appVerifyAndTrackCallback(new AdjustPurchaseVerificationResult(verificationResult)); + appVerifyAndTrackCallback = null; + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateResolvedDeeplinkCallback))] + private static void ResolvedDeeplinkCallbackMonoPInvoke(string deeplink) { + if (appResolvedDeeplinkCallback != null) + { + appResolvedDeeplinkCallback(deeplink); + appResolvedDeeplinkCallback = null; + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateSkanErrorCallback))] + private static void SkanErrorCallbackMonoPInvoke(string error) { + if (appSkanErrorCallback != null) + { + appSkanErrorCallback(error); + appSkanErrorCallback = null; + } + } + + // MonoPInvokeCallback methods as subscriptions + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateAttributionCallback))] + private static void AttributionCallbackMonoPInvoke(string attribution) { + if (appAttributionCallback != null) + { + appAttributionCallback(new AdjustAttribution(attribution)); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateSessionSuccessCallback))] + private static void SessionSuccessCallbackMonoPInvoke(string sessionSuccess) { + if (appSessionSuccessCallback != null) + { + appSessionSuccessCallback(new AdjustSessionSuccess(sessionSuccess)); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateSessionFailureCallback))] + private static void SessionFailureCallbackMonoPInvoke(string sessionFailure) { + if (appSessionFailureCallback != null) + { + appSessionFailureCallback(new AdjustSessionFailure(sessionFailure)); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateEventSuccessCallback))] + private static void EventSuccessCallbackMonoPInvoke(string eventSuccess) { + if (appEventSuccessCallback != null) + { + appEventSuccessCallback(new AdjustEventSuccess(eventSuccess)); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateEventFailureCallback))] + private static void EventFailureCallbackMonoPInvoke(string eventFailure) { + if (appEventFailureCallback != null) + { + appEventFailureCallback(new AdjustEventFailure(eventFailure)); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateDeferredDeeplinkCallback))] + private static void DeferredDeeplinkCallbackMonoPInvoke(string deeplink) { + if (appDeferredDeeplinkCallback != null) + { + appDeferredDeeplinkCallback(deeplink); + } + } + + [AOT.MonoPInvokeCallback(typeof(AdjustDelegateSkanUpdatedCallback))] + private static void SkanUpdatedCallbackMonoPInvoke(string skanData) { + if (appSkanUpdatedCallback != null) + { + appSkanUpdatedCallback(AdjustUtils.GetSkanUpdateDataDictionary(skanData)); + } + } + } +#endif +} diff --git a/Assets/Adjust/Scripts/AdjustiOS.cs.meta b/Assets/Adjust/Scripts/AdjustiOS.cs.meta new file mode 100644 index 00000000..f7369f20 --- /dev/null +++ b/Assets/Adjust/Scripts/AdjustiOS.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1b9e944cddaba4b74b96cf2c01f5aee3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/Scripts/Editor.meta b/Assets/Adjust/Scripts/Editor.meta new file mode 100644 index 00000000..2868bb20 --- /dev/null +++ b/Assets/Adjust/Scripts/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fd79158f62f184079b58f414302dd242 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/Editor/AdjustCustomEditor.cs b/Assets/Adjust/Scripts/Editor/AdjustCustomEditor.cs similarity index 65% rename from Assets/Adjust/Editor/AdjustCustomEditor.cs rename to Assets/Adjust/Scripts/Editor/AdjustCustomEditor.cs index 01621529..193b05ac 100644 --- a/Assets/Adjust/Editor/AdjustCustomEditor.cs +++ b/Assets/Adjust/Scripts/Editor/AdjustCustomEditor.cs @@ -4,7 +4,7 @@ using UnityEditor.SceneManagement; using UnityEditor; -namespace com.adjust.sdk +namespace AdjustSdk { [CustomEditor(typeof(Adjust))] public class AdjustCustomEditor : Editor @@ -34,36 +34,25 @@ public override void OnInspectorGUI() adjust.appToken = EditorGUILayout.TextField("App Token", adjust.appToken); adjust.environment = (AdjustEnvironment)EditorGUILayout.EnumPopup("Environment", adjust.environment); adjust.logLevel = (AdjustLogLevel)EditorGUILayout.EnumPopup("Log Level", adjust.logLevel); - adjust.urlStrategy = (AdjustUrlStrategy)EditorGUILayout.EnumPopup("URL Strategy", adjust.urlStrategy); - adjust.eventBuffering = EditorGUILayout.Toggle("Event Buffering", adjust.eventBuffering); + // TODO: URL strategy missing adjust.sendInBackground = EditorGUILayout.Toggle("Send In Background", adjust.sendInBackground); adjust.launchDeferredDeeplink = EditorGUILayout.Toggle("Launch Deferred Deep Link", adjust.launchDeferredDeeplink); - adjust.needsCost = EditorGUILayout.Toggle("Cost Data In Attribution Callback", adjust.needsCost); - adjust.coppaCompliant = EditorGUILayout.Toggle("COPPA Compliant", adjust.coppaCompliant); + adjust.costDataInAttribution = EditorGUILayout.Toggle("Cost Data In Attribution Callback", adjust.costDataInAttribution); adjust.linkMe = EditorGUILayout.Toggle("LinkMe", adjust.linkMe); adjust.defaultTracker = EditorGUILayout.TextField("Default Tracker", adjust.defaultTracker); - adjust.startDelay = EditorGUILayout.DoubleField("Start Delay", adjust.startDelay); - EditorGUILayout.LabelField("App Secret:", EditorStyles.label); - EditorGUI.indentLevel += 1; - adjust.secretId = EditorGUILayout.LongField("Secret ID", adjust.secretId); - adjust.info1 = EditorGUILayout.LongField("Info 1", adjust.info1); - adjust.info2 = EditorGUILayout.LongField("Info 2", adjust.info2); - adjust.info3 = EditorGUILayout.LongField("Info 3", adjust.info3); - adjust.info4 = EditorGUILayout.LongField("Info 4", adjust.info4); - EditorGUI.indentLevel -= 2; + EditorGUI.indentLevel -= 1; EditorGUILayout.Space(); EditorGUILayout.LabelField("ANDROID SETTINGS:", darkerCyanTextFieldStyles); EditorGUI.indentLevel += 1; adjust.preinstallTracking = EditorGUILayout.Toggle("Preinstall Tracking", adjust.preinstallTracking); adjust.preinstallFilePath = EditorGUILayout.TextField("Preinstall File Path", adjust.preinstallFilePath); - adjust.playStoreKidsApp = EditorGUILayout.Toggle("Play Store Kids App", adjust.playStoreKidsApp); EditorGUI.indentLevel -= 1; EditorGUILayout.Space(); EditorGUILayout.LabelField("IOS SETTINGS:", darkerCyanTextFieldStyles); EditorGUI.indentLevel += 1; - adjust.adServicesInfoReading = EditorGUILayout.Toggle("AdServices Info Reading", adjust.adServicesInfoReading); - adjust.idfaInfoReading = EditorGUILayout.Toggle("IDFA Info Reading", adjust.idfaInfoReading); - adjust.skAdNetworkHandling = EditorGUILayout.Toggle("SKAdNetwork Handling", adjust.skAdNetworkHandling); + adjust.adServices = EditorGUILayout.Toggle("AdServices Info Reading", adjust.adServices); + adjust.idfaReading = EditorGUILayout.Toggle("IDFA Info Reading", adjust.idfaReading); + adjust.skanAttribution = EditorGUILayout.Toggle("SKAdNetwork Handling", adjust.skanAttribution); EditorGUI.indentLevel -= 1; } diff --git a/Assets/Adjust/Editor/AdjustCustomEditor.cs.meta b/Assets/Adjust/Scripts/Editor/AdjustCustomEditor.cs.meta similarity index 100% rename from Assets/Adjust/Editor/AdjustCustomEditor.cs.meta rename to Assets/Adjust/Scripts/Editor/AdjustCustomEditor.cs.meta diff --git a/Assets/Adjust/Scripts/Editor/AdjustEditor.cs b/Assets/Adjust/Scripts/Editor/AdjustEditor.cs new file mode 100644 index 00000000..b38095fb --- /dev/null +++ b/Assets/Adjust/Scripts/Editor/AdjustEditor.cs @@ -0,0 +1,314 @@ +using System; +using System.IO; +using System.Linq; +using System.Xml; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using UnityEngine; +using UnityEditor; +using UnityEditor.Callbacks; +#if UNITY_IOS +using UnityEditor.iOS.Xcode; +#endif + +namespace AdjustSdk +{ + public class AdjustEditor : AssetPostprocessor + { + [MenuItem("Assets/Adjust/Export Unity Package")] + public static void ExportAdjustUnityPackage() + { + string exportedFileName = "Adjust.unitypackage"; + string assetsPath = "Assets/Adjust"; + List assetsToExport = new List(); + + // Adjust Assets. + assetsToExport.Add(assetsPath + "/3rd Party/SimpleJSON.cs"); + + assetsToExport.Add(assetsPath + "/Android/adjust-android.jar"); + assetsToExport.Add(assetsPath + "/Android/AdjustAndroid.cs"); + assetsToExport.Add(assetsPath + "/Android/AdjustAndroidManifest.xml"); + + assetsToExport.Add(assetsPath + "/Editor/AdjustEditor.cs"); + assetsToExport.Add(assetsPath + "/Editor/AdjustSettings.cs"); + assetsToExport.Add(assetsPath + "/Editor/AdjustSettingsEditor.cs"); + assetsToExport.Add(assetsPath + "/Editor/AdjustCustomEditor.cs"); + assetsToExport.Add(assetsPath + "/Editor/AdjustEditorPreprocessor.cs"); + + assetsToExport.Add(assetsPath + "/ExampleGUI/ExampleGUI.cs"); + assetsToExport.Add(assetsPath + "/ExampleGUI/ExampleGUI.prefab"); + assetsToExport.Add(assetsPath + "/ExampleGUI/ExampleGUI.unity"); + + assetsToExport.Add(assetsPath + "/iOS/ADJAttribution.h"); + assetsToExport.Add(assetsPath + "/iOS/ADJConfig.h"); + assetsToExport.Add(assetsPath + "/iOS/ADJEvent.h"); + assetsToExport.Add(assetsPath + "/iOS/ADJEventFailure.h"); + assetsToExport.Add(assetsPath + "/iOS/ADJEventSuccess.h"); + assetsToExport.Add(assetsPath + "/iOS/ADJLogger.h"); + assetsToExport.Add(assetsPath + "/iOS/ADJSessionFailure.h"); + assetsToExport.Add(assetsPath + "/iOS/ADJSessionSuccess.h"); + assetsToExport.Add(assetsPath + "/iOS/ADJSubscription.h"); + assetsToExport.Add(assetsPath + "/iOS/Adjust.h"); + assetsToExport.Add(assetsPath + "/iOS/AdjustiOS.cs"); + assetsToExport.Add(assetsPath + "/iOS/AdjustSdk.a"); + assetsToExport.Add(assetsPath + "/iOS/AdjustUnity.h"); + assetsToExport.Add(assetsPath + "/iOS/AdjustUnity.mm"); + assetsToExport.Add(assetsPath + "/iOS/AdjustUnityDelegate.h"); + assetsToExport.Add(assetsPath + "/iOS/AdjustUnityDelegate.mm"); + + assetsToExport.Add(assetsPath + "/Prefab/Adjust.prefab"); + + assetsToExport.Add(assetsPath + "/Unity/Adjust.cs"); + assetsToExport.Add(assetsPath + "/Unity/AdjustAppStoreSubscription.cs"); + assetsToExport.Add(assetsPath + "/Unity/AdjustAttribution.cs"); + assetsToExport.Add(assetsPath + "/Unity/AdjustConfig.cs"); + assetsToExport.Add(assetsPath + "/Unity/AdjustEnvironment.cs"); + assetsToExport.Add(assetsPath + "/Unity/AdjustEvent.cs"); + assetsToExport.Add(assetsPath + "/Unity/AdjustEventFailure.cs"); + assetsToExport.Add(assetsPath + "/Unity/AdjustEventSuccess.cs"); + assetsToExport.Add(assetsPath + "/Unity/AdjustLogLevel.cs"); + assetsToExport.Add(assetsPath + "/Unity/AdjustPlayStoreSubscription.cs"); + assetsToExport.Add(assetsPath + "/Unity/AdjustSessionFailure.cs"); + assetsToExport.Add(assetsPath + "/Unity/AdjustSessionSuccess.cs"); + assetsToExport.Add(assetsPath + "/Unity/AdjustUtils.cs"); + + AssetDatabase.ExportPackage( + assetsToExport.ToArray(), + exportedFileName, + ExportPackageOptions.IncludeDependencies | ExportPackageOptions.Interactive); + } + + [PostProcessBuild] + public static void OnPostprocessBuild(BuildTarget target, string projectPath) + { + RunPostBuildScript(target: target, projectPath: projectPath); + } + + private static void RunPostBuildScript(BuildTarget target, string projectPath = "") + { + if (target == BuildTarget.iOS) + { + #if UNITY_IOS + Debug.Log("[Adjust]: Starting to perform post build tasks for iOS platform."); + + string xcodeProjectPath = projectPath + "/Unity-iPhone.xcodeproj/project.pbxproj"; + + PBXProject xcodeProject = new PBXProject(); + xcodeProject.ReadFromFile(xcodeProjectPath); + + #if UNITY_2019_3_OR_NEWER + string xcodeTarget = xcodeProject.GetUnityMainTargetGuid(); + #else + string xcodeTarget = xcodeProject.TargetGuidByName("Unity-iPhone"); + #endif + HandlePlistIosChanges(projectPath); + + if (AdjustSettings.iOSUniversalLinksDomains.Length > 0) + { + AddUniversalLinkDomains(xcodeProject, xcodeProjectPath, xcodeTarget); + } + + // If enabled by the user, Adjust SDK will try to add following frameworks to your project: + // - AdSupport.framework (needed for access to IDFA value) + // - AdServices.framework (needed in case you are running ASA campaigns) + // - StoreKit.framework (needed for communication with SKAdNetwork framework) + // - AppTrackingTransparency.framework (needed for information about user's consent to be tracked) + // In case you don't need any of these, feel free to remove them from your app. + + if (AdjustSettings.iOSFrameworkAdSupport) + { + Debug.Log("[Adjust]: Adding AdSupport.framework to Xcode project."); + xcodeProject.AddFrameworkToProject(xcodeTarget, "AdSupport.framework", true); + Debug.Log("[Adjust]: AdSupport.framework added successfully."); + } + else + { + Debug.Log("[Adjust]: Skipping AdSupport.framework linking."); + } + if (AdjustSettings.iOSFrameworkAdServices) + { + Debug.Log("[Adjust]: Adding AdServices.framework to Xcode project."); + xcodeProject.AddFrameworkToProject(xcodeTarget, "AdServices.framework", true); + Debug.Log("[Adjust]: AdServices.framework added successfully."); + } + else + { + Debug.Log("[Adjust]: Skipping AdServices.framework linking."); + } + if (AdjustSettings.iOSFrameworkStoreKit) + { + Debug.Log("[Adjust]: Adding StoreKit.framework to Xcode project."); + xcodeProject.AddFrameworkToProject(xcodeTarget, "StoreKit.framework", true); + Debug.Log("[Adjust]: StoreKit.framework added successfully."); + } + else + { + Debug.Log("[Adjust]: Skipping StoreKit.framework linking."); + } + if (AdjustSettings.iOSFrameworkAppTrackingTransparency) + { + Debug.Log("[Adjust]: Adding AppTrackingTransparency.framework to Xcode project."); + xcodeProject.AddFrameworkToProject(xcodeTarget, "AppTrackingTransparency.framework", true); + Debug.Log("[Adjust]: AppTrackingTransparency.framework added successfully."); + } + else + { + Debug.Log("[Adjust]: Skipping AppTrackingTransparency.framework linking."); + } + + // The Adjust SDK needs to have Obj-C exceptions enabled. + // GCC_ENABLE_OBJC_EXCEPTIONS=YES + string xcodeTargetUnityFramework = xcodeProject.TargetGuidByName("UnityFramework"); + Debug.Log("[Adjust]: Enabling Obj-C exceptions by setting GCC_ENABLE_OBJC_EXCEPTIONS value to YES."); + xcodeProject.AddBuildProperty(xcodeTarget, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES"); + Debug.Log("[Adjust]: Obj-C exceptions enabled successfully."); + if (!string.IsNullOrEmpty(xcodeTargetUnityFramework)) + { + Debug.Log("[Adjust]: Enabling Obj-C exceptions by setting GCC_ENABLE_OBJC_EXCEPTIONS value to YES."); + xcodeProject.AddBuildProperty(xcodeTargetUnityFramework, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES"); + Debug.Log("[Adjust]: Obj-C exceptions enabled successfully."); + } + + if (xcodeProject.ContainsFileByProjectPath("Libraries/Adjust/Native/iOS/AdjustSigSdk.a")) + { + if (!string.IsNullOrEmpty(xcodeTargetUnityFramework)) + { + xcodeProject.AddBuildProperty(xcodeTargetUnityFramework, "OTHER_LDFLAGS", "-force_load $(PROJECT_DIR)/Libraries/Adjust/Native/iOS/AdjustSigSdk.a"); + } + else + { + xcodeProject.AddBuildProperty(xcodeTarget, "OTHER_LDFLAGS", "-force_load $(PROJECT_DIR)/Libraries/Adjust/Native/iOS/AdjustSigSdk.a"); + } + } + + // Save the changes to Xcode project file. + xcodeProject.WriteToFile(xcodeProjectPath); + #endif + } + } + + #if UNITY_IOS + private static void HandlePlistIosChanges(string projectPath) + { + const string UserTrackingUsageDescriptionKey = "NSUserTrackingUsageDescription"; + + // Check if needs to do any info plist change. + bool hasUserTrackingDescription = + !string.IsNullOrEmpty(AdjustSettings.iOSUserTrackingUsageDescription); + bool hasUrlSchemesDeepLinksEnabled = AdjustSettings.iOSUrlSchemes.Length > 0; + + if (!hasUserTrackingDescription && !hasUrlSchemesDeepLinksEnabled) + { + return; + } + + // Get and read info plist. + var plistPath = Path.Combine(projectPath, "Info.plist"); + var plist = new PlistDocument(); + plist.ReadFromFile(plistPath); + var plistRoot = plist.root; + + // Do the info plist changes. + if (hasUserTrackingDescription) + { + if (plistRoot[UserTrackingUsageDescriptionKey] != null) + { + Debug.Log("[Adjust]: Overwritting User Tracking Usage Description."); + } + plistRoot.SetString(UserTrackingUsageDescriptionKey, + AdjustSettings.iOSUserTrackingUsageDescription); + } + + if (hasUrlSchemesDeepLinksEnabled) + { + AddUrlSchemesIOS(plistRoot, AdjustSettings.iOSUrlIdentifier, AdjustSettings.iOSUrlSchemes); + } + + // Write any info plist change. + File.WriteAllText(plistPath, plist.WriteToString()); + } + + private static void AddUrlSchemesIOS(PlistElementDict plistRoot, string urlIdentifier, string[] urlSchemes) + { + // Set Array for futher deeplink values. + var urlTypesArray = CreatePlistElementArray(plistRoot, "CFBundleURLTypes"); + + // Array will contain just one deeplink dictionary + var urlSchemesItems = CreatePlistElementDict(urlTypesArray); + urlSchemesItems.SetString("CFBundleURLName", urlIdentifier); + var urlSchemesArray = CreatePlistElementArray(urlSchemesItems, "CFBundleURLSchemes"); + + // Delete old deferred deeplinks URIs + Debug.Log("[Adjust]: Removing deeplinks that already exist in the array to avoid duplicates."); + foreach (var link in urlSchemes) + { + urlSchemesArray.values.RemoveAll( + element => element != null && element.AsString().Equals(link)); + } + + Debug.Log("[Adjust]: Adding new deep links."); + foreach (var link in urlSchemes.Distinct()) + { + urlSchemesArray.AddString(link); + } + } + + private static PlistElementArray CreatePlistElementArray(PlistElementDict root, string key) + { + if (!root.values.ContainsKey(key)) + { + Debug.Log(string.Format("[Adjust]: {0} not found in Info.plist. Creating a new one.", key)); + return root.CreateArray(key); + } + var result = root.values[key].AsArray(); + return result != null ? result : root.CreateArray(key); + } + + private static PlistElementDict CreatePlistElementDict(PlistElementArray rootArray) + { + if (rootArray.values.Count == 0) + { + Debug.Log("[Adjust]: Deeplinks array doesn't contain dictionary for deeplinks. Creating a new one."); + return rootArray.AddDict(); + } + + var urlSchemesItems = rootArray.values[0].AsDict(); + Debug.Log("[Adjust]: Reading deeplinks array"); + if (urlSchemesItems == null) + { + Debug.Log("[Adjust]: Deeplinks array doesn't contain dictionary for deeplinks. Creating a new one."); + urlSchemesItems = rootArray.AddDict(); + } + + return urlSchemesItems; + } + + private static void AddUniversalLinkDomains(PBXProject project, string xCodeProjectPath, string xCodeTarget) + { + string entitlementsFileName = "Unity-iPhone.entitlements"; + + Debug.Log("[Adjust]: Adding associated domains to entitlements file."); + #if UNITY_2019_3_OR_NEWER + var projectCapabilityManager = new ProjectCapabilityManager(xCodeProjectPath, entitlementsFileName, null, project.GetUnityMainTargetGuid()); + #else + var projectCapabilityManager = new ProjectCapabilityManager(xCodeProjectPath, entitlementsFileName, PBXProject.GetUnityTargetName()); + #endif + var uniqueDomains = AdjustSettings.iOSUniversalLinksDomains.Distinct().ToArray(); + const string applinksPrefix = "applinks:"; + for (int i = 0; i < uniqueDomains.Length; i++) + { + if (!uniqueDomains[i].StartsWith(applinksPrefix)) + { + uniqueDomains[i] = applinksPrefix + uniqueDomains[i]; + } + } + + projectCapabilityManager.AddAssociatedDomains(uniqueDomains); + projectCapabilityManager.WriteToFile(); + + Debug.Log("[Adjust]: Enabling Associated Domains capability with created entitlements file."); + project.AddCapability(xCodeTarget, PBXCapabilityType.AssociatedDomains, entitlementsFileName); + } + #endif + } +} \ No newline at end of file diff --git a/Assets/Adjust/Editor/AdjustEditor.cs.meta b/Assets/Adjust/Scripts/Editor/AdjustEditor.cs.meta similarity index 100% rename from Assets/Adjust/Editor/AdjustEditor.cs.meta rename to Assets/Adjust/Scripts/Editor/AdjustEditor.cs.meta diff --git a/Assets/Adjust/Scripts/Editor/AdjustEditorPreprocessor.cs b/Assets/Adjust/Scripts/Editor/AdjustEditorPreprocessor.cs new file mode 100644 index 00000000..7d39e3c2 --- /dev/null +++ b/Assets/Adjust/Scripts/Editor/AdjustEditorPreprocessor.cs @@ -0,0 +1,368 @@ +using System.IO; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor.Build; +using UnityEditor; +using System.Xml; +using System; +using System.Text.RegularExpressions; +using System.Linq; + +namespace AdjustSdk +{ + #if UNITY_2018_1_OR_NEWER + public class AdjustEditorPreprocessor : IPreprocessBuildWithReport + #else + public class AdjustEditorPreprocessor : IPreprocessBuild + #endif + { + public int callbackOrder + { + get + { + return 0; + } + } + #if UNITY_2018_1_OR_NEWER + public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report) + { + OnPreprocessBuild(report.summary.platform, string.Empty); + } + #endif + + public void OnPreprocessBuild(BuildTarget target, string path) + { + if (target == BuildTarget.Android) + { + #if UNITY_ANDROID + RunPostProcessTasksAndroid(); + #endif + } + } + + #if UNITY_ANDROID + private static void RunPostProcessTasksAndroid() + { + var isAdjustManifestUsed = false; + var androidPluginsPath = Path.Combine(Application.dataPath, "Plugins/Android"); + var adjustManifestPath = Path.Combine(Application.dataPath, "Adjust/Native/Android/AdjustAndroidManifest.xml"); + var appManifestPath = Path.Combine(Application.dataPath, "Plugins/Android/AndroidManifest.xml"); + + // Check if user has already created AndroidManifest.xml file in its location. + // If not, use already predefined AdjustAndroidManifest.xml as default one. + if (!File.Exists(appManifestPath)) + { + if (!Directory.Exists(androidPluginsPath)) + { + Directory.CreateDirectory(androidPluginsPath); + } + + isAdjustManifestUsed = true; + File.Copy(adjustManifestPath, appManifestPath); + + Debug.Log("[Adjust]: User defined AndroidManifest.xml file not found in Plugins/Android folder."); + Debug.Log("[Adjust]: Creating default app's AndroidManifest.xml from AdjustAndroidManifest.xml file."); + } + else + { + Debug.Log("[Adjust]: User defined AndroidManifest.xml file located in Plugins/Android folder."); + } + + // Let's open the app's AndroidManifest.xml file. + var manifestFile = new XmlDocument(); + manifestFile.Load(appManifestPath); + + var manifestHasChanged = false; + + // If Adjust manifest is used, we have already set up everything in it so that + // our native Android SDK can be used properly. + if (!isAdjustManifestUsed) + { + // However, if you already had your own AndroidManifest.xml, we'll now run + // some checks on it and tweak it a bit if needed to add some stuff which + // our native Android SDK needs so that it can run properly. + + // Add needed permissions if they are missing. + manifestHasChanged |= AddPermissions(manifestFile); + + // Add intent filter to main activity if it is missing. + manifestHasChanged |= AddBroadcastReceiver(manifestFile); + } + + // Add intent filter to URL schemes for deeplinking + manifestHasChanged |= AddURISchemes(manifestFile); + + if (manifestHasChanged) + { + // Save the changes. + manifestFile.Save(appManifestPath); + + Debug.Log("[Adjust]: App's AndroidManifest.xml file check and potential modification completed."); + Debug.Log("[Adjust]: Please check if any error message was displayed during this process " + + "and make sure to fix all issues in order to properly use the Adjust SDK in your app."); + } + else + { + Debug.Log("[Adjust]: App's AndroidManifest.xml file check completed."); + Debug.Log("[Adjust]: No modifications performed due to app's AndroidManifest.xml file compatibility."); + } + } + + private static bool AddURISchemes(XmlDocument manifest) + { + if (AdjustSettings.AndroidUriSchemes.Length == 0) + { + return false; + } + Debug.Log("[Adjust]: Start addition of URI schemes"); + + var intentRoot = manifest.DocumentElement.SelectSingleNode("/manifest/application/activity[@android:name='com.unity3d.player.UnityPlayerActivity']", GetNamespaceManager(manifest)); + var usedIntentFiltersChanged = false; + var usedIntentFilters = GetIntentFilter(manifest); + foreach (var uriScheme in AdjustSettings.AndroidUriSchemes) + { + Uri uri; + try + { + // The first element is android:scheme and the second one is android:host. + uri = new Uri(uriScheme); + + // Uri class converts implicit file paths to explicit file paths with the file:// scheme. + if (!uriScheme.StartsWith(uri.Scheme)) + { + throw new UriFormatException(); + } + } + catch (UriFormatException) + { + Debug.LogError(string.Format("[Adjust]: Android deeplink URI scheme \"{0}\" is invalid and will be ignored.", uriScheme)); + Debug.LogWarning(string.Format("[Adjust]: Make sure that your URI scheme entry ends with ://")); + continue; + } + + if (!IsIntentFilterAlreadyExist(manifest, uri)) + { + Debug.Log("[Adjust]: Adding new URI with scheme: " + uri.Scheme + ", and host: " + uri.Host); + var androidSchemeNode = manifest.CreateElement("data"); + AddAndroidNamespaceAttribute(manifest, "scheme", uri.Scheme, androidSchemeNode); + AddAndroidNamespaceAttribute(manifest, "host", uri.Host, androidSchemeNode); + usedIntentFilters.AppendChild(androidSchemeNode); + usedIntentFiltersChanged = true; + + Debug.Log(string.Format("[Adjust]: Android deeplink URI scheme \"{0}\" successfully added to your app's AndroidManifest.xml file.", uriScheme)); + } + } + + if (usedIntentFiltersChanged && usedIntentFilters.ParentNode == null) + { + intentRoot.AppendChild(usedIntentFilters); + } + + return usedIntentFiltersChanged; + } + + private static XmlElement GetIntentFilter(XmlDocument manifest) + { + var xpath = "/manifest/application/activity/intent-filter[data/@android:scheme and data/@android:host]"; + var intentFilter = manifest.DocumentElement.SelectSingleNode(xpath, GetNamespaceManager(manifest)) as XmlElement; + if (intentFilter == null) + { + const string androidName = "name"; + const string category = "category"; + + intentFilter = manifest.CreateElement("intent-filter"); + + var actionElement = manifest.CreateElement("action"); + AddAndroidNamespaceAttribute(manifest, androidName, "android.intent.action.VIEW", actionElement); + intentFilter.AppendChild(actionElement); + + var defaultCategory = manifest.CreateElement(category); + AddAndroidNamespaceAttribute(manifest, androidName, "android.intent.category.DEFAULT", defaultCategory); + intentFilter.AppendChild(defaultCategory); + + var browsableCategory = manifest.CreateElement(category); + AddAndroidNamespaceAttribute(manifest, androidName, "android.intent.category.BROWSABLE", browsableCategory); + intentFilter.AppendChild(browsableCategory); + } + return intentFilter; + } + + private static bool IsIntentFilterAlreadyExist(XmlDocument manifest, Uri link) + { + var xpath = string.Format("/manifest/application/activity/intent-filter/data[@android:scheme='{0}' and @android:host='{1}']", link.Scheme, link.Host); + return manifest.DocumentElement.SelectSingleNode(xpath, GetNamespaceManager(manifest)) != null; + } + + private static bool AddPermissions(XmlDocument manifest) + { + // The Adjust SDK needs two permissions to be added to you app's manifest file: + // + // + // + // + + Debug.Log("[Adjust]: Checking if all permissions needed for the Adjust SDK are present in the app's AndroidManifest.xml file."); + + var manifestHasChanged = false; + + // If enabled by the user && android.permission.INTERNET permission is missing, add it. + if (AdjustSettings.androidPermissionInternet == true) + { + manifestHasChanged |= AddPermission(manifest, "android.permission.INTERNET"); + } + // If enabled by the user && com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE permission is missing, add it. + if (AdjustSettings.androidPermissionInstallReferrerService == true) + { + manifestHasChanged |= AddPermission(manifest, "com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE"); + } + // If enabled by the user && com.google.android.gms.permission.AD_ID permission is missing, add it. + if (AdjustSettings.androidPermissionAdId == true) + { + manifestHasChanged |= AddPermission(manifest, "com.google.android.gms.permission.AD_ID"); + } + // If enabled by the user && android.permission.ACCESS_NETWORK_STATE permission is missing, add it. + if (AdjustSettings.androidPermissionAccessNetworkState == true) + { + manifestHasChanged |= AddPermission(manifest, "android.permission.ACCESS_NETWORK_STATE"); + } + + return manifestHasChanged; + } + + private static bool AddPermission(XmlDocument manifest, string permissionValue) + { + if (DoesPermissionExist(manifest, permissionValue)) + { + Debug.Log(string.Format("[Adjust]: Your app's AndroidManifest.xml file already contains {0} permission.", permissionValue)); + return false; + } + + var element = manifest.CreateElement("uses-permission"); + AddAndroidNamespaceAttribute(manifest, "name", permissionValue, element); + manifest.DocumentElement.AppendChild(element); + Debug.Log(string.Format("[Adjust]: {0} permission successfully added to your app's AndroidManifest.xml file.", permissionValue)); + + return true; + } + + private static bool DoesPermissionExist(XmlDocument manifest, string permissionValue) + { + var xpath = string.Format("/manifest/uses-permission[@android:name='{0}']", permissionValue); + return manifest.DocumentElement.SelectSingleNode(xpath, GetNamespaceManager(manifest)) != null; + } + + private static bool AddBroadcastReceiver(XmlDocument manifest) + { + // We're looking for existence of broadcast receiver in the AndroidManifest.xml + // Check out the example below how that usually looks like: + + // > + // + // /> + // + // > + // + // + // + // + // + // + // + // + // + // + // + // > + // + // + + Debug.Log("[Adjust]: Checking if app's AndroidManifest.xml file contains receiver for INSTALL_REFERRER intent."); + + // Find the application node + var applicationNodeXpath = "/manifest/application"; + var applicationNode = manifest.DocumentElement.SelectSingleNode(applicationNodeXpath); + + // If there's no application node, something is really wrong with your AndroidManifest.xml. + if (applicationNode == null) + { + Debug.LogError("[Adjust]: Your app's AndroidManifest.xml file does not contain \"\" node."); + Debug.LogError("[Adjust]: Unable to add the Adjust broadcast receiver to AndroidManifest.xml."); + return false; + } + + // Okay, there's an application node in the AndroidManifest.xml file. + // Let's now check if user has already defined a receiver which is listening to INSTALL_REFERRER intent. + // If that is already defined, don't force the Adjust broadcast receiver to the manifest file. + // If not, add the Adjust broadcast receiver to the manifest file. + + var customBroadcastReceiversNodes = GetCustomRecieverNodes(manifest); + if (customBroadcastReceiversNodes.Count > 0) + { + if (DoesAdjustBroadcastReceiverExist(manifest)) + { + Debug.Log("[Adjust]: It seems like you are already using Adjust broadcast receiver. Yay."); + } + else + { + Debug.Log("[Adjust]: It seems like you are using your own broadcast receiver."); + Debug.Log("[Adjust]: Please, add the calls to the Adjust broadcast receiver like described in here: https://github.com/adjust/android_sdk/blob/master/doc/english/referrer.md"); + } + + return false; + } + + // Generate Adjust broadcast receiver entry and add it to the application node. + var receiverElement = manifest.CreateElement("receiver"); + AddAndroidNamespaceAttribute(manifest, "name", "com.adjust.sdk.AdjustReferrerReceiver", receiverElement); + AddAndroidNamespaceAttribute(manifest, "permission", "android.permission.INSTALL_PACKAGES", receiverElement); + AddAndroidNamespaceAttribute(manifest, "exported", "true", receiverElement); + + var intentFilterElement = manifest.CreateElement("intent-filter"); + var actionElement = manifest.CreateElement("action"); + AddAndroidNamespaceAttribute(manifest, "name", "com.android.vending.INSTALL_REFERRER", actionElement); + + intentFilterElement.AppendChild(actionElement); + receiverElement.AppendChild(intentFilterElement); + applicationNode.AppendChild(receiverElement); + + Debug.Log("[Adjust]: Adjust broadcast receiver successfully added to your app's AndroidManifest.xml file."); + + return true; + } + + private static bool DoesAdjustBroadcastReceiverExist(XmlDocument manifest) + { + var xpath = "/manifest/application/receiver[@android:name='com.adjust.sdk.AdjustReferrerReceiver']"; + return manifest.SelectSingleNode(xpath, GetNamespaceManager(manifest)) != null; + } + + private static List GetCustomRecieverNodes(XmlDocument manifest) + { + var xpath = "/manifest/application/receiver[intent-filter/action[@android:name='com.android.vending.INSTALL_REFERRER']]"; + return new List(manifest.DocumentElement.SelectNodes(xpath, GetNamespaceManager(manifest)).OfType()); + } + + private static void AddAndroidNamespaceAttribute(XmlDocument manifest, string key, string value, XmlElement node) + { + var androidSchemeAttribute = manifest.CreateAttribute("android", key, "http://schemas.android.com/apk/res/android"); + androidSchemeAttribute.InnerText = value; + node.SetAttributeNode(androidSchemeAttribute); + } + + private static XmlNamespaceManager GetNamespaceManager(XmlDocument manifest) + { + var namespaceManager = new XmlNamespaceManager(manifest.NameTable); + namespaceManager.AddNamespace("android", "http://schemas.android.com/apk/res/android"); + return namespaceManager; + } + #endif +} +} diff --git a/Assets/Adjust/Editor/AdjustEditorPreprocessor.cs.meta b/Assets/Adjust/Scripts/Editor/AdjustEditorPreprocessor.cs.meta similarity index 100% rename from Assets/Adjust/Editor/AdjustEditorPreprocessor.cs.meta rename to Assets/Adjust/Scripts/Editor/AdjustEditorPreprocessor.cs.meta diff --git a/Assets/Adjust/Scripts/Editor/AdjustSdk.Editor.asmdef b/Assets/Adjust/Scripts/Editor/AdjustSdk.Editor.asmdef new file mode 100644 index 00000000..3017f9f3 --- /dev/null +++ b/Assets/Adjust/Scripts/Editor/AdjustSdk.Editor.asmdef @@ -0,0 +1,10 @@ +{ + "name": "AdjustSdk.Editor", + "references": [ + "AdjustSdk.Scripts" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [] +} \ No newline at end of file diff --git a/Assets/Adjust/Scripts/Editor/AdjustSdk.Editor.asmdef.meta b/Assets/Adjust/Scripts/Editor/AdjustSdk.Editor.asmdef.meta new file mode 100644 index 00000000..818692ad --- /dev/null +++ b/Assets/Adjust/Scripts/Editor/AdjustSdk.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: afc3483c5bcfe43c4a7a6b7f99b52a07 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/Scripts/Editor/AdjustSettings.cs b/Assets/Adjust/Scripts/Editor/AdjustSettings.cs new file mode 100644 index 00000000..c5332e81 --- /dev/null +++ b/Assets/Adjust/Scripts/Editor/AdjustSettings.cs @@ -0,0 +1,194 @@ +// Inspired by: https://github.com/facebook/facebook-sdk-for-unity/blob/master/Facebook.Unity.Settings/FacebookSettings.cs + +using System.Collections.Generic; +using System.IO; +using UnityEditor; +using UnityEngine; + +namespace AdjustSdk +{ + public class AdjustSettings : ScriptableObject + { + private static AdjustSettings instance; + public const string AdjustSettingsExportPath = "Adjust/Resources/AdjustSettings.asset"; + + [SerializeField] + private bool _iOSFrameworkAdSupport = true; + [SerializeField] + private bool _iOSFrameworkAdServices = false; + [SerializeField] + private bool _iOSFrameworkAppTrackingTransparency = false; + [SerializeField] + private bool _iOSFrameworkStoreKit = false; + [SerializeField] + private bool _androidPermissionInternet = true; + [SerializeField] + private bool _androidPermissionInstallReferrerService = true; + [SerializeField] + private bool _androidPermissionAdId = true; + [SerializeField] + private bool _androidPermissionAccessNetworkState = false; + [SerializeField] + private string _iOSUserTrackingUsageDescription; + [SerializeField] + private string _iOSUrlIdentifier; + [SerializeField] + private string[] _iOSUrlSchemes = new string[0]; + [SerializeField] + private string[] _iOSUniversalLinksDomains = new string[0]; + [SerializeField] + private string[] androidUriSchemes = new string[0]; + + public static AdjustSettings Instance + { + get + { + instance = NullableInstance; + + if (instance == null) + { + // Create AdjustSettings.asset inside the folder in which AdjustSettings.cs reside. + instance = ScriptableObject.CreateInstance(); + var guids = AssetDatabase.FindAssets(string.Format("{0} t:script", "AdjustSettings")); + if (guids == null || guids.Length <= 0) + { + return instance; + } + + var assetPath = AssetDatabase.GUIDToAssetPath(guids[0]).Replace("AdjustSettings.cs", "AdjustSettings.asset"); + Debug.Log("READ PATH = " + assetPath); + // AdjustSettings.asset will be stored inside of the Adjust/Resources directory + if (assetPath.StartsWith("Assets")) + { + // plugin located in Assets directory + string rootDir = assetPath.Replace("/Adjust/Scripts/Editor/AdjustSettings.asset", ""); + Debug.Log("ROOT DIR = " + rootDir); + string adjustResourcesPath = Path.Combine(rootDir, "Adjust/Resources"); + Debug.Log("ADJUST RESOURCES DIR = " + adjustResourcesPath); + if (!Directory.Exists(adjustResourcesPath)) + { + Debug.Log("CREATING ADJUST RESOURCES DIR = " + adjustResourcesPath); + Directory.CreateDirectory(adjustResourcesPath); + } + assetPath = Path.Combine(rootDir, AdjustSettingsExportPath); + Debug.Log("FINAL ASSET PATH = " + assetPath); + } + else + { + // plugin located in Packages folder + string adjustResourcesPath = Path.Combine("Assets", "Adjust/Resources"); + Debug.Log("ADJUST RESOURCES DIR = " + adjustResourcesPath); + if (!Directory.Exists(adjustResourcesPath)) + { + Debug.Log("CREATING ADJUST RESOURCES DIR = " + adjustResourcesPath); + Directory.CreateDirectory(adjustResourcesPath); + } + assetPath = Path.Combine("Assets", AdjustSettingsExportPath); + Debug.Log("FINAL ASSET PATH = " + assetPath); + } + + AssetDatabase.CreateAsset(instance, assetPath); + } + + return instance; + } + } + + public static AdjustSettings NullableInstance + { + get + { + if (instance == null) + { + var guids = AssetDatabase.FindAssets(string.Format("{0} t:ScriptableObject", "AdjustSettings")); + if (guids == null || guids.Length <= 0) + { + return instance; + } + var assetPath = AssetDatabase.GUIDToAssetPath(guids[0]); + instance = (AdjustSettings)AssetDatabase.LoadAssetAtPath(assetPath, typeof(AdjustSettings)); + } + + return instance; + } + } + + public static bool iOSFrameworkAdSupport + { + get { return Instance._iOSFrameworkAdSupport; } + set { Instance._iOSFrameworkAdSupport = value; } + } + + public static bool iOSFrameworkAdServices + { + get { return Instance._iOSFrameworkAdServices; } + set { Instance._iOSFrameworkAdServices = value; } + } + + public static bool iOSFrameworkAppTrackingTransparency + { + get { return Instance._iOSFrameworkAppTrackingTransparency; } + set { Instance._iOSFrameworkAppTrackingTransparency = value; } + } + + public static bool iOSFrameworkStoreKit + { + get { return Instance._iOSFrameworkStoreKit; } + set { Instance._iOSFrameworkStoreKit = value; } + } + + public static bool androidPermissionInternet + { + get { return Instance._androidPermissionInternet; } + set { Instance._androidPermissionInternet = value; } + } + + public static bool androidPermissionInstallReferrerService + { + get { return Instance._androidPermissionInstallReferrerService; } + set { Instance._androidPermissionInstallReferrerService = value; } + } + + public static bool androidPermissionAdId + { + get { return Instance._androidPermissionAdId; } + set { Instance._androidPermissionAdId = value; } + } + + public static bool androidPermissionAccessNetworkState + { + get { return Instance._androidPermissionAccessNetworkState; } + set { Instance._androidPermissionAccessNetworkState = value; } + } + + public static string iOSUserTrackingUsageDescription + { + get { return Instance._iOSUserTrackingUsageDescription; } + set { Instance._iOSUserTrackingUsageDescription = value; } + } + + public static string iOSUrlIdentifier + { + get { return Instance._iOSUrlIdentifier; } + set { Instance._iOSUrlIdentifier = value; } + } + + public static string[] iOSUrlSchemes + { + get { return Instance._iOSUrlSchemes; } + set { Instance._iOSUrlSchemes = value; } + } + + public static string[] iOSUniversalLinksDomains + { + get { return Instance._iOSUniversalLinksDomains; } + set { Instance._iOSUniversalLinksDomains = value; } + } + + public static string[] AndroidUriSchemes + { + get { return Instance.androidUriSchemes; } + set { Instance.androidUriSchemes = value; } + } + } +} diff --git a/Assets/Adjust/Editor/AdjustSettings.cs.meta b/Assets/Adjust/Scripts/Editor/AdjustSettings.cs.meta similarity index 100% rename from Assets/Adjust/Editor/AdjustSettings.cs.meta rename to Assets/Adjust/Scripts/Editor/AdjustSettings.cs.meta diff --git a/Assets/Adjust/Editor/AdjustSettingsEditor.cs b/Assets/Adjust/Scripts/Editor/AdjustSettingsEditor.cs similarity index 99% rename from Assets/Adjust/Editor/AdjustSettingsEditor.cs rename to Assets/Adjust/Scripts/Editor/AdjustSettingsEditor.cs index ec49d76e..bde2addd 100644 --- a/Assets/Adjust/Editor/AdjustSettingsEditor.cs +++ b/Assets/Adjust/Scripts/Editor/AdjustSettingsEditor.cs @@ -2,7 +2,7 @@ using UnityEngine; using UnityEditor; -namespace com.adjust.sdk +namespace AdjustSdk { [CustomEditor(typeof(AdjustSettings))] public class AdjustSettingsEditor : Editor diff --git a/Assets/Adjust/Editor/AdjustSettingsEditor.cs.meta b/Assets/Adjust/Scripts/Editor/AdjustSettingsEditor.cs.meta similarity index 100% rename from Assets/Adjust/Editor/AdjustSettingsEditor.cs.meta rename to Assets/Adjust/Scripts/Editor/AdjustSettingsEditor.cs.meta diff --git a/Assets/Adjust/Scripts/ThirdParty.meta b/Assets/Adjust/Scripts/ThirdParty.meta new file mode 100644 index 00000000..660b2e8d --- /dev/null +++ b/Assets/Adjust/Scripts/ThirdParty.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 638019d211e7141b7a78db997a91d582 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/3rd Party/SimpleJSON.cs b/Assets/Adjust/Scripts/ThirdParty/SimpleJSON.cs similarity index 99% rename from Assets/Adjust/3rd Party/SimpleJSON.cs rename to Assets/Adjust/Scripts/ThirdParty/SimpleJSON.cs index 0d85e5df..b249d7a1 100644 --- a/Assets/Adjust/3rd Party/SimpleJSON.cs +++ b/Assets/Adjust/Scripts/ThirdParty/SimpleJSON.cs @@ -47,8 +47,7 @@ using System.Collections.Generic; using System.Linq; - -namespace com.adjust.sdk +namespace AdjustSdk { public enum JSONBinaryTag { diff --git a/Assets/Adjust/3rd Party/SimpleJSON.cs.meta b/Assets/Adjust/Scripts/ThirdParty/SimpleJSON.cs.meta similarity index 100% rename from Assets/Adjust/3rd Party/SimpleJSON.cs.meta rename to Assets/Adjust/Scripts/ThirdParty/SimpleJSON.cs.meta diff --git a/Assets/Adjust/Test/TestApp.cs b/Assets/Adjust/Test/TestApp.cs deleted file mode 100644 index 4bacf9e1..00000000 --- a/Assets/Adjust/Test/TestApp.cs +++ /dev/null @@ -1,112 +0,0 @@ -#if (UNITY_ANDROID || UNITY_IOS) -using System; -#endif -using UnityEngine; - -namespace com.adjust.sdk.test -{ - public class TestApp : MonoBehaviour - { - public static readonly string TAG = "[TestApp]"; - -#if UNITY_ANDROID - private const string PORT = ":8443"; - private const string PROTOCOL = "https://"; - private const string IP = "192.168.8.65"; -#elif UNITY_IOS - private const string PORT = ":8080"; - private const string PROTOCOL = "http://"; - private const string IP = "192.168.8.65"; - private TestLibraryiOS _testLibraryiOS; -#else - private const string PORT = ":8080"; - private const string PROTOCOL = "http://"; - private const string IP = "localhost"; -#endif - private const string OVERWRITE_URL = PROTOCOL + IP + PORT; - private const string CONTROL_URL = "ws://" + IP + ":1987"; - - void OnGUI() - { - if (GUI.Button(new Rect(0, Screen.height * 0 / 2, Screen.width, Screen.height / 2), "Start test")) - { - StartTestSession(); - } - } - - private void StartTestSession() - { - ITestLibrary testLibrary = GetPlatformSpecificTestLibrary(); -#if UNITY_IOS - _testLibraryiOS = testLibrary as TestLibraryiOS; -#endif - // Set specific tests to run. - // testLibrary.AddTest("Test_PurchaseVerification_android_after_install"); - // testLibrary.AddTestDirectory ("purchase-verification"); - - Log("Starting test session."); - testLibrary.StartTestSession(); - } - - private ITestLibrary GetPlatformSpecificTestLibrary() - { -#if UNITY_IOS - return new TestLibraryiOS(OVERWRITE_URL, CONTROL_URL); -#elif UNITY_ANDROID - return new TestLibraryAndroid(OVERWRITE_URL, CONTROL_URL); -#elif (UNITY_WSA || UNITY_WP8) - return new TestLibraryWindows( - OVERWRITE_URL, - CONTROL_URL, - OVERWRITE_URL); -#else - Debug.Log("Cannot run integration tests (Error in TestApp.GetPlatformSpecificTestLibrary(...)). None of the supported platforms selected."); - return null; -#endif - } - -#if UNITY_IOS - public void ExecuteCommand(string commandJson) - { - _testLibraryiOS.ExecuteCommand(commandJson); - } -#endif - public static void Log(string message, bool useUnityDebug = false) - { -#if UNITY_ANDROID - var now = DateTime.Now; - string currentTimeString = string.Format("{0}:{1}", now.ToShortTimeString(), now.Second); - string output = string.Format("[{0}{1}]: {2}", currentTimeString, TAG, message); - if (!useUnityDebug) - { - Console.WriteLine(output); - } - else - { - Debug.Log(output); - } -#else - Debug.Log(message); -#endif - } - - public static void LogError(string message, bool useUnityDebug = false) - { -#if UNITY_ANDROID - var now = DateTime.Now; - string currentTimeString = string.Format("{0}:{1}", now.ToShortTimeString(), now.Second); - string output = string.Format("[{0}{1}][Error!]: {2}", currentTimeString, TAG, message); - if (!useUnityDebug) - { - Console.WriteLine(output); - } - else - { - Debug.Log(output); - } -#else - Debug.LogError(message); -#endif - } - } -} diff --git a/Assets/Adjust/Test/TestApp.unity.meta b/Assets/Adjust/Test/TestApp.unity.meta deleted file mode 100644 index ccc05da9..00000000 --- a/Assets/Adjust/Test/TestApp.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0f115ce993a9b468e9392f3bac9fcfd8 -timeCreated: 1565086815 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Test/TestLibraryWindows.cs b/Assets/Adjust/Test/TestLibraryWindows.cs deleted file mode 100644 index 6ac88cd2..00000000 --- a/Assets/Adjust/Test/TestLibraryWindows.cs +++ /dev/null @@ -1,72 +0,0 @@ -#if (UNITY_WSA || UNITY_WP8) -using TestLibraryInterface; -#endif -using System; - -namespace com.adjust.sdk.test -{ - public class TestLibraryWindows : ITestLibrary - { -#if (UNITY_WSA || UNITY_WP8) - private readonly TestLibraryInterface.TestLibraryInterface _testLibraryInterface - = new TestLibraryInterface.TestLibraryInterface(); - - public TestLibraryWindows(string baseUrl, string controlUrl, string gdprUrl) - { - IAdjustCommandExecutor adjustCommandExecutor = new CommandExecutor(this, baseUrl, gdprUrl); - _testLibraryInterface.Init(adjustCommandExecutor, baseUrl, controlUrl, UnityEngine.Debug.Log); - } - - public void StartTestSession() - { - TestApp.Log("TestLibrary -> StartTestSession()"); - _testLibraryInterface.StartTestSession(Adjust.getSdkVersion()); - } - - public void AddInfoToSend(string key, string paramValue) - { - _testLibraryInterface.AddInfoToSend(key, paramValue); - } - - public void SendInfoToServer(string basePath) - { - _testLibraryInterface.SendInfoToServer(basePath); - } - - public void AddTest(string testName) - { - _testLibraryInterface.AddTest(testName); - } - - public void AddTestDirectory(string testDirectory) - { - _testLibraryInterface.AddTestDirectory(testDirectory); - } -#else - public void StartTestSession() - { - throw new NotImplementedException(); - } - - public void AddInfoToSend(string key, string paramValue) - { - throw new NotImplementedException(); - } - - public void SendInfoToServer(string basePath) - { - throw new NotImplementedException(); - } - - public void AddTest(string testName) - { - throw new NotImplementedException(); - } - - public void AddTestDirectory(string testDirectory) - { - throw new NotImplementedException(); - } -#endif - } -} diff --git a/Assets/Adjust/Test/TestLibraryWindows.cs.meta b/Assets/Adjust/Test/TestLibraryWindows.cs.meta deleted file mode 100644 index f9687fca..00000000 --- a/Assets/Adjust/Test/TestLibraryWindows.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 82990e0b1d69e490d95ff8c7974f0a70 -timeCreated: 1565086819 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Unity.meta b/Assets/Adjust/Unity.meta deleted file mode 100644 index bf99afe0..00000000 --- a/Assets/Adjust/Unity.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1ac00d53de34e29419cae749db3f6528 -folderAsset: yes -timeCreated: 1578652520 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Unity/Adjust.cs b/Assets/Adjust/Unity/Adjust.cs deleted file mode 100644 index 269adf7d..00000000 --- a/Assets/Adjust/Unity/Adjust.cs +++ /dev/null @@ -1,1250 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace com.adjust.sdk -{ - public class Adjust : MonoBehaviour - { - private const string errorMsgEditor = "[Adjust]: SDK can not be used in Editor."; - 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."; - - // [Header("SDK SETTINGS:")] - // [Space(5)] - // [Tooltip("If selected, it is expected from you to initialize Adjust SDK from your app code. " + - // "Any SDK configuration settings from prefab will be ignored in that case.")] - [HideInInspector] - public bool startManually = true; - [HideInInspector] - public string appToken; - [HideInInspector] - public AdjustEnvironment environment = AdjustEnvironment.Sandbox; - [HideInInspector] - public AdjustLogLevel logLevel = AdjustLogLevel.Info; - [HideInInspector] - public bool eventBuffering = false; - [HideInInspector] - public bool sendInBackground = false; - [HideInInspector] - public bool launchDeferredDeeplink = true; - [HideInInspector] - public bool needsCost = false; - [HideInInspector] - public bool coppaCompliant = false; - [HideInInspector] - public bool linkMe = false; - [HideInInspector] - public string defaultTracker; - [HideInInspector] - public AdjustUrlStrategy urlStrategy = AdjustUrlStrategy.Default; - [HideInInspector] - public double startDelay = 0; - - // [Header("APP SECRET:")] - // [Space(5)] - [HideInInspector] - public long secretId = 0; - [HideInInspector] - public long info1 = 0; - [HideInInspector] - public long info2 = 0; - [HideInInspector] - public long info3 = 0; - [HideInInspector] - public long info4 = 0; - - // [Header("ANDROID SPECIFIC FEATURES:")] - // [Space(5)] - [HideInInspector] - public bool preinstallTracking = false; - [HideInInspector] - public string preinstallFilePath; - [HideInInspector] - public bool playStoreKidsApp = false; - - // [Header("iOS SPECIFIC FEATURES:")] - // [Space(5)] - [HideInInspector] - public bool adServicesInfoReading = true; - [HideInInspector] - public bool idfaInfoReading = true; - [HideInInspector] - public bool skAdNetworkHandling = true; - -#if UNITY_IOS - // Delegate references for iOS callback triggering - private static List> authorizationStatusDelegates = null; - private static Action deferredDeeplinkDelegate = null; - private static Action eventSuccessDelegate = null; - private static Action eventFailureDelegate = null; - private static Action sessionSuccessDelegate = null; - private static Action sessionFailureDelegate = null; - private static Action attributionChangedDelegate = null; - private static Action conversionValueUpdatedDelegate = null; - private static Action skad4ConversionValueUpdatedDelegate = null; - private static Action skadUpdateConversionValueDelegate = null; - private static Action skad4UpdateConversionValueDelegate = null; - private static Action verificationInfoDelegate = null; - private static Action deeplinkResolutionDelegate = null; -#endif - - void Awake() - { - if (IsEditor()) - { - return; - } - - DontDestroyOnLoad(transform.gameObject); - -#if UNITY_ANDROID && UNITY_2019_2_OR_NEWER - Application.deepLinkActivated += Adjust.appWillOpenUrl; - if (!string.IsNullOrEmpty(Application.absoluteURL)) - { - // Cold start and Application.absoluteURL not null so process Deep Link. - Adjust.appWillOpenUrl(Application.absoluteURL); - } -#endif - - 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); - adjustConfig.setDefaultTracker(this.defaultTracker); - adjustConfig.setUrlStrategy(this.urlStrategy.ToLowerCaseString()); - adjustConfig.setAppSecret(this.secretId, this.info1, this.info2, this.info3, this.info4); - adjustConfig.setDelayStart(this.startDelay); - adjustConfig.setNeedsCost(this.needsCost); - adjustConfig.setPreinstallTrackingEnabled(this.preinstallTracking); - adjustConfig.setPreinstallFilePath(this.preinstallFilePath); - adjustConfig.setAllowAdServicesInfoReading(this.adServicesInfoReading); - adjustConfig.setAllowIdfaReading(this.idfaInfoReading); - adjustConfig.setCoppaCompliantEnabled(this.coppaCompliant); - adjustConfig.setPlayStoreKidsAppEnabled(this.playStoreKidsApp); - adjustConfig.setLinkMeEnabled(this.linkMe); - if (!skAdNetworkHandling) - { - adjustConfig.deactivateSKAdNetworkHandling(); - } - Adjust.start(adjustConfig); - } - } - - void OnApplicationPause(bool pauseStatus) - { - if (IsEditor()) - { - return; - } - -#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 - } - - public static void start(AdjustConfig adjustConfig) - { - if (IsEditor()) - { - 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(); - Adjust.conversionValueUpdatedDelegate = adjustConfig.getConversionValueUpdatedDelegate(); - Adjust.skad4ConversionValueUpdatedDelegate = adjustConfig.getSkad4ConversionValueUpdatedDelegate(); - 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 (IsEditor()) - { - 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 - } - - public static void setEnabled(bool enabled) - { - if (IsEditor()) - { - return; - } - -#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 (IsEditor()) - { - return false; - } - -#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 - } - - public static void setOfflineMode(bool enabled) - { - if (IsEditor()) - { - return; - } - -#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 (IsEditor()) - { - return; - } - -#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 gdprForgetMe() - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - AdjustiOS.GdprForgetMe(); -#elif UNITY_ANDROID - AdjustAndroid.GdprForgetMe(); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.GdprForgetMe(); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void disableThirdPartySharing() - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - AdjustiOS.DisableThirdPartySharing(); -#elif UNITY_ANDROID - AdjustAndroid.DisableThirdPartySharing(); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Disable third party sharing is only supported for Android and iOS platforms."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void appWillOpenUrl(string url) - { - if (IsEditor()) - { - return; - } - -#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 (IsEditor()) - { - return; - } - -#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 (IsEditor()) - { - return; - } - -#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 (IsEditor()) - { - return; - } - -#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 (IsEditor()) - { - return; - } - -#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 (IsEditor()) - { - return; - } - -#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 (IsEditor()) - { - return; - } - -#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 (IsEditor()) - { - return; - } - -#if UNITY_IOS - AdjustiOS.ResetSessionCallbackParameters(); -#elif UNITY_ANDROID - AdjustAndroid.ResetSessionCallbackParameters(); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.ResetSessionCallbackParameters(); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void trackAdRevenue(string source, string payload) - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - AdjustiOS.TrackAdRevenue(source, payload); -#elif UNITY_ANDROID - AdjustAndroid.TrackAdRevenue(source, payload); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Ad revenue tracking is only supported for Android and iOS platforms."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void trackAdRevenue(AdjustAdRevenue adRevenue) - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - AdjustiOS.TrackAdRevenue(adRevenue); -#elif UNITY_ANDROID - AdjustAndroid.TrackAdRevenue(adRevenue); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Ad revenue tracking is only supported for Android and iOS platforms."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void trackAppStoreSubscription(AdjustAppStoreSubscription subscription) - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - AdjustiOS.TrackAppStoreSubscription(subscription); -#elif UNITY_ANDROID - Debug.Log("[Adjust]: App Store subscription tracking is only supported for iOS platform."); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: App Store subscription tracking is only supported for iOS platform."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void trackPlayStoreSubscription(AdjustPlayStoreSubscription subscription) - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - Debug.Log("[Adjust]: Play Store subscription tracking is only supported for Android platform."); -#elif UNITY_ANDROID - AdjustAndroid.TrackPlayStoreSubscription(subscription); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Play Store subscription tracking is only supported for Android platform."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void trackThirdPartySharing(AdjustThirdPartySharing thirdPartySharing) - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - AdjustiOS.TrackThirdPartySharing(thirdPartySharing); -#elif UNITY_ANDROID - AdjustAndroid.TrackThirdPartySharing(thirdPartySharing); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Third party sharing tracking is only supported for iOS and Android platforms."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void trackMeasurementConsent(bool measurementConsent) - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - AdjustiOS.TrackMeasurementConsent(measurementConsent); -#elif UNITY_ANDROID - AdjustAndroid.TrackMeasurementConsent(measurementConsent); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Measurement consent tracking is only supported for iOS and Android platforms."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void requestTrackingAuthorizationWithCompletionHandler(Action statusCallback, string sceneName = "Adjust") - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - if (Adjust.authorizationStatusDelegates == null) - { - Adjust.authorizationStatusDelegates = new List>(); - } - Adjust.authorizationStatusDelegates.Add(statusCallback); - AdjustiOS.RequestTrackingAuthorizationWithCompletionHandler(sceneName); -#elif UNITY_ANDROID - Debug.Log("[Adjust]: Requesting tracking authorization is only supported for iOS platform."); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Requesting tracking authorization is only supported for iOS platform."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void updateConversionValue(int conversionValue) - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - AdjustiOS.UpdateConversionValue(conversionValue); -#elif UNITY_ANDROID - Debug.Log("[Adjust]: Updating SKAdNetwork conversion value is only supported for iOS platform."); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Updating SKAdNetwork conversion value is only supported for iOS platform."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void updateConversionValue(int conversionValue, Action completionCallback, string sceneName = "Adjust") - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - Adjust.skadUpdateConversionValueDelegate = completionCallback; - AdjustiOS.UpdateConversionValue(conversionValue, sceneName); -#elif UNITY_ANDROID - Debug.Log("[Adjust]: Updating SKAdNetwork conversion value is only supported for iOS platform."); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Updating SKAdNetwork conversion value is only supported for iOS platform."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void updateConversionValue(int conversionValue, string coarseValue, bool lockWindow, Action completionCallback, string sceneName = "Adjust") - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - Adjust.skad4UpdateConversionValueDelegate = completionCallback; - AdjustiOS.UpdateConversionValue(conversionValue, coarseValue, lockWindow, sceneName); -#elif UNITY_ANDROID - Debug.Log("[Adjust]: Updating SKAdNetwork conversion value is only supported for iOS platform."); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Updating SKAdNetwork conversion value is only supported for iOS platform."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void checkForNewAttStatus() - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - AdjustiOS.CheckForNewAttStatus(); -#elif UNITY_ANDROID - Debug.Log("[Adjust]: Checking for new ATT status is only supported for iOS platform."); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Checking for new ATT status is only supported for iOS platform."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static int getAppTrackingAuthorizationStatus() - { - if (IsEditor()) - { - return -1; - } - -#if UNITY_IOS - return AdjustiOS.GetAppTrackingAuthorizationStatus(); -#elif UNITY_ANDROID - Debug.Log("[Adjust]: Error! App tracking authorization status is only supported for iOS platform."); - return -1; -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Error! App tracking authorization status is only supported for iOS platform."); - return -1; -#else - Debug.Log(errorMsgPlatform); - return -1; -#endif - } - - public static string getAdid() - { - if (IsEditor()) - { - return string.Empty; - } - -#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 - } - - public static AdjustAttribution getAttribution() - { - if (IsEditor()) - { - return null; - } - -#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 - } - - public static string getWinAdid() - { - if (IsEditor()) - { - return string.Empty; - } - -#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 - } - - public static string getIdfa() - { - if (IsEditor()) - { - return string.Empty; - } - -#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 - } - - public static string getIdfv() - { - if (IsEditor()) - { - return string.Empty; - } - -#if UNITY_IOS - return AdjustiOS.GetIdfv(); -#elif UNITY_ANDROID - Debug.Log("[Adjust]: Error! IDFV is not available on Android platform."); - return string.Empty; -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Error! IDFV is not available on Windows platform."); - return string.Empty; -#else - Debug.Log(errorMsgPlatform); - return string.Empty; -#endif - } - - public static string getSdkVersion() - { - if (IsEditor()) - { - return string.Empty; - } - -#if UNITY_IOS - return AdjustiOS.GetSdkVersion(); -#elif UNITY_ANDROID - return AdjustAndroid.GetSdkVersion(); -#elif (UNITY_WSA || UNITY_WP8) - return AdjustWindows.GetSdkVersion(); -#else - Debug.Log(errorMsgPlatform); - return string.Empty; -#endif - } - - [Obsolete("This method is intended for testing purposes only. Do not use it.")] - public static void setReferrer(string referrer) - { - if (IsEditor()) - { - return; - } - -#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 (IsEditor()) - { - return; - } - -#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 (IsEditor()) - { - return string.Empty; - } - -#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 - } - - public static string getLastDeeplink() - { - if (IsEditor()) - { - return string.Empty; - } - -#if UNITY_IOS - return AdjustiOS.GetLastDeeplink(); -#elif UNITY_ANDROID - Debug.Log("[Adjust]: Error! Last deeplink getter is not available on Android platform."); - return string.Empty; -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Error! Last deeplink getter is not available on Windows platform."); - return string.Empty; -#else - Debug.Log(errorMsgPlatform); - return string.Empty; -#endif - } - - public static void verifyAppStorePurchase( - AdjustAppStorePurchase purchase, - Action verificationInfoDelegate, - string sceneName = "Adjust") - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - if (purchase == null || - purchase.transactionId == null || - purchase.productId == null || - purchase.receipt == null) - { - Debug.Log("[Adjust]: Invalid App Store purchase parameters."); - return; - } - - Adjust.verificationInfoDelegate = verificationInfoDelegate; - AdjustiOS.VerifyAppStorePurchase(purchase, sceneName); -#elif UNITY_ANDROID - Debug.Log("[Adjust]: App Store purchase verification is only supported for iOS platform."); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: App Store purchase verification is only supported for iOS platform."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void verifyPlayStorePurchase( - AdjustPlayStorePurchase purchase, - Action verificationInfoDelegate) - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - Debug.Log("[Adjust]: Play Store purchase verification is only supported for Android platform."); -#elif UNITY_ANDROID - if (purchase == null || - purchase.productId == null || - purchase.purchaseToken == null) - { - Debug.Log("[Adjust]: Invalid Play Store purchase parameters."); - return; - } - - AdjustAndroid.VerifyPlayStorePurchase(purchase, verificationInfoDelegate); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Play Store purchase verification is only supported for Android platform."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - - public static void processDeeplink( - string url, - Action resolvedLinkDelegate, - string sceneName = "Adjust") - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - Adjust.deeplinkResolutionDelegate = resolvedLinkDelegate; - AdjustiOS.ProcessDeeplink(url, sceneName); -#elif UNITY_ANDROID - AdjustAndroid.ProcessDeeplink(url, resolvedLinkDelegate); -#elif (UNITY_WSA || UNITY_WP8) - Debug.Log("[Adjust]: Deep link processing is only supported for Android and iOS platform."); -#else - Debug.Log(errorMsgPlatform); -#endif - } - -#if UNITY_IOS - public void GetNativeAttribution(string attributionData) - { - if (IsEditor()) - { - return; - } - - if (Adjust.attributionChangedDelegate == null) - { - Debug.Log("[Adjust]: Attribution changed delegate was not set."); - return; - } - - var attribution = new AdjustAttribution(attributionData); - Adjust.attributionChangedDelegate(attribution); - } - - public void GetNativeEventSuccess(string eventSuccessData) - { - if (IsEditor()) - { - return; - } - - if (Adjust.eventSuccessDelegate == null) - { - Debug.Log("[Adjust]: Event success delegate was not set."); - return; - } - - var eventSuccess = new AdjustEventSuccess(eventSuccessData); - Adjust.eventSuccessDelegate(eventSuccess); - } - - public void GetNativeEventFailure(string eventFailureData) - { - if (IsEditor()) - { - return; - } - - if (Adjust.eventFailureDelegate == null) - { - Debug.Log("[Adjust]: Event failure delegate was not set."); - return; - } - - var eventFailure = new AdjustEventFailure(eventFailureData); - Adjust.eventFailureDelegate(eventFailure); - } - - public void GetNativeSessionSuccess(string sessionSuccessData) - { - if (IsEditor()) - { - return; - } - - if (Adjust.sessionSuccessDelegate == null) - { - Debug.Log("[Adjust]: Session success delegate was not set."); - return; - } - - var sessionSuccess = new AdjustSessionSuccess(sessionSuccessData); - Adjust.sessionSuccessDelegate(sessionSuccess); - } - - public void GetNativeSessionFailure(string sessionFailureData) - { - if (IsEditor()) - { - return; - } - - if (Adjust.sessionFailureDelegate == null) - { - Debug.Log("[Adjust]: Session failure delegate was not set."); - return; - } - - var sessionFailure = new AdjustSessionFailure(sessionFailureData); - Adjust.sessionFailureDelegate(sessionFailure); - } - - public void GetNativeDeferredDeeplink(string deeplinkURL) - { - if (IsEditor()) - { - return; - } - - if (Adjust.deferredDeeplinkDelegate == null) - { - Debug.Log("[Adjust]: Deferred deeplink delegate was not set."); - return; - } - - Adjust.deferredDeeplinkDelegate(deeplinkURL); - } - - public void GetNativeConversionValueUpdated(string conversionValue) - { - if (IsEditor()) - { - return; - } - - if (Adjust.conversionValueUpdatedDelegate == null) - { - Debug.Log("[Adjust]: Conversion value updated delegate was not set."); - return; - } - - int cv = -1; - if (Int32.TryParse(conversionValue, out cv)) - { - if (cv != -1) - { - Adjust.conversionValueUpdatedDelegate(cv); - } - } - } - - public void GetNativeSkad4ConversionValueUpdated(string conversionValueUpdate) - { - if (IsEditor()) - { - return; - } - - if (Adjust.skad4ConversionValueUpdatedDelegate == null) - { - Debug.Log("[Adjust]: SKAD4 Conversion value updated delegate was not set."); - return; - } - - int conversionValue = AdjustUtils.GetSkad4ConversionValue(conversionValueUpdate); - string coarseValue = AdjustUtils.GetSkad4CoarseValue(conversionValueUpdate); - bool lockWindow = AdjustUtils.GetSkad4LockWindow(conversionValueUpdate); - - Adjust.skad4ConversionValueUpdatedDelegate(conversionValue, coarseValue, lockWindow); - } - - public void GetNativeSkadCompletionDelegate(string message) - { - if (IsEditor()) - { - return; - } - - if (Adjust.skadUpdateConversionValueDelegate == null) - { - Debug.Log("[Adjust]: SKAD completion delegate was not set."); - return; - } - - if (message != null) - { - Adjust.skadUpdateConversionValueDelegate(message); - } - } - - public void GetNativeSkad4CompletionDelegate(string message) - { - if (IsEditor()) - { - return; - } - - if (Adjust.skad4UpdateConversionValueDelegate == null) - { - Debug.Log("[Adjust]: SKAD4 completion delegate was not set."); - return; - } - - if (message != null) - { - Adjust.skad4UpdateConversionValueDelegate(message); - } - } - - public void GetAuthorizationStatus(string authorizationStatus) - { - if (IsEditor()) - { - return; - } - - if (Adjust.authorizationStatusDelegates == null) - { - Debug.Log("[Adjust]: Authorization status delegates were not set."); - return; - } - - foreach (Action callback in Adjust.authorizationStatusDelegates) - { - callback(Int16.Parse(authorizationStatus)); - } - Adjust.authorizationStatusDelegates.Clear(); - } - - public void GetNativeVerificationInfo(string verificationInfoData) - { - if (IsEditor()) - { - return; - } - - if (Adjust.verificationInfoDelegate == null) - { - Debug.Log("[Adjust]: Purchase verification info delegate was not set."); - return; - } - - var verificationInfo = new AdjustPurchaseVerificationInfo(verificationInfoData); - Adjust.verificationInfoDelegate(verificationInfo); - } - - public void GetNativeResolvedLink(string resolvedLink) - { - if (IsEditor()) - { - return; - } - - if (Adjust.deeplinkResolutionDelegate == null) - { - Debug.Log("[Adjust]: Deep link reoslution delegate was not set."); - return; - } - - Adjust.deeplinkResolutionDelegate(resolvedLink); - } -#endif - - private static bool IsEditor() - { -#if UNITY_EDITOR - Debug.Log(errorMsgEditor); - return true; -#else - return false; -#endif - } - - public static void SetTestOptions(Dictionary testOptions) - { - if (IsEditor()) - { - return; - } - -#if UNITY_IOS - AdjustiOS.SetTestOptions(testOptions); -#elif UNITY_ANDROID - AdjustAndroid.SetTestOptions(testOptions); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.SetTestOptions(testOptions); -#else - Debug.Log("[Adjust]: Cannot run integration tests. None of the supported platforms selected."); -#endif - } - } -} diff --git a/Assets/Adjust/Unity/AdjustAdRevenue.cs b/Assets/Adjust/Unity/AdjustAdRevenue.cs deleted file mode 100644 index 95d3e2bc..00000000 --- a/Assets/Adjust/Unity/AdjustAdRevenue.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace com.adjust.sdk -{ - public class AdjustAdRevenue - { - internal string source; - internal double? revenue; - internal string currency; - internal int? adImpressionsCount; - internal string adRevenueNetwork; - internal string adRevenueUnit; - internal string adRevenuePlacement; - internal List partnerList; - internal List callbackList; - - public AdjustAdRevenue(string source) - { - this.source = source; - } - - public void setRevenue(double amount, string currency) - { - this.revenue = amount; - this.currency = currency; - } - - public void setAdImpressionsCount(int adImpressionsCount) - { - this.adImpressionsCount = adImpressionsCount; - } - - public void setAdRevenueNetwork(string adRevenueNetwork) - { - this.adRevenueNetwork = adRevenueNetwork; - } - - public void setAdRevenueUnit(string adRevenueUnit) - { - this.adRevenueUnit = adRevenueUnit; - } - - public void setAdRevenuePlacement(string adRevenuePlacement) - { - this.adRevenuePlacement = adRevenuePlacement; - } - - public void addCallbackParameter(string key, string value) - { - if (callbackList == null) - { - callbackList = new List(); - } - callbackList.Add(key); - callbackList.Add(value); - } - - public void addPartnerParameter(string key, string value) - { - if (partnerList == null) - { - partnerList = new List(); - } - partnerList.Add(key); - partnerList.Add(value); - } - } -} diff --git a/Assets/Adjust/Unity/AdjustAppStorePurchase.cs b/Assets/Adjust/Unity/AdjustAppStorePurchase.cs deleted file mode 100644 index 8add7af4..00000000 --- a/Assets/Adjust/Unity/AdjustAppStorePurchase.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace com.adjust.sdk -{ - public class AdjustAppStorePurchase - { - internal string transactionId; - internal string productId; - internal string receipt; - - public AdjustAppStorePurchase(string transactionId, string productId, string receipt) - { - this.transactionId = transactionId; - this.productId = productId; - this.receipt = receipt; - } - } -} diff --git a/Assets/Adjust/Unity/AdjustAppStoreSubscription.cs b/Assets/Adjust/Unity/AdjustAppStoreSubscription.cs deleted file mode 100644 index 73ec83a8..00000000 --- a/Assets/Adjust/Unity/AdjustAppStoreSubscription.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace com.adjust.sdk -{ - public class AdjustAppStoreSubscription - { - internal string price; - internal string currency; - internal string transactionId; - internal string receipt; - internal string billingStore; - internal string transactionDate; - internal string salesRegion; - internal List partnerList; - internal List callbackList; - - public AdjustAppStoreSubscription(string price, string currency, string transactionId, string receipt) - { - this.price = price; - this.currency = currency; - this.transactionId = transactionId; - this.receipt = receipt; - } - - public void setTransactionDate(string transactionDate) - { - this.transactionDate = transactionDate; - } - - public void setSalesRegion(string salesRegion) - { - this.salesRegion = salesRegion; - } - - public void addCallbackParameter(string key, string value) - { - if (callbackList == null) - { - callbackList = new List(); - } - callbackList.Add(key); - callbackList.Add(value); - } - - public void addPartnerParameter(string key, string value) - { - if (partnerList == null) - { - partnerList = new List(); - } - partnerList.Add(key); - partnerList.Add(value); - } - } -} diff --git a/Assets/Adjust/Unity/AdjustAttribution.cs b/Assets/Adjust/Unity/AdjustAttribution.cs deleted file mode 100644 index 33738874..00000000 --- a/Assets/Adjust/Unity/AdjustAttribution.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace com.adjust.sdk -{ - public class AdjustAttribution - { - public string adid { get; set; } - public string network { get; set; } - public string adgroup { get; set; } - public string campaign { get; set; } - public string creative { get; set; } - public string clickLabel { get; set; } - public string trackerName { get; set; } - public string trackerToken { get; set; } - public string costType { get; set; } - public double? costAmount { get; set; } - public string costCurrency { get; set; } - // Android only - public string fbInstallReferrer { get; set; } - - public AdjustAttribution() {} - - public AdjustAttribution(string jsonString) - { - var jsonNode = JSON.Parse(jsonString); - if (jsonNode == null) - { - return; - } - - trackerName = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTrackerName); - trackerToken = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTrackerToken); - network = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyNetwork); - campaign = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCampaign); - adgroup = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdgroup); - creative = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCreative); - clickLabel = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyClickLabel); - adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid); - costType = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostType); - try - { - costAmount = double.Parse(AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostAmount), - System.Globalization.CultureInfo.InvariantCulture); - } - catch (Exception) - { - // attribution response doesn't contain cost amount attached - // value will default to null - } - costCurrency = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostCurrency); - fbInstallReferrer = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyFbInstallReferrer); - } - - public AdjustAttribution(Dictionary dicAttributionData) - { - if (dicAttributionData == null) - { - return; - } - - trackerName = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyTrackerName); - trackerToken = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyTrackerToken); - network = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyNetwork); - campaign = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCampaign); - adgroup = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyAdgroup); - creative = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCreative); - clickLabel = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyClickLabel); - adid = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyAdid); - costType = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostType); - try - { - costAmount = double.Parse(AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostAmount), - System.Globalization.CultureInfo.InvariantCulture); - } - catch (Exception) - { - // attribution response doesn't contain cost amount attached - // value will default to null - } - costCurrency = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostCurrency); - fbInstallReferrer = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyFbInstallReferrer); - } - } -} diff --git a/Assets/Adjust/Unity/AdjustConfig.cs b/Assets/Adjust/Unity/AdjustConfig.cs deleted file mode 100644 index 481472ed..00000000 --- a/Assets/Adjust/Unity/AdjustConfig.cs +++ /dev/null @@ -1,329 +0,0 @@ -using System; - -namespace com.adjust.sdk -{ - public class AdjustConfig - { - public const string AdjustUrlStrategyChina = "china"; - public const string AdjustUrlStrategyIndia = "india"; - public const string AdjustUrlStrategyCn = "cn"; - public const string AdjustUrlStrategyCnOnly = "cn-only"; - - public const string AdjustDataResidencyEU = "data-residency-eu"; - public const string AdjustDataResidencyTR = "data-residency-tr"; - public const string AdjustDataResidencyUS = "data-residency-us"; - - public const string AdjustAdRevenueSourceAppLovinMAX = "applovin_max_sdk"; - public const string AdjustAdRevenueSourceMopub = "mopub"; - public const string AdjustAdRevenueSourceAdMob = "admob_sdk"; - public const string AdjustAdRevenueSourceIronSource = "ironsource_sdk"; - public const string AdjustAdRevenueSourceAdmost = "admost_sdk"; - public const string AdjustAdRevenueSourceUnity = "unity_sdk"; - public const string AdjustAdRevenueSourceHeliumChartboost = "helium_chartboost_sdk"; - public const string AdjustAdRevenueSourcePublisher = "publisher_sdk"; - public const string AdjustAdRevenueSourceTopOn = "topon_sdk"; - public const string AdjustAdRevenueSourceAdx = "adx_sdk"; - public const string AdjustAdRevenueTradPlus = "tradplus_sdk"; - - internal string appToken; - internal string sceneName; - internal string userAgent; - internal string defaultTracker; - internal string externalDeviceId; - internal string urlStrategy; - internal long? info1; - internal long? info2; - internal long? info3; - internal long? info4; - internal long? secretId; - internal double? delayStart; - internal bool? isDeviceKnown; - internal bool? sendInBackground; - internal bool? eventBufferingEnabled; - internal bool? coppaCompliantEnabled; - internal bool? playStoreKidsAppEnabled; - internal bool? allowSuppressLogLevel; - internal bool? needsCost; - internal bool? readDeviceInfoOnceEnabled; - internal bool launchDeferredDeeplink; - internal AdjustLogLevel? logLevel; - internal AdjustEnvironment environment; - internal Action deferredDeeplinkDelegate; - internal Action eventSuccessDelegate; - internal Action eventFailureDelegate; - internal Action sessionSuccessDelegate; - internal Action sessionFailureDelegate; - internal Action attributionChangedDelegate; - internal Action conversionValueUpdatedDelegate; - internal Action skad4ConversionValueUpdatedDelegate; - - // Android specific members - internal string processName; - internal bool? readImei; - internal bool? preinstallTrackingEnabled; - internal string preinstallFilePath; - internal bool? finalAndroidAttributionEnabled; - internal string fbAppId; - // iOS specific members - internal bool? allowAdServicesInfoReading; - internal bool? allowIdfaReading; - internal bool? skAdNetworkHandling; - internal bool? linkMeEnabled; - internal int? attConsentWaitingInterval; - // Windows specific members - internal Action logDelegate; - - public AdjustConfig(string appToken, AdjustEnvironment environment) - { - this.sceneName = ""; - this.processName = ""; - this.appToken = appToken; - this.environment = environment; - } - - public AdjustConfig(string appToken, AdjustEnvironment environment, bool allowSuppressLogLevel) - { - this.sceneName = ""; - this.processName = ""; - this.appToken = appToken; - this.environment = environment; - this.allowSuppressLogLevel = allowSuppressLogLevel; - } - - public void setLogLevel(AdjustLogLevel logLevel) - { - this.logLevel = logLevel; - } - - public void setDefaultTracker(string defaultTracker) - { - this.defaultTracker = defaultTracker; - } - - public void setExternalDeviceId(string externalDeviceId) - { - this.externalDeviceId = externalDeviceId; - } - - public void setLaunchDeferredDeeplink(bool launchDeferredDeeplink) - { - this.launchDeferredDeeplink = launchDeferredDeeplink; - } - - public void setSendInBackground(bool sendInBackground) - { - this.sendInBackground = sendInBackground; - } - - public void setEventBufferingEnabled(bool eventBufferingEnabled) - { - this.eventBufferingEnabled = eventBufferingEnabled; - } - - public void setCoppaCompliantEnabled(bool coppaCompliantEnabled) - { - this.coppaCompliantEnabled = coppaCompliantEnabled; - } - - public void setNeedsCost(bool needsCost) - { - this.needsCost = needsCost; - } - - public void setDelayStart(double delayStart) - { - this.delayStart = delayStart; - } - - public void setUserAgent(string userAgent) - { - this.userAgent = userAgent; - } - - public void setIsDeviceKnown(bool isDeviceKnown) - { - this.isDeviceKnown = isDeviceKnown; - } - - public void setUrlStrategy(String urlStrategy) - { - this.urlStrategy = urlStrategy; - } - - public void setAppSecret(long secretId, long info1, long info2, long info3, long info4) - { - this.secretId = secretId; - this.info1 = info1; - this.info2 = info2; - this.info3 = info3; - this.info4 = info4; - } - - public void setDeferredDeeplinkDelegate(Action deferredDeeplinkDelegate, string sceneName = "Adjust") - { - this.deferredDeeplinkDelegate = deferredDeeplinkDelegate; - this.sceneName = sceneName; - } - - public Action getDeferredDeeplinkDelegate() - { - return this.deferredDeeplinkDelegate; - } - - public void setAttributionChangedDelegate(Action attributionChangedDelegate, string sceneName = "Adjust") - { - this.attributionChangedDelegate = attributionChangedDelegate; - this.sceneName = sceneName; - } - - public Action getAttributionChangedDelegate() - { - return this.attributionChangedDelegate; - } - - public void setEventSuccessDelegate(Action eventSuccessDelegate, string sceneName = "Adjust") - { - this.eventSuccessDelegate = eventSuccessDelegate; - this.sceneName = sceneName; - } - - public Action getEventSuccessDelegate() - { - return this.eventSuccessDelegate; - } - - public void setEventFailureDelegate(Action eventFailureDelegate, string sceneName = "Adjust") - { - this.eventFailureDelegate = eventFailureDelegate; - this.sceneName = sceneName; - } - - public Action getEventFailureDelegate() - { - return this.eventFailureDelegate; - } - - public void setSessionSuccessDelegate(Action sessionSuccessDelegate, string sceneName = "Adjust") - { - this.sessionSuccessDelegate = sessionSuccessDelegate; - this.sceneName = sceneName; - } - - public Action getSessionSuccessDelegate() - { - return this.sessionSuccessDelegate; - } - - public void setSessionFailureDelegate(Action sessionFailureDelegate, string sceneName = "Adjust") - { - this.sessionFailureDelegate = sessionFailureDelegate; - this.sceneName = sceneName; - } - - public Action getSessionFailureDelegate() - { - return this.sessionFailureDelegate; - } - - // iOS specific methods. - [Obsolete("This is an obsolete method. Apple Search Ads attribution with usage of iAd.framework has been sunset by Apple as of February 7th 2023.")] - public void setAllowiAdInfoReading(bool allowiAdInfoReading) - { - } - - public void setAllowAdServicesInfoReading(bool allowAdServicesInfoReading) - { - this.allowAdServicesInfoReading = allowAdServicesInfoReading; - } - - public void setAllowIdfaReading(bool allowIdfaReading) - { - this.allowIdfaReading = allowIdfaReading; - } - - public void deactivateSKAdNetworkHandling() - { - this.skAdNetworkHandling = true; - } - - public void setLinkMeEnabled(bool linkMeEnabled) - { - this.linkMeEnabled = linkMeEnabled; - } - - public void setConversionValueUpdatedDelegate(Action conversionValueUpdatedDelegate, string sceneName = "Adjust") - { - this.conversionValueUpdatedDelegate = conversionValueUpdatedDelegate; - this.sceneName = sceneName; - } - - public Action getConversionValueUpdatedDelegate() - { - return this.conversionValueUpdatedDelegate; - } - - public void setSkad4ConversionValueUpdatedDelegate(Action skad4ConversionValueUpdatedDelegate, string sceneName = "Adjust") - { - this.skad4ConversionValueUpdatedDelegate = skad4ConversionValueUpdatedDelegate; - this.sceneName = sceneName; - } - - public Action getSkad4ConversionValueUpdatedDelegate() - { - return this.skad4ConversionValueUpdatedDelegate; - } - - public void setAttConsentWaitingInterval(int numberOfSeconds) - { - this.attConsentWaitingInterval = numberOfSeconds; - } - - // Android specific methods. - public void setProcessName(string processName) - { - this.processName = processName; - } - - [Obsolete("This is an obsolete method.")] - public void setReadMobileEquipmentIdentity(bool readMobileEquipmentIdentity) - { - // this.readImei = readMobileEquipmentIdentity; - } - - public void setPreinstallTrackingEnabled(bool preinstallTrackingEnabled) - { - this.preinstallTrackingEnabled = preinstallTrackingEnabled; - } - - public void setPreinstallFilePath(string preinstallFilePath) - { - this.preinstallFilePath = preinstallFilePath; - } - - public void setPlayStoreKidsAppEnabled(bool playStoreKidsAppEnabled) - { - this.playStoreKidsAppEnabled = playStoreKidsAppEnabled; - } - - public void setFinalAndroidAttributionEnabled(bool finalAndroidAttributionEnabled) - { - this.finalAndroidAttributionEnabled = finalAndroidAttributionEnabled; - } - - public void setFbAppId(string fbAppId) - { - this.fbAppId = fbAppId; - } - - public void setReadDeviceInfoOnceEnabled(bool readDeviceInfoOnceEnabled) - { - this.readDeviceInfoOnceEnabled = readDeviceInfoOnceEnabled; - } - - // Windows specific methods. - public void setLogDelegate(Action logDelegate) - { - this.logDelegate = logDelegate; - } - } -} diff --git a/Assets/Adjust/Unity/AdjustEvent.cs b/Assets/Adjust/Unity/AdjustEvent.cs deleted file mode 100644 index f4e87ce3..00000000 --- a/Assets/Adjust/Unity/AdjustEvent.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace com.adjust.sdk -{ - public class AdjustEvent - { - internal string currency; - internal string eventToken; - internal string callbackId; - internal string transactionId; - internal string productId; - internal double? revenue; - internal List partnerList; - internal List callbackList; - // iOS specific members - internal string receipt; - internal string receiptBase64; - internal bool isReceiptSet; - // Android specific members - internal string purchaseToken; - - public AdjustEvent(string eventToken) - { - this.eventToken = eventToken; - this.isReceiptSet = false; - } - - public void setRevenue(double amount, string currency) - { - this.revenue = amount; - this.currency = currency; - } - - public void addCallbackParameter(string key, string value) - { - if (callbackList == null) - { - callbackList = new List(); - } - callbackList.Add(key); - callbackList.Add(value); - } - - public void addPartnerParameter(string key, string value) - { - if (partnerList == null) - { - partnerList = new List(); - } - partnerList.Add(key); - partnerList.Add(value); - } - - public void setCallbackId(string callbackId) - { - this.callbackId = callbackId; - } - - // iOS / Android mixed - public void setTransactionId(string transactionId) - { - this.transactionId = transactionId; - } - - public void setProductId(string productId) - { - this.productId = productId; - } - - // iOS specific methods - [Obsolete("This is an obsolete method. Please use separate setter methods for purchase verification parameters.")] - public void setReceipt(string receipt, string transactionId) - { - // this.receipt = receipt; - // this.transactionId = transactionId; - // this.isReceiptSet = true; - } - - public void setReceipt(string receipt) - { - this.receipt = receipt; - } - - public void setReceiptBase64(string receiptBase64) - { - this.receiptBase64 = receiptBase64; - } - - // Android specific methods - public void setPurchaseToken(string purchaseToken) - { - this.purchaseToken = purchaseToken; - } - } -} diff --git a/Assets/Adjust/Unity/AdjustPlayStorePurchase.cs b/Assets/Adjust/Unity/AdjustPlayStorePurchase.cs deleted file mode 100644 index 9bbf9553..00000000 --- a/Assets/Adjust/Unity/AdjustPlayStorePurchase.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace com.adjust.sdk -{ - public class AdjustPlayStorePurchase - { - internal string productId; - internal string purchaseToken; - - public AdjustPlayStorePurchase(string productId, string purchaseToken) - { - this.productId = productId; - this.purchaseToken = purchaseToken; - } - } -} diff --git a/Assets/Adjust/Unity/AdjustPlayStoreSubscription.cs b/Assets/Adjust/Unity/AdjustPlayStoreSubscription.cs deleted file mode 100644 index c86e45cb..00000000 --- a/Assets/Adjust/Unity/AdjustPlayStoreSubscription.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace com.adjust.sdk -{ - public class AdjustPlayStoreSubscription - { - internal string price; - internal string currency; - internal string sku; - internal string orderId; - internal string signature; - internal string purchaseToken; - internal string billingStore; - internal string purchaseTime; - internal List partnerList; - internal List callbackList; - - public AdjustPlayStoreSubscription(string price, string currency, string sku, string orderId, string signature, string purchaseToken) - { - this.price = price; - this.currency = currency; - this.sku = sku; - this.orderId = orderId; - this.signature = signature; - this.purchaseToken = purchaseToken; - } - - public void setPurchaseTime(string purchaseTime) - { - this.purchaseTime = purchaseTime; - } - - public void addCallbackParameter(string key, string value) - { - if (callbackList == null) - { - callbackList = new List(); - } - callbackList.Add(key); - callbackList.Add(value); - } - - public void addPartnerParameter(string key, string value) - { - if (partnerList == null) - { - partnerList = new List(); - } - partnerList.Add(key); - partnerList.Add(value); - } - } -} diff --git a/Assets/Adjust/Unity/AdjustPurchaseVerificationInfo.cs b/Assets/Adjust/Unity/AdjustPurchaseVerificationInfo.cs deleted file mode 100644 index beb4d83b..00000000 --- a/Assets/Adjust/Unity/AdjustPurchaseVerificationInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace com.adjust.sdk -{ - public class AdjustPurchaseVerificationInfo - { - #region Properties - public int code { get; set; } - public string message { get; set; } - public string verificationStatus { get; set; } - #endregion - - #region Constructors - public AdjustPurchaseVerificationInfo() - { - } - - public AdjustPurchaseVerificationInfo(string jsonString) - { - var jsonNode = JSON.Parse(jsonString); - - if (jsonNode == null) - { - return; - } - - string stringCode = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCode); - code = Int32.Parse(stringCode); - message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage); - verificationStatus = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyVerificationStatus); - } - #endregion - } -} diff --git a/Assets/Adjust/Unity/AdjustThirdPartySharing.cs b/Assets/Adjust/Unity/AdjustThirdPartySharing.cs deleted file mode 100644 index 091cacfe..00000000 --- a/Assets/Adjust/Unity/AdjustThirdPartySharing.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace com.adjust.sdk -{ - public class AdjustThirdPartySharing - { - internal bool? isEnabled; - internal Dictionary> granularOptions; - internal Dictionary> partnerSharingSettings; - - public AdjustThirdPartySharing(bool? isEnabled) - { - this.isEnabled = isEnabled; - this.granularOptions = new Dictionary>(); - this.partnerSharingSettings = new Dictionary>(); - } - - public void addGranularOption(string partnerName, string key, string value) - { - // TODO: consider to add some logs about the error case - if (partnerName == null || key == null || value == null) - { - return; - } - - List partnerOptions; - if (granularOptions.ContainsKey(partnerName)) - { - partnerOptions = granularOptions[partnerName]; - } - else - { - partnerOptions = new List(); - granularOptions.Add(partnerName, partnerOptions); - } - - partnerOptions.Add(key); - partnerOptions.Add(value); - } - - public void addPartnerSharingSetting(string partnerName, string key, bool value) - { - // TODO: consider to add some logs about the error case - if (partnerName == null || key == null) - { - return; - } - - List partnerSharingSetting; - if (partnerSharingSettings.ContainsKey(partnerName)) - { - partnerSharingSetting = partnerSharingSettings[partnerName]; - } - else - { - partnerSharingSetting = new List(); - partnerSharingSettings.Add(partnerName, partnerSharingSetting); - } - - partnerSharingSetting.Add(key); - partnerSharingSetting.Add(value.ToString()); - } - } -} diff --git a/Assets/Adjust/Unity/AdjustUrlStrategy.cs b/Assets/Adjust/Unity/AdjustUrlStrategy.cs deleted file mode 100644 index 6d4974a9..00000000 --- a/Assets/Adjust/Unity/AdjustUrlStrategy.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace com.adjust.sdk -{ - [System.Serializable] - public enum AdjustUrlStrategy - { - Default, - DataResidencyEU, - DataResidencyTK, - DataResidencyUS, - India, - China, - } - - public static class AdjustUrlStrategyExtension - { - public static string ToLowerCaseString(this AdjustUrlStrategy strategy) - { - switch (strategy) - { - case AdjustUrlStrategy.India: return "india"; - case AdjustUrlStrategy.China: return "china"; - case AdjustUrlStrategy.DataResidencyEU: return "data-residency-eu"; - case AdjustUrlStrategy.DataResidencyTK: return "data-residency-tr"; - case AdjustUrlStrategy.DataResidencyUS: return "data-residency-us"; - default: return string.Empty; - } - } - } -} - diff --git a/Assets/Adjust/Windows.meta b/Assets/Adjust/Windows.meta deleted file mode 100644 index 09f85b2c..00000000 --- a/Assets/Adjust/Windows.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: b2eaef4e025b6a64c942a8a88ad33333 -folderAsset: yes -timeCreated: 1578652520 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/AdjustWindows.cs b/Assets/Adjust/Windows/AdjustWindows.cs deleted file mode 100644 index df5f94dd..00000000 --- a/Assets/Adjust/Windows/AdjustWindows.cs +++ /dev/null @@ -1,340 +0,0 @@ -#if UNITY_WSA -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using UnityEngine; - -#if UNITY_WSA_10_0 -using Win10Interface; -#elif UNITY_WP_8_1 -using Win81Interface; -#elif UNITY_WSA -using WinWsInterface; -#endif - -namespace com.adjust.sdk -{ - public class AdjustWindows - { - private const string sdkPrefix = "unity4.38.1"; - private static bool appLaunched = false; - - public static void Start(AdjustConfig adjustConfig) - { - string logLevelString = null; - string environment = adjustConfig.environment.ToLowercaseString(); - - Action> attributionChangedAction = null; - Action> sessionSuccessChangedAction = null; - Action> sessionFailureChangedAction = null; - Action> eventSuccessChangedAction = null; - Action> eventFailureChangedAction = null; - Func deeplinkResponseFunc = null; - - if (adjustConfig.logLevel.HasValue) - { - logLevelString = adjustConfig.logLevel.Value.ToLowercaseString(); - } - - if (adjustConfig.attributionChangedDelegate != null) - { - attributionChangedAction = (attributionMap) => - { - var attribution = new AdjustAttribution(attributionMap); - adjustConfig.attributionChangedDelegate(attribution); - }; - } - - if (adjustConfig.sessionSuccessDelegate != null) - { - sessionSuccessChangedAction = (sessionMap) => - { - var sessionData = new AdjustSessionSuccess(sessionMap); - adjustConfig.sessionSuccessDelegate(sessionData); - }; - } - - if (adjustConfig.sessionFailureDelegate != null) - { - sessionFailureChangedAction = (sessionMap) => - { - var sessionData = new AdjustSessionFailure(sessionMap); - adjustConfig.sessionFailureDelegate(sessionData); - }; - } - - if (adjustConfig.eventSuccessDelegate != null) - { - eventSuccessChangedAction = (eventMap) => - { - var eventData = new AdjustEventSuccess(eventMap); - adjustConfig.eventSuccessDelegate(eventData); - }; - } - - if (adjustConfig.eventFailureDelegate != null) - { - eventFailureChangedAction = (eventMap) => - { - var eventData = new AdjustEventFailure(eventMap); - adjustConfig.eventFailureDelegate(eventData); - }; - } - - if (adjustConfig.deferredDeeplinkDelegate != null) - { - deeplinkResponseFunc = uri => - { - if (adjustConfig.launchDeferredDeeplink) - { - adjustConfig.deferredDeeplinkDelegate(uri); - } - - return adjustConfig.launchDeferredDeeplink; - }; - } - - bool sendInBackground = false; - if (adjustConfig.sendInBackground.HasValue) - { - sendInBackground = adjustConfig.sendInBackground.Value; - } - - double delayStartSeconds = 0; - if (adjustConfig.delayStart.HasValue) - { - delayStartSeconds = adjustConfig.delayStart.Value; - } - - AdjustConfigDto adjustConfigDto = new AdjustConfigDto { - AppToken = adjustConfig.appToken, - Environment = environment, - SdkPrefix = sdkPrefix, - SendInBackground = sendInBackground, - DelayStart = delayStartSeconds, - UserAgent = adjustConfig.userAgent, - DefaultTracker = adjustConfig.defaultTracker, - EventBufferingEnabled = adjustConfig.eventBufferingEnabled, - LaunchDeferredDeeplink = adjustConfig.launchDeferredDeeplink, - LogLevelString = logLevelString, - LogDelegate = adjustConfig.logDelegate, - ActionAttributionChangedData = attributionChangedAction, - ActionSessionSuccessData = sessionSuccessChangedAction, - ActionSessionFailureData = sessionFailureChangedAction, - ActionEventSuccessData = eventSuccessChangedAction, - ActionEventFailureData = eventFailureChangedAction, - FuncDeeplinkResponseData = deeplinkResponseFunc, - IsDeviceKnown = adjustConfig.isDeviceKnown, - SecretId = adjustConfig.secretId, - Info1 = adjustConfig.info1, - Info2 = adjustConfig.info2, - Info3 = adjustConfig.info3, - Info4 = adjustConfig.info4 - }; - - AdjustWinInterface.ApplicationLaunching(adjustConfigDto); - AdjustWinInterface.ApplicationActivated(); - appLaunched = true; - } - - public static void TrackEvent(AdjustEvent adjustEvent) - { - AdjustWinInterface.TrackEvent( - eventToken: adjustEvent.eventToken, - revenue: adjustEvent.revenue, - currency: adjustEvent.currency, - purchaseId: adjustEvent.transactionId, - callbackId: adjustEvent.callbackId, - callbackList: adjustEvent.callbackList, - partnerList: adjustEvent.partnerList - ); - } - - public static bool IsEnabled() - { - return AdjustWinInterface.IsEnabled(); - } - - public static void OnResume() - { - if (!appLaunched) - { - return; - } - - AdjustWinInterface.ApplicationActivated(); - } - - public static void OnPause() - { - AdjustWinInterface.ApplicationDeactivated(); - } - - public static void SetEnabled(bool enabled) - { - AdjustWinInterface.SetEnabled(enabled); - } - - public static void SetOfflineMode(bool offlineMode) - { - AdjustWinInterface.SetOfflineMode(offlineMode); - } - - public static void SendFirstPackages() - { - AdjustWinInterface.SendFirstPackages(); - } - - public static void SetDeviceToken(string deviceToken) - { - AdjustWinInterface.SetDeviceToken(deviceToken); - } - - public static void AppWillOpenUrl(string url) - { - AdjustWinInterface.AppWillOpenUrl(url); - } - - public static void AddSessionPartnerParameter(string key, string value) - { - AdjustWinInterface.AddSessionPartnerParameter(key, value); - } - - public static void AddSessionCallbackParameter(string key, string value) - { - AdjustWinInterface.AddSessionCallbackParameter(key, value); - } - - public static void RemoveSessionPartnerParameter(string key) - { - AdjustWinInterface.RemoveSessionPartnerParameter(key); - } - - public static void RemoveSessionCallbackParameter(string key) - { - AdjustWinInterface.RemoveSessionCallbackParameter(key); - } - - public static void ResetSessionPartnerParameters() - { - AdjustWinInterface.ResetSessionPartnerParameters(); - } - - public static void ResetSessionCallbackParameters() - { - AdjustWinInterface.ResetSessionCallbackParameters(); - } - - public static string GetAdid() - { - return AdjustWinInterface.GetAdid(); - } - - public static string GetSdkVersion() - { - return sdkPrefix + "@" + AdjustWinInterface.GetSdkVersion(); - } - - public static AdjustAttribution GetAttribution() - { - var attributionMap = AdjustWinInterface.GetAttribution(); - if (attributionMap == null) - { - return new AdjustAttribution(); - } - - return new AdjustAttribution(attributionMap); - } - - public static void GdprForgetMe() - { - AdjustWinInterface.GdprForgetMe(); - } - - public static string GetWinAdId() - { - return AdjustWinInterface.GetWindowsAdId(); - } - - public static void SetTestOptions(Dictionary testOptions) - { - string basePath = testOptions.ContainsKey(AdjustUtils.KeyTestOptionsBasePath) ? - testOptions[AdjustUtils.KeyTestOptionsBasePath] : null; - string gdprPath = testOptions.ContainsKey(AdjustUtils.KeyTestOptionsGdprPath) ? - testOptions[AdjustUtils.KeyTestOptionsGdprPath] : null; - long timerIntervalMls = -1; - long timerStartMls = -1; - long sessionIntMls = -1; - long subsessionIntMls = -1; - bool teardown = false; - bool deleteState = false; - bool noBackoffWait = false; - - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsTimerIntervalInMilliseconds)) - { - timerIntervalMls = long.Parse(testOptions[AdjustUtils.KeyTestOptionsTimerIntervalInMilliseconds]); - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsTimerStartInMilliseconds)) - { - timerStartMls = long.Parse(testOptions[AdjustUtils.KeyTestOptionsTimerStartInMilliseconds]); - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsSessionIntervalInMilliseconds)) - { - sessionIntMls = long.Parse(testOptions[AdjustUtils.KeyTestOptionsSessionIntervalInMilliseconds]); - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsSubsessionIntervalInMilliseconds)) - { - subsessionIntMls = long.Parse(testOptions[AdjustUtils.KeyTestOptionsSubsessionIntervalInMilliseconds]); - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsTeardown)) - { - teardown = testOptions[AdjustUtils.KeyTestOptionsTeardown].ToLower() == "true"; - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsDeleteState)) - { - deleteState = testOptions[AdjustUtils.KeyTestOptionsDeleteState].ToLower() == "true"; - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsNoBackoffWait)) - { - noBackoffWait = testOptions[AdjustUtils.KeyTestOptionsNoBackoffWait].ToLower() == "true"; - } - - Type testLibInterfaceType = Type.GetType("TestLibraryInterface.TestLibraryInterface, TestLibraryInterface"); - Type adjustTestOptionsDtoType = Type.GetType("TestLibraryInterface.AdjustTestOptionsDto, TestLibraryInterface"); - if (testLibInterfaceType == null || adjustTestOptionsDtoType == null) - { - return; - } - - PropertyInfo baseUrlInfo = adjustTestOptionsDtoType.GetProperty("BaseUrl"); - PropertyInfo gdprUrlInfo = adjustTestOptionsDtoType.GetProperty("GdprUrl"); - PropertyInfo basePathInfo = adjustTestOptionsDtoType.GetProperty("BasePath"); - PropertyInfo gdprPathInfo = adjustTestOptionsDtoType.GetProperty("GdprPath"); - PropertyInfo sessionIntervalInMillisecondsInfo = adjustTestOptionsDtoType.GetProperty("SessionIntervalInMilliseconds"); - PropertyInfo subsessionIntervalInMillisecondsInfo = adjustTestOptionsDtoType.GetProperty("SubsessionIntervalInMilliseconds"); - PropertyInfo timerIntervalInMillisecondsInfo = adjustTestOptionsDtoType.GetProperty("TimerIntervalInMilliseconds"); - PropertyInfo timerStartInMillisecondsInfo = adjustTestOptionsDtoType.GetProperty("TimerStartInMilliseconds"); - PropertyInfo deleteStateInfo = adjustTestOptionsDtoType.GetProperty("DeleteState"); - PropertyInfo teardownInfo = adjustTestOptionsDtoType.GetProperty("Teardown"); - PropertyInfo noBackoffWaitInfo = adjustTestOptionsDtoType.GetProperty("NoBackoffWait"); - - object adjustTestOptionsDtoInstance = Activator.CreateInstance(adjustTestOptionsDtoType); - baseUrlInfo.SetValue(adjustTestOptionsDtoInstance, testOptions[AdjustUtils.KeyTestOptionsBaseUrl], null); - gdprUrlInfo.SetValue(adjustTestOptionsDtoInstance, testOptions[AdjustUtils.KeyTestOptionsGdprUrl], null); - basePathInfo.SetValue(adjustTestOptionsDtoInstance, basePath, null); - gdprPathInfo.SetValue(adjustTestOptionsDtoInstance, gdprPath, null); - sessionIntervalInMillisecondsInfo.SetValue(adjustTestOptionsDtoInstance, sessionIntMls, null); - subsessionIntervalInMillisecondsInfo.SetValue(adjustTestOptionsDtoInstance, subsessionIntMls, null); - timerIntervalInMillisecondsInfo.SetValue(adjustTestOptionsDtoInstance, timerIntervalMls, null); - timerStartInMillisecondsInfo.SetValue(adjustTestOptionsDtoInstance, timerStartMls, null); - deleteStateInfo.SetValue(adjustTestOptionsDtoInstance, deleteState, null); - teardownInfo.SetValue(adjustTestOptionsDtoInstance, teardown, null); - noBackoffWaitInfo.SetValue(adjustTestOptionsDtoInstance, noBackoffWait, null); - - MethodInfo setTestOptionsMethodInfo = testLibInterfaceType.GetMethod("SetTestOptions"); - setTestOptionsMethodInfo.Invoke(null, new object[] { adjustTestOptionsDtoInstance }); - } - } -} -#endif diff --git a/Assets/Adjust/Windows/AdjustWindows.cs.meta b/Assets/Adjust/Windows/AdjustWindows.cs.meta deleted file mode 100644 index 2dba0264..00000000 --- a/Assets/Adjust/Windows/AdjustWindows.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3427d1638e7de554f822f2758d5efa5d -timeCreated: 1510134931 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/Newtonsoft.Json.dll b/Assets/Adjust/Windows/Newtonsoft.Json.dll deleted file mode 100644 index 89bc2b8c..00000000 Binary files a/Assets/Adjust/Windows/Newtonsoft.Json.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/Newtonsoft.Json.dll.meta b/Assets/Adjust/Windows/Newtonsoft.Json.dll.meta deleted file mode 100644 index 99f3c9fd..00000000 --- a/Assets/Adjust/Windows/Newtonsoft.Json.dll.meta +++ /dev/null @@ -1,142 +0,0 @@ -fileFormatVersion: 2 -guid: dde5cfaaa61544444adb278e3df09051 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude WindowsStoreApps: 0 - Exclude iOS: 1 - Exclude tvOS: 1 - - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: AnyOS - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 1 - settings: - CPU: AnyCPU - DontProcess: False - PlaceholderPath: - SDK: AnySDK - ScriptingBackend: AnyScriptingBackend - - first: - iPhone: iOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - - first: - tvOS: tvOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/Stubs.meta b/Assets/Adjust/Windows/Stubs.meta deleted file mode 100644 index 5031f1bb..00000000 --- a/Assets/Adjust/Windows/Stubs.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: f843c58f3da8cd04ca908f6ae7cc4584 -folderAsset: yes -timeCreated: 1578652520 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/Stubs/Win10Interface.dll b/Assets/Adjust/Windows/Stubs/Win10Interface.dll deleted file mode 100644 index 3d928338..00000000 Binary files a/Assets/Adjust/Windows/Stubs/Win10Interface.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/Stubs/Win81Interface.dll b/Assets/Adjust/Windows/Stubs/Win81Interface.dll deleted file mode 100644 index 3b577e96..00000000 Binary files a/Assets/Adjust/Windows/Stubs/Win81Interface.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/Stubs/WinWsInterface.dll b/Assets/Adjust/Windows/Stubs/WinWsInterface.dll deleted file mode 100644 index 610ee9b7..00000000 Binary files a/Assets/Adjust/Windows/Stubs/WinWsInterface.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/Test/TestLibrary.dll b/Assets/Adjust/Windows/Test/TestLibrary.dll deleted file mode 100644 index a1e61435..00000000 Binary files a/Assets/Adjust/Windows/Test/TestLibrary.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/Test/TestLibraryInterface.dll b/Assets/Adjust/Windows/Test/TestLibraryInterface.dll deleted file mode 100644 index 11722adc..00000000 Binary files a/Assets/Adjust/Windows/Test/TestLibraryInterface.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/W81.meta b/Assets/Adjust/Windows/W81.meta deleted file mode 100644 index e8436416..00000000 --- a/Assets/Adjust/Windows/W81.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 0a2e5ebe768d3b74a9047dc0592c78b1 -folderAsset: yes -timeCreated: 1578652520 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/W81/AdjustWP81.dll b/Assets/Adjust/Windows/W81/AdjustWP81.dll deleted file mode 100644 index adf479a7..00000000 Binary files a/Assets/Adjust/Windows/W81/AdjustWP81.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/W81/AdjustWP81.dll.meta b/Assets/Adjust/Windows/W81/AdjustWP81.dll.meta deleted file mode 100644 index 760c329e..00000000 --- a/Assets/Adjust/Windows/W81/AdjustWP81.dll.meta +++ /dev/null @@ -1,132 +0,0 @@ -fileFormatVersion: 2 -guid: 1e03a607fa75e4a488d6d61ca75c352a -timeCreated: 1510575008 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude WindowsStoreApps: 0 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 1 - settings: - CPU: AnyCPU - DontProcess: False - PlaceholderPath: - SDK: PhoneSDK81 - ScriptingBackend: AnyScriptingBackend - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/W81/Win81Interface.dll b/Assets/Adjust/Windows/W81/Win81Interface.dll deleted file mode 100644 index 7dc09b4c..00000000 Binary files a/Assets/Adjust/Windows/W81/Win81Interface.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/W81/Win81Interface.dll.meta b/Assets/Adjust/Windows/W81/Win81Interface.dll.meta deleted file mode 100644 index 94bba2a5..00000000 --- a/Assets/Adjust/Windows/W81/Win81Interface.dll.meta +++ /dev/null @@ -1,132 +0,0 @@ -fileFormatVersion: 2 -guid: 72c922127edd0e94b972c6e40580ec90 -timeCreated: 1510575009 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude WindowsStoreApps: 0 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 1 - settings: - CPU: AnyCPU - DontProcess: False - PlaceholderPath: Assets/Adjust/Windows/Stubs/Win81Interface.dll - SDK: PhoneSDK81 - ScriptingBackend: AnyScriptingBackend - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/WS.meta b/Assets/Adjust/Windows/WS.meta deleted file mode 100644 index 9194a835..00000000 --- a/Assets/Adjust/Windows/WS.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 200065618516a3b479c4dff78f23cdd9 -folderAsset: yes -timeCreated: 1578652520 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/WS/AdjustWS.dll b/Assets/Adjust/Windows/WS/AdjustWS.dll deleted file mode 100644 index 7845be95..00000000 Binary files a/Assets/Adjust/Windows/WS/AdjustWS.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/WS/AdjustWS.dll.meta b/Assets/Adjust/Windows/WS/AdjustWS.dll.meta deleted file mode 100644 index 3a8b3b24..00000000 --- a/Assets/Adjust/Windows/WS/AdjustWS.dll.meta +++ /dev/null @@ -1,132 +0,0 @@ -fileFormatVersion: 2 -guid: 244b7bed1ea0ae147b5732f948d3e207 -timeCreated: 1510575008 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude WindowsStoreApps: 0 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 1 - settings: - CPU: AnyCPU - DontProcess: False - PlaceholderPath: - SDK: SDK81 - ScriptingBackend: AnyScriptingBackend - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/WS/WinWsInterface.dll b/Assets/Adjust/Windows/WS/WinWsInterface.dll deleted file mode 100644 index b07e176b..00000000 Binary files a/Assets/Adjust/Windows/WS/WinWsInterface.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/WS/WinWsInterface.dll.meta b/Assets/Adjust/Windows/WS/WinWsInterface.dll.meta deleted file mode 100644 index c8b10890..00000000 --- a/Assets/Adjust/Windows/WS/WinWsInterface.dll.meta +++ /dev/null @@ -1,132 +0,0 @@ -fileFormatVersion: 2 -guid: 35b13abbb89b9874d811856667cc3186 -timeCreated: 1510575009 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude WindowsStoreApps: 0 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 1 - settings: - CPU: AnyCPU - DontProcess: False - PlaceholderPath: Assets/Adjust/Windows/Stubs/WinWsInterface.dll - SDK: SDK81 - ScriptingBackend: AnyScriptingBackend - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/WU10.meta b/Assets/Adjust/Windows/WU10.meta deleted file mode 100644 index d6949b1e..00000000 --- a/Assets/Adjust/Windows/WU10.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: abbcaca8b21383f4eaece6c3b078825a -folderAsset: yes -timeCreated: 1578652520 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/WU10/AdjustUAP10.dll b/Assets/Adjust/Windows/WU10/AdjustUAP10.dll deleted file mode 100644 index c407a2e0..00000000 Binary files a/Assets/Adjust/Windows/WU10/AdjustUAP10.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/WU10/AdjustUAP10.dll.meta b/Assets/Adjust/Windows/WU10/AdjustUAP10.dll.meta deleted file mode 100644 index eee9c487..00000000 --- a/Assets/Adjust/Windows/WU10/AdjustUAP10.dll.meta +++ /dev/null @@ -1,146 +0,0 @@ -fileFormatVersion: 2 -guid: 3b969527d95894f4b8710cce1119c292 -timeCreated: 1509723106 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - data: - first: - Any: - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude WindowsStoreApps: 0 - Exclude iOS: 1 - Exclude tvOS: 1 - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: AnyOS - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 1 - settings: - CPU: AnyCPU - DontProcess: False - PlaceholderPath: - SDK: UWP - ScriptingBackend: AnyScriptingBackend - data: - first: - iPhone: iOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - data: - first: - tvOS: tvOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/WU10/Win10Interface.dll b/Assets/Adjust/Windows/WU10/Win10Interface.dll deleted file mode 100644 index 4f9a8675..00000000 Binary files a/Assets/Adjust/Windows/WU10/Win10Interface.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/WU10/Win10Interface.dll.meta b/Assets/Adjust/Windows/WU10/Win10Interface.dll.meta deleted file mode 100644 index 63690a80..00000000 --- a/Assets/Adjust/Windows/WU10/Win10Interface.dll.meta +++ /dev/null @@ -1,151 +0,0 @@ -fileFormatVersion: 2 -guid: 64aebd589aa21cd489368a1570e09acd -timeCreated: 1509723107 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude WindowsStoreApps: 0 - Exclude iOS: 1 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: AnyOS - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 1 - settings: - CPU: AnyCPU - DontProcess: False - PlaceholderPath: Assets/Adjust/Windows/Stubs/Win10Interface.dll - SDK: UWP - ScriptingBackend: AnyScriptingBackend - data: - first: - iPhone: iOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/WindowsPcl.dll b/Assets/Adjust/Windows/WindowsPcl.dll deleted file mode 100644 index 0708bc33..00000000 Binary files a/Assets/Adjust/Windows/WindowsPcl.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/WindowsPcl.dll.meta b/Assets/Adjust/Windows/WindowsPcl.dll.meta deleted file mode 100644 index 44ff1b14..00000000 --- a/Assets/Adjust/Windows/WindowsPcl.dll.meta +++ /dev/null @@ -1,132 +0,0 @@ -fileFormatVersion: 2 -guid: f29a24c7f8821a04b948fa281beaadc0 -timeCreated: 1509723108 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude WindowsStoreApps: 0 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 1 - settings: - CPU: AnyCPU - DontProcess: False - PlaceholderPath: - SDK: AnySDK - ScriptingBackend: AnyScriptingBackend - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/Windows/WindowsUap.dll b/Assets/Adjust/Windows/WindowsUap.dll deleted file mode 100644 index 6a1ce938..00000000 Binary files a/Assets/Adjust/Windows/WindowsUap.dll and /dev/null differ diff --git a/Assets/Adjust/Windows/WindowsUap.dll.meta b/Assets/Adjust/Windows/WindowsUap.dll.meta deleted file mode 100644 index 4b14581d..00000000 --- a/Assets/Adjust/Windows/WindowsUap.dll.meta +++ /dev/null @@ -1,132 +0,0 @@ -fileFormatVersion: 2 -guid: 50382477c784d8146a4c96803ec33711 -timeCreated: 1509723107 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude WindowsStoreApps: 0 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 1 - settings: - CPU: AnyCPU - DontProcess: False - PlaceholderPath: - SDK: AnySDK - ScriptingBackend: AnyScriptingBackend - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS.meta b/Assets/Adjust/iOS.meta deleted file mode 100644 index c1433be8..00000000 --- a/Assets/Adjust/iOS.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 28da4e9eb3d011141b258019c71a8416 -folderAsset: yes -timeCreated: 1578652520 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJAdRevenue.h b/Assets/Adjust/iOS/ADJAdRevenue.h deleted file mode 100644 index 4b167ad2..00000000 --- a/Assets/Adjust/iOS/ADJAdRevenue.h +++ /dev/null @@ -1,80 +0,0 @@ -// -// ADJAdRevenue.h -// Adjust SDK -// -// Created by Uglješa Erceg (@uerceg) on 13th April 2021 -// Copyright (c) 2021 Adjust GmbH. All rights reserved. -// - -#import - -/** - * @brief Adjust ad revenue class. - */ -@interface ADJAdRevenue : NSObject - -/** - * @brief Ad revenue source value. - */ -@property (nonatomic, copy, readonly, nonnull) NSString *source; - -/** - * @brief Revenue value. - */ -@property (nonatomic, copy, readonly, nonnull) NSNumber *revenue; - -/** - * @brief Currency value. - */ -@property (nonatomic, copy, readonly, nonnull) NSString *currency; - -/** - * @brief Ad impressions count. - */ -@property (nonatomic, copy, readonly, nonnull) NSNumber *adImpressionsCount; - -/** - * @brief Ad revenue network. - */ -@property (nonatomic, copy, readonly, nonnull) NSString *adRevenueNetwork; - -/** - * @brief Ad revenue unit. - */ -@property (nonatomic, copy, readonly, nonnull) NSString *adRevenueUnit; - -/** - * @brief Ad revenue placement. - */ -@property (nonatomic, copy, readonly, nonnull) NSString *adRevenuePlacement; - -/** - * @brief List of partner parameters. - */ -@property (nonatomic, copy, readonly, nonnull) NSDictionary *partnerParameters; - -/** - * @brief List of callback parameters. - */ -@property (nonatomic, copy, readonly, nonnull) NSDictionary *callbackParameters; - - -- (nullable id)initWithSource:(nonnull NSString *)source; - -- (void)setRevenue:(double)amount currency:(nonnull NSString *)currency; - -- (void)setAdImpressionsCount:(int)adImpressionsCount; - -- (void)setAdRevenueNetwork:(nonnull NSString *)adRevenueNetwork; - -- (void)setAdRevenueUnit:(nonnull NSString *)adRevenueUnit; - -- (void)setAdRevenuePlacement:(nonnull NSString *)adRevenuePlacement; - -- (void)addCallbackParameter:(nonnull NSString *)key value:(nonnull NSString *)value; - -- (void)addPartnerParameter:(nonnull NSString *)key value:(nonnull NSString *)value; - -- (BOOL)isValid; - -@end diff --git a/Assets/Adjust/iOS/ADJAdRevenue.h.meta b/Assets/Adjust/iOS/ADJAdRevenue.h.meta deleted file mode 100644 index 7bf1899b..00000000 --- a/Assets/Adjust/iOS/ADJAdRevenue.h.meta +++ /dev/null @@ -1,24 +0,0 @@ -fileFormatVersion: 2 -guid: f382ac4ce0db3407baf40dd118470093 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJAttribution.h b/Assets/Adjust/iOS/ADJAttribution.h deleted file mode 100644 index 845a909a..00000000 --- a/Assets/Adjust/iOS/ADJAttribution.h +++ /dev/null @@ -1,99 +0,0 @@ -// -// ADJAttribution.h -// adjust -// -// Created by Pedro Filipe on 29/10/14. -// Copyright (c) 2014 adjust GmbH. All rights reserved. -// - -#import - -/** - * @brief Adjust attribution object. - */ -@interface ADJAttribution : NSObject - -/** - * @brief Tracker token. - */ -@property (nonatomic, copy, nullable) NSString *trackerToken; - -/** - * @brief Tracker name. - */ -@property (nonatomic, copy, nullable) NSString *trackerName; - -/** - * @brief Network name. - */ -@property (nonatomic, copy, nullable) NSString *network; - -/** - * @brief Campaign name. - */ -@property (nonatomic, copy, nullable) NSString *campaign; - -/** - * @brief Adgroup name. - */ -@property (nonatomic, copy, nullable) NSString *adgroup; - -/** - * @brief Creative name. - */ -@property (nonatomic, copy, nullable) NSString *creative; - -/** - * @brief Click label content. - */ -@property (nonatomic, copy, nullable) NSString *clickLabel; - -/** - * @brief Adjust identifier value. - */ -@property (nonatomic, copy, nullable) NSString *adid; - -/** - * @brief Cost type. - */ -@property (nonatomic, copy, nullable) NSString *costType; - -/** - * @brief Cost amount. - */ -@property (nonatomic, copy, nullable) NSNumber *costAmount; - -/** - * @brief Cost currency. - */ -@property (nonatomic, copy, nullable) NSString *costCurrency; - -/** - * @brief Make attribution object. - * - * @param jsonDict Dictionary holding attribution key value pairs. - * @param adid Adjust identifier value. - * - * @return Adjust attribution object. - */ -+ (nullable ADJAttribution *)dataWithJsonDict:(nonnull NSDictionary *)jsonDict adid:(nonnull NSString *)adid; - -- (nullable id)initWithJsonDict:(nonnull NSDictionary *)jsonDict adid:(nonnull NSString *)adid; - -/** - * @brief Check if given attribution equals current one. - * - * @param attribution Attribution object to be compared with current one. - * - * @return Boolean indicating whether two attribution objects are the equal. - */ -- (BOOL)isEqualToAttribution:(nonnull ADJAttribution *)attribution; - -/** - * @brief Get attribution value as dictionary. - * - * @return Dictionary containing attribution as key-value pairs. - */ -- (nullable NSDictionary *)dictionary; - -@end diff --git a/Assets/Adjust/iOS/ADJAttribution.h.meta b/Assets/Adjust/iOS/ADJAttribution.h.meta deleted file mode 100644 index 339eebcd..00000000 --- a/Assets/Adjust/iOS/ADJAttribution.h.meta +++ /dev/null @@ -1,21 +0,0 @@ -fileFormatVersion: 2 -guid: 7dddf8beb94ee49a7aba11b4e22e059c -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 0 - settings: {} - Editor: - enabled: 0 - settings: - DefaultValueInitialized: true - iOS: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJConfig.h b/Assets/Adjust/iOS/ADJConfig.h deleted file mode 100644 index e9b916e8..00000000 --- a/Assets/Adjust/iOS/ADJConfig.h +++ /dev/null @@ -1,299 +0,0 @@ -// -// ADJConfig.h -// adjust -// -// Created by Pedro Filipe on 30/10/14. -// Copyright (c) 2014 adjust GmbH. All rights reserved. -// - -#import - -#import "ADJLogger.h" -#import "ADJAttribution.h" -#import "ADJEventSuccess.h" -#import "ADJEventFailure.h" -#import "ADJSessionSuccess.h" -#import "ADJSessionFailure.h" - -/** - * @brief Optional delegate that will get informed about tracking results. - */ -@protocol AdjustDelegate - -@optional - -/** - * @brief Optional delegate method that gets called when the attribution information changed. - * - * @param attribution The attribution information. - * - * @note See ADJAttribution for details. - */ -- (void)adjustAttributionChanged:(nullable ADJAttribution *)attribution; - -/** - * @brief Optional delegate method that gets called when an event is tracked with success. - * - * @param eventSuccessResponseData The response information from tracking with success - * - * @note See ADJEventSuccess for details. - */ -- (void)adjustEventTrackingSucceeded:(nullable ADJEventSuccess *)eventSuccessResponseData; - -/** - * @brief Optional delegate method that gets called when an event is tracked with failure. - * - * @param eventFailureResponseData The response information from tracking with failure - * - * @note See ADJEventFailure for details. - */ -- (void)adjustEventTrackingFailed:(nullable ADJEventFailure *)eventFailureResponseData; - -/** - * @brief Optional delegate method that gets called when an session is tracked with success. - * - * @param sessionSuccessResponseData The response information from tracking with success - * - * @note See ADJSessionSuccess for details. - */ -- (void)adjustSessionTrackingSucceeded:(nullable ADJSessionSuccess *)sessionSuccessResponseData; - -/** - * @brief Optional delegate method that gets called when an session is tracked with failure. - * - * @param sessionFailureResponseData The response information from tracking with failure - * - * @note See ADJSessionFailure for details. - */ -- (void)adjustSessionTrackingFailed:(nullable ADJSessionFailure *)sessionFailureResponseData; - -/** - * @brief Optional delegate method that gets called when a deferred deep link is about to be opened by the adjust SDK. - * - * @param deeplink The deep link url that was received by the adjust SDK to be opened. - * - * @return Boolean that indicates whether the deep link should be opened by the adjust SDK or not. - */ -- (BOOL)adjustDeeplinkResponse:(nullable NSURL *)deeplink; - -/** - * @brief Optional SKAdNetwork pre 4.0 style delegate method that gets called when Adjust SDK sets conversion value for the user. - * - * @param conversionValue Conversion value used by Adjust SDK to invoke updateConversionValue: API. - */ -- (void)adjustConversionValueUpdated:(nullable NSNumber *)conversionValue; - -/** - * @brief Optional SKAdNetwork 4.0 style delegate method that gets called when Adjust SDK sets conversion value for the user. - * You can use this callback even with using pre 4.0 SKAdNetwork. - * In that case you can expect coarseValue and lockWindow values to be nil. - * - * @param fineValue Conversion value set by Adjust SDK. - * @param coarseValue Coarse value set by Adjust SDK. - * @param lockWindow Lock window set by Adjust SDK. - */ -- (void)adjustConversionValueUpdated:(nullable NSNumber *)fineValue - coarseValue:(nullable NSString *)coarseValue - lockWindow:(nullable NSNumber *)lockWindow; - -@end - -/** - * @brief Adjust configuration object class. - */ -@interface ADJConfig : NSObject - -/** - * @brief SDK prefix. - * - * @note Not to be used by users, intended for non-native adjust SDKs only. - */ -@property (nonatomic, copy, nullable) NSString *sdkPrefix; - -/** - * @brief Default tracker to attribute organic installs to (optional). - */ -@property (nonatomic, copy, nullable) NSString *defaultTracker; - -@property (nonatomic, copy, nullable) NSString *externalDeviceId; - -/** - * @brief Adjust app token. - */ -@property (nonatomic, copy, readonly, nonnull) NSString *appToken; - -/** - * @brief Adjust environment variable. - */ -@property (nonatomic, copy, readonly, nonnull) NSString *environment; - -/** - * @brief Change the verbosity of Adjust's logs. - * - * @note You can increase or reduce the amount of logs from Adjust by passing - * one of the following parameters. Use ADJLogLevelSuppress to disable all logging. - * The desired minimum log level (default: info) - * Must be one of the following: - * - ADJLogLevelVerbose (enable all logging) - * - ADJLogLevelDebug (enable more logging) - * - ADJLogLevelInfo (the default) - * - ADJLogLevelWarn (disable info logging) - * - ADJLogLevelError (disable warnings as well) - * - ADJLogLevelAssert (disable errors as well) - * - ADJLogLevelSuppress (suppress all logging) - */ -@property (nonatomic, assign) ADJLogLevel logLevel; - -/** - * @brief Enable event buffering if your app triggers a lot of events. - * When enabled, events get buffered and only get tracked each - * minute. Buffered events are still persisted, of course. - */ -@property (nonatomic, assign) BOOL eventBufferingEnabled; - -/** - * @brief Set the optional delegate that will inform you about attribution or events. - * - * @note See the AdjustDelegate declaration above for details. - */ -@property (nonatomic, weak, nullable) NSObject *delegate; - -/** - * @brief Enables sending in the background. - */ -@property (nonatomic, assign) BOOL sendInBackground; - -/** - * @brief Enables/disables reading of iAd framework data needed for ASA tracking. - */ -@property (nonatomic, assign) BOOL allowiAdInfoReading DEPRECATED_MSG_ATTRIBUTE("Apple Search Ads attribution with usage of iAd.framework has been sunset by Apple as of February 7th 2023"); - -/** - * @brief Enables/disables reading of AdServices framework data needed for attribution. - */ -@property (nonatomic, assign) BOOL allowAdServicesInfoReading; - -/** - * @brief Enables/disables reading of IDFA parameter. - */ -@property (nonatomic, assign) BOOL allowIdfaReading; - -/** - * @brief Enables delayed start of the SDK. - */ -@property (nonatomic, assign) double delayStart; - -/** - * @brief Define how many seconds to wait for ATT status before sending the first data. - */ -@property (nonatomic, assign) NSUInteger attConsentWaitingInterval; - -/** - * @brief User agent for the requests. - */ -@property (nonatomic, copy, nullable) NSString *userAgent; - -/** - * @brief Set if the device is known. - */ -@property (nonatomic, assign) BOOL isDeviceKnown; - -/** - * @brief Set if cost data is needed in attribution response. - */ -@property (nonatomic, assign) BOOL needsCost; - -/** - * @brief Adjust app secret id. - */ -@property (nonatomic, copy, readonly, nullable) NSString *secretId; - -/** - * @brief Adjust app secret. - */ -@property (nonatomic, copy, readonly, nullable) NSString *appSecret; - -/** - * @brief Adjust set app secret. - */ -- (void)setAppSecret:(NSUInteger)secretId - info1:(NSUInteger)info1 - info2:(NSUInteger)info2 - info3:(NSUInteger)info3 - info4:(NSUInteger)info4; - - -@property (nonatomic, assign, readonly) BOOL isSKAdNetworkHandlingActive; - -- (void)deactivateSKAdNetworkHandling; - -/** - * @brief Adjust url strategy. - */ -@property (nonatomic, copy, readwrite, nullable) NSString *urlStrategy; - -/** - * @brief Enables/disables linkMe - */ -@property (nonatomic, assign) BOOL linkMeEnabled; - -/** - * @brief Get configuration object for the initialization of the Adjust SDK. - * - * @param appToken The App Token of your app. This unique identifier can - * be found it in your dashboard at http://adjust.com and should always - * be 12 characters long. - * @param environment The current environment your app. We use this environment to - * distinguish between real traffic and artificial traffic from test devices. - * It is very important that you keep this value meaningful at all times! - * Especially if you are tracking revenue. - * - * @returns Adjust configuration object. - */ -+ (nullable ADJConfig *)configWithAppToken:(nonnull NSString *)appToken - environment:(nonnull NSString *)environment; - -- (nullable id)initWithAppToken:(nonnull NSString *)appToken - environment:(nonnull NSString *)environment; - -/** - * @brief Configuration object for the initialization of the Adjust SDK. - * - * @param appToken The App Token of your app. This unique identifier can - * be found it in your dashboard at http://adjust.com and should always - * be 12 characters long. - * @param environment The current environment your app. We use this environment to - * distinguish between real traffic and artificial traffic from test devices. - * It is very important that you keep this value meaningful at all times! - * Especially if you are tracking revenue. - * @param allowSuppressLogLevel If set to true, it allows usage of ADJLogLevelSuppress - * and replaces the default value for production environment. - * - * @returns Adjust configuration object. - */ -+ (nullable ADJConfig *)configWithAppToken:(nonnull NSString *)appToken - environment:(nonnull NSString *)environment - allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; - -- (nullable id)initWithAppToken:(nonnull NSString *)appToken - environment:(nonnull NSString *)environment - allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; - -/** - * @brief Check if adjust configuration object is valid. - * - * @return Boolean indicating whether adjust config object is valid or not. - */ -- (BOOL)isValid; - -/** - * @brief Enable COPPA (Children's Online Privacy Protection Act) compliant for the application. - */ -@property (nonatomic, assign) BOOL coppaCompliantEnabled; - -/** - * @brief Enables caching of device ids to read it only once - */ -@property (nonatomic, assign) BOOL readDeviceInfoOnceEnabled; - -@end diff --git a/Assets/Adjust/iOS/ADJConfig.h.meta b/Assets/Adjust/iOS/ADJConfig.h.meta deleted file mode 100644 index 62c3751d..00000000 --- a/Assets/Adjust/iOS/ADJConfig.h.meta +++ /dev/null @@ -1,21 +0,0 @@ -fileFormatVersion: 2 -guid: 0c958f3cabffd44b6a58b8e0621ee82e -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 0 - settings: {} - Editor: - enabled: 0 - settings: - DefaultValueInitialized: true - iOS: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJEvent.h b/Assets/Adjust/iOS/ADJEvent.h deleted file mode 100644 index a95e7d48..00000000 --- a/Assets/Adjust/iOS/ADJEvent.h +++ /dev/null @@ -1,159 +0,0 @@ -// -// ADJEvent.h -// adjust -// -// Created by Pedro Filipe on 15/10/14. -// Copyright (c) 2014 adjust GmbH. All rights reserved. -// - -#import - -/** - * @brief Adjust event class. - */ -@interface ADJEvent : NSObject - -/** - * @brief Revenue attached to the event. - */ -@property (nonatomic, copy, readonly, nonnull) NSNumber *revenue; - -/** - * @brief Event token. - */ -@property (nonatomic, copy, readonly, nonnull) NSString *eventToken; - -/** - * @brief IAP transaction ID. - */ -@property (nonatomic, copy, readonly, nonnull) NSString *transactionId; - -/** - * @brief Custom user defined event ID. - */ -@property (nonatomic, copy, readonly, nonnull) NSString *callbackId; - -/** - * @brief Currency value. - */ -@property (nonatomic, copy, readonly, nonnull) NSString *currency; - -/** - * @brief IAP receipt. - */ -@property (nonatomic, copy, readonly, nonnull) NSData *receipt; - -/** - * @brief List of partner parameters. - */ -@property (nonatomic, readonly, nonnull) NSDictionary *partnerParameters; - -/** - * @brief List of callback parameters. - */ -@property (nonatomic, readonly, nonnull) NSDictionary *callbackParameters; - -/** - * @brief Is the given receipt empty. - */ -@property (nonatomic, assign, readonly) BOOL emptyReceipt; - -/** - * @brief IAP product ID. - */ -@property (nonatomic, copy, readonly, nonnull) NSString *productId; - -/** - * @brief Create Event object with event token. - * - * @param eventToken Event token that is created in the dashboard - * at http://adjust.com and should be six characters long. - */ -+ (nullable ADJEvent *)eventWithEventToken:(nonnull NSString *)eventToken; - -- (nullable id)initWithEventToken:(nonnull NSString *)eventToken; - -/** - * @brief Add a key-pair to a callback URL. - * - * @param key String key in the callback URL. - * @param value String value of the key in the Callback URL. - * - * @note In your dashboard at http://adjust.com you can assign a callback URL to each - * event type. That URL will get called every time the event is triggered. On - * top of that you can add callback parameters to the following method that - * will be forwarded to these callbacks. - */ -- (void)addCallbackParameter:(nonnull NSString *)key value:(nonnull NSString *)value; - -/** - * @brief Add a key-pair to be fowarded to a partner. - * - * @param key String key to be fowarded to the partner. - * @param value String value of the key to be fowarded to the partner. - */ -- (void)addPartnerParameter:(nonnull NSString *)key value:(nonnull NSString *)value; - -/** - * @brief Set the revenue and associated currency of the event. - * - * @param amount The amount in units (example: for 1.50 EUR is 1.5). - * @param currency String of the currency with ISO 4217 format. - * It should be 3 characters long (example: for 1.50 EUR is @"EUR"). - * - * @note The event can contain some revenue. The amount revenue is measured in units. - * It must include a currency in the ISO 4217 format. - */ -- (void)setRevenue:(double)amount currency:(nonnull NSString *)currency; - -/** - * @brief Set the transaction ID of a In-App Purchases to avoid revenue duplications. - * - * @note A transaction ID can be used to avoid duplicate revenue events. The last ten - * transaction identifiers are remembered. - * - * @param transactionId The identifier used to avoid duplicate revenue events. - */ -- (void)setTransactionId:(nonnull NSString *)transactionId; - -/** - * @brief Set the custom user defined ID for the event which will be reported in - * success/failure callbacks. - * - * @param callbackId Custom user defined identifier for the event - */ -- (void)setCallbackId:(nonnull NSString *)callbackId; - -/** - * @brief Set the product ID of a In-App Purchases to perform IAP verification. - * - * @param productId The product ID of the purchased item. - */ -- (void)setProductId:(NSString * _Nonnull)productId; - -/** - * @brief Set the receipt of a In-App Purchases to perform IAP verification. - * - * @param receipt The receipt obtained after successful IAP. - */ -- (void)setReceipt:(NSData * _Nonnull)receipt; - -/** - * @brief Check if created adjust event object is valid. - * - * @return Boolean indicating whether the adjust event object is valid or not. - */ -- (BOOL)isValid; - -/** - * @brief Validate a in-app-purchase receipt. - * - * @param receipt The receipt to validate. - * @param transactionId The identifier used to validate the receipt and to avoid duplicate revenue events. - * - * @note This method is obsolete and should not be used. - * For more information, visit: https://github.com/adjust/ios_purchase_sdk - */ -- (void)setReceipt:(nonnull NSData *)receipt transactionId:(nonnull NSString *)transactionId; - -@end diff --git a/Assets/Adjust/iOS/ADJEvent.h.meta b/Assets/Adjust/iOS/ADJEvent.h.meta deleted file mode 100644 index 9191a16b..00000000 --- a/Assets/Adjust/iOS/ADJEvent.h.meta +++ /dev/null @@ -1,21 +0,0 @@ -fileFormatVersion: 2 -guid: 426362cccd2154c908b504e138832851 -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 0 - settings: {} - Editor: - enabled: 0 - settings: - DefaultValueInitialized: true - iOS: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJEventFailure.h b/Assets/Adjust/iOS/ADJEventFailure.h deleted file mode 100644 index ff272bbc..00000000 --- a/Assets/Adjust/iOS/ADJEventFailure.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// ADJEventFailure.h -// adjust -// -// Created by Pedro Filipe on 17/02/16. -// Copyright © 2016 adjust GmbH. All rights reserved. -// - -#import - -@interface ADJEventFailure : NSObject - -/** - * @brief Message from the adjust backend. - */ -@property (nonatomic, copy) NSString * message; - -/** - * @brief Timestamp from the adjust backend. - */ -@property (nonatomic, copy) NSString * timeStamp; - -/** - * @brief Adjust identifier of the device. - */ -@property (nonatomic, copy) NSString * adid; - -/** - * @brief Event token value. - */ -@property (nonatomic, copy) NSString * eventToken; - -/** - * @brief Event callback ID. - */ -@property (nonatomic, copy) NSString *callbackId; - -/** - * @brief Information whether sending of the package will be retried or not. - */ -@property (nonatomic, assign) BOOL willRetry; - -/** - * @brief Backend response in JSON format. - */ -@property (nonatomic, strong) NSDictionary *jsonResponse; - -/** - * @brief Initialisation method. - * - * @return ADJEventFailure instance. - */ -+ (ADJEventFailure *)eventFailureResponseData; - -@end diff --git a/Assets/Adjust/iOS/ADJEventFailure.h.meta b/Assets/Adjust/iOS/ADJEventFailure.h.meta deleted file mode 100644 index f495998c..00000000 --- a/Assets/Adjust/iOS/ADJEventFailure.h.meta +++ /dev/null @@ -1,147 +0,0 @@ -fileFormatVersion: 2 -guid: b274a5403f60c4e7ca731709d03d1ee8 -timeCreated: 1458122523 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - Exclude tvOS: 1 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - iPhone: iOS - second: - enabled: 1 - settings: - CompileFlags: - FrameworkDependencies: - data: - first: - tvOS: tvOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJEventSuccess.h b/Assets/Adjust/iOS/ADJEventSuccess.h deleted file mode 100644 index 34214e21..00000000 --- a/Assets/Adjust/iOS/ADJEventSuccess.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// ADJEventSuccess.h -// adjust -// -// Created by Pedro Filipe on 17/02/16. -// Copyright © 2016 adjust GmbH. All rights reserved. -// - -#import - -@interface ADJEventSuccess : NSObject - -/** - * @brief Message from the adjust backend. - */ -@property (nonatomic, copy) NSString *message; - -/** - * @brief Timestamp from the adjust backend. - */ -@property (nonatomic, copy) NSString *timeStamp; - -/** - * @brief Adjust identifier of the device. - */ -@property (nonatomic, copy) NSString *adid; - -/** - * @brief Event token value. - */ -@property (nonatomic, copy) NSString *eventToken; - -/** - * @brief Event callback ID. - */ -@property (nonatomic, copy) NSString *callbackId; - -/** - * @brief Backend response in JSON format. - */ -@property (nonatomic, strong) NSDictionary *jsonResponse; - -/** - * @brief Initialisation method. - * - * @return ADJEventSuccess instance. - */ -+ (ADJEventSuccess *)eventSuccessResponseData; - -@end diff --git a/Assets/Adjust/iOS/ADJEventSuccess.h.meta b/Assets/Adjust/iOS/ADJEventSuccess.h.meta deleted file mode 100644 index 01ed5f32..00000000 --- a/Assets/Adjust/iOS/ADJEventSuccess.h.meta +++ /dev/null @@ -1,147 +0,0 @@ -fileFormatVersion: 2 -guid: 65ff11a24f3b043759b70623a745a004 -timeCreated: 1458122523 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - Exclude tvOS: 1 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - iPhone: iOS - second: - enabled: 1 - settings: - CompileFlags: - FrameworkDependencies: - data: - first: - tvOS: tvOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJLinkResolution.h b/Assets/Adjust/iOS/ADJLinkResolution.h deleted file mode 100644 index 469b2581..00000000 --- a/Assets/Adjust/iOS/ADJLinkResolution.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// ADJLinkResolution.h -// Adjust -// -// Created by Pedro S. on 26.04.21. -// Copyright © 2021 adjust GmbH. All rights reserved. -// - -#import - -@interface ADJLinkResolution : NSObject - -+ (void)resolveLinkWithUrl:(nonnull NSURL *)url - resolveUrlSuffixArray:(nullable NSArray *)resolveUrlSuffixArray - callback:(nonnull void (^)(NSURL *_Nullable resolvedLink))callback; - -@end diff --git a/Assets/Adjust/iOS/ADJLinkResolution.h.meta b/Assets/Adjust/iOS/ADJLinkResolution.h.meta deleted file mode 100644 index 882981c5..00000000 --- a/Assets/Adjust/iOS/ADJLinkResolution.h.meta +++ /dev/null @@ -1,24 +0,0 @@ -fileFormatVersion: 2 -guid: c6eb7389a3c5c4df6ba3506c8fd4ad2c -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJLogger.h b/Assets/Adjust/iOS/ADJLogger.h deleted file mode 100644 index 95bb7433..00000000 --- a/Assets/Adjust/iOS/ADJLogger.h +++ /dev/null @@ -1,84 +0,0 @@ -// -// ADJLogger.h -// Adjust -// -// Created by Christian Wellenbrock on 2012-11-15. -// Copyright (c) 2012-2014 adjust GmbH. All rights reserved. -// -#import - -typedef enum { - ADJLogLevelVerbose = 1, - ADJLogLevelDebug = 2, - ADJLogLevelInfo = 3, - ADJLogLevelWarn = 4, - ADJLogLevelError = 5, - ADJLogLevelAssert = 6, - ADJLogLevelSuppress = 7 -} ADJLogLevel; - -/** - * @brief Adjust logger protocol. - */ -@protocol ADJLogger - -/** - * @brief Set the log level of the SDK. - * - * @param logLevel Level of the logs to be displayed. - */ -- (void)setLogLevel:(ADJLogLevel)logLevel isProductionEnvironment:(BOOL)isProductionEnvironment; - -/** - * @brief Prevent log level changes. - */ -- (void)lockLogLevel; - -/** - * @brief Print verbose logs. - */ -- (void)verbose:(nonnull NSString *)message, ...; - -/** - * @brief Print debug logs. - */ -- (void)debug:(nonnull NSString *)message, ...; - -/** - * @brief Print info logs. - */ -- (void)info:(nonnull NSString *)message, ...; - -/** - * @brief Print warn logs. - */ -- (void)warn:(nonnull NSString *)message, ...; -- (void)warnInProduction:(nonnull NSString *)message, ...; - -/** - * @brief Print error logs. - */ -- (void)error:(nonnull NSString *)message, ...; - -/** - * @brief Print assert logs. - */ -- (void)assert:(nonnull NSString *)message, ...; - -@end - -/** - * @brief Adjust logger class. - */ -@interface ADJLogger : NSObject - -/** - * @brief Convert log level string to ADJLogLevel enumeration. - * - * @param logLevelString Log level as string. - * - * @return Log level as ADJLogLevel enumeration. - */ -+ (ADJLogLevel)logLevelFromString:(nonnull NSString *)logLevelString; - -@end diff --git a/Assets/Adjust/iOS/ADJLogger.h.meta b/Assets/Adjust/iOS/ADJLogger.h.meta deleted file mode 100644 index 71c2cd1d..00000000 --- a/Assets/Adjust/iOS/ADJLogger.h.meta +++ /dev/null @@ -1,21 +0,0 @@ -fileFormatVersion: 2 -guid: 79bead718d24d4562b045c8fb25619ab -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 0 - settings: {} - Editor: - enabled: 0 - settings: - DefaultValueInitialized: true - iOS: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJPurchase.h b/Assets/Adjust/iOS/ADJPurchase.h deleted file mode 100644 index f1b54c95..00000000 --- a/Assets/Adjust/iOS/ADJPurchase.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// ADJPurchase.h -// Adjust -// -// Created by Uglješa Erceg (@uerceg) on May 25th 2023. -// Copyright © 2023 Adjust. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface ADJPurchase : NSObject - -@property (nonatomic, copy, readonly, nonnull) NSString *transactionId; - -@property (nonatomic, copy, readonly, nonnull) NSData *receipt; - -@property (nonatomic, copy, readonly, nonnull) NSString *productId; - -- (nullable id)initWithTransactionId:(nonnull NSString *)transactionId - productId:(nonnull NSString *)productId - andReceipt:(nonnull NSData *)receipt; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Assets/Adjust/iOS/ADJPurchase.h.meta b/Assets/Adjust/iOS/ADJPurchase.h.meta deleted file mode 100644 index 4564a822..00000000 --- a/Assets/Adjust/iOS/ADJPurchase.h.meta +++ /dev/null @@ -1,24 +0,0 @@ -fileFormatVersion: 2 -guid: ff1d54f5d01f3401a91bed3817d0dc25 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJPurchaseVerificationResult.h b/Assets/Adjust/iOS/ADJPurchaseVerificationResult.h deleted file mode 100644 index 3e8f4040..00000000 --- a/Assets/Adjust/iOS/ADJPurchaseVerificationResult.h +++ /dev/null @@ -1,38 +0,0 @@ -// -// ADJPurchaseVerificationResult.h -// Adjust -// -// Created by Uglješa Erceg (@uerceg) on May 25th 2023. -// Copyright © 2023 Adjust. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface ADJPurchaseVerificationResult : NSObject - -/** - * @property message - * - * @brief Text message about current state of receipt verification. - */ -@property (nonatomic, copy) NSString *message; - -/** - * @property code - * - * @brief Response code returned from Adjust backend server. - */ -@property (nonatomic, assign) int code; - -/** - * @property verificationStatus - * - * @brief State of verification (success / failure / unknown / not verified) - */ -@property (nonatomic, copy) NSString *verificationStatus; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Assets/Adjust/iOS/ADJPurchaseVerificationResult.h.meta b/Assets/Adjust/iOS/ADJPurchaseVerificationResult.h.meta deleted file mode 100644 index 673ca9bb..00000000 --- a/Assets/Adjust/iOS/ADJPurchaseVerificationResult.h.meta +++ /dev/null @@ -1,24 +0,0 @@ -fileFormatVersion: 2 -guid: 534a8868e882b4b99b1a9b98440bfedb -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJSessionFailure.h b/Assets/Adjust/iOS/ADJSessionFailure.h deleted file mode 100644 index 2ad9f207..00000000 --- a/Assets/Adjust/iOS/ADJSessionFailure.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// ADJFailureResponseData.h -// adjust -// -// Created by Pedro Filipe on 05/01/16. -// Copyright © 2016 adjust GmbH. All rights reserved. -// - -#import - -@interface ADJSessionFailure : NSObject - -/** - * @brief Message from the adjust backend. - */ -@property (nonatomic, copy, nullable) NSString *message; - -/** - * @brief Timestamp from the adjust backend. - */ -@property (nonatomic, copy, nullable) NSString *timeStamp; - -/** - * @brief Adjust identifier of the device. - */ -@property (nonatomic, copy, nullable) NSString *adid; - -/** - * @brief Information whether sending of the package will be retried or not. - */ -@property (nonatomic, assign) BOOL willRetry; - -/** - * @brief Backend response in JSON format. - */ -@property (nonatomic, strong, nullable) NSDictionary *jsonResponse; - -/** - * @brief Initialisation method. - * - * @return ADJSessionFailure instance. - */ -+ (nullable ADJSessionFailure *)sessionFailureResponseData; - -@end diff --git a/Assets/Adjust/iOS/ADJSessionFailure.h.meta b/Assets/Adjust/iOS/ADJSessionFailure.h.meta deleted file mode 100644 index d2bdd33c..00000000 --- a/Assets/Adjust/iOS/ADJSessionFailure.h.meta +++ /dev/null @@ -1,147 +0,0 @@ -fileFormatVersion: 2 -guid: cb5e6ddbbcae24783900c75db92ead71 -timeCreated: 1458122523 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - Exclude tvOS: 1 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - iPhone: iOS - second: - enabled: 1 - settings: - CompileFlags: - FrameworkDependencies: - data: - first: - tvOS: tvOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJSessionSuccess.h b/Assets/Adjust/iOS/ADJSessionSuccess.h deleted file mode 100644 index 8d6a04cf..00000000 --- a/Assets/Adjust/iOS/ADJSessionSuccess.h +++ /dev/null @@ -1,40 +0,0 @@ -// -// ADJSuccessResponseData.h -// adjust -// -// Created by Pedro Filipe on 05/01/16. -// Copyright © 2016 adjust GmbH. All rights reserved. -// - -#import - -@interface ADJSessionSuccess : NSObject - -/** - * @brief Message from the adjust backend. - */ -@property (nonatomic, copy, nullable) NSString *message; - -/** - * @brief Timestamp from the adjust backend. - */ -@property (nonatomic, copy, nullable) NSString *timeStamp; - -/** - * @brief Adjust identifier of the device. - */ -@property (nonatomic, copy, nullable) NSString *adid; - -/** - * @brief Backend response in JSON format. - */ -@property (nonatomic, strong, nullable) NSDictionary *jsonResponse; - -/** - * @brief Initialisation method. - * - * @return ADJSessionSuccess instance. - */ -+ (nullable ADJSessionSuccess *)sessionSuccessResponseData; - -@end diff --git a/Assets/Adjust/iOS/ADJSessionSuccess.h.meta b/Assets/Adjust/iOS/ADJSessionSuccess.h.meta deleted file mode 100644 index 9b169a3c..00000000 --- a/Assets/Adjust/iOS/ADJSessionSuccess.h.meta +++ /dev/null @@ -1,147 +0,0 @@ -fileFormatVersion: 2 -guid: 65455f64c4f194d6fb1e959ad638f311 -timeCreated: 1458122523 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - Exclude tvOS: 1 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - iPhone: iOS - second: - enabled: 1 - settings: - CompileFlags: - FrameworkDependencies: - data: - first: - tvOS: tvOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJSubscription.h b/Assets/Adjust/iOS/ADJSubscription.h deleted file mode 100644 index 92f5395e..00000000 --- a/Assets/Adjust/iOS/ADJSubscription.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// ADJSubscription.h -// Adjust -// -// Created by Uglješa Erceg on 16.04.20. -// Copyright © 2020 adjust GmbH. All rights reserved. -// - -#import - -@interface ADJSubscription : NSObject - -@property (nonatomic, copy, readonly, nonnull) NSDecimalNumber *price; // [M] revenue - -@property (nonatomic, copy, readonly, nonnull) NSString *currency; // [M] currency - -@property (nonatomic, copy, readonly, nonnull) NSString *transactionId; // [M] transaction_id - -@property (nonatomic, copy, readonly, nonnull) NSData *receipt; // [M] receipt - -@property (nonatomic, copy, readonly, nonnull) NSString *billingStore; // [M] billing_store - -@property (nonatomic, copy, readonly, nonnull) NSDate *transactionDate; // [O] transaction_date - -@property (nonatomic, copy, readonly, nonnull) NSString *salesRegion; // [O] sales_region - -@property (nonatomic, copy, readonly, nonnull) NSDictionary *callbackParameters; // [O] callback_params - -@property (nonatomic, copy, readonly, nonnull) NSDictionary *partnerParameters; // [O] partner_params - -- (nullable id)initWithPrice:(nonnull NSDecimalNumber *)price - currency:(nonnull NSString *)currency - transactionId:(nonnull NSString *)transactionId - andReceipt:(nonnull NSData *)receipt; - -- (void)setTransactionDate:(nonnull NSDate *)transactionDate; - -- (void)setSalesRegion:(nonnull NSString *)salesRegion; - -- (void)addCallbackParameter:(nonnull NSString *)key value:(nonnull NSString *)value; - -- (void)addPartnerParameter:(nonnull NSString *)key value:(nonnull NSString *)value; - -@end diff --git a/Assets/Adjust/iOS/ADJSubscription.h.meta b/Assets/Adjust/iOS/ADJSubscription.h.meta deleted file mode 100644 index 67385628..00000000 --- a/Assets/Adjust/iOS/ADJSubscription.h.meta +++ /dev/null @@ -1,24 +0,0 @@ -fileFormatVersion: 2 -guid: 15bc7056a22f34382aea2497343c3509 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/ADJThirdPartySharing.h b/Assets/Adjust/iOS/ADJThirdPartySharing.h deleted file mode 100644 index 29bceff6..00000000 --- a/Assets/Adjust/iOS/ADJThirdPartySharing.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// ADJThirdPartySharing.h -// AdjustSdk -// -// Created by Pedro S. on 02.12.20. -// Copyright © 2020 adjust GmbH. All rights reserved. -// - -#import - -@interface ADJThirdPartySharing : NSObject - -@property (nonatomic, nullable, readonly, strong) NSNumber *enabled; -@property (nonatomic, nonnull, readonly, strong) NSMutableDictionary *granularOptions; -@property (nonatomic, nonnull, readonly, strong) NSMutableDictionary *partnerSharingSettings; - -- (nullable id)initWithIsEnabledNumberBool:(nullable NSNumber *)isEnabledNumberBool; - -- (void)addGranularOption:(nonnull NSString *)partnerName - key:(nonnull NSString *)key - value:(nonnull NSString *)value; - -- (void)addPartnerSharingSetting:(nonnull NSString *)partnerName - key:(nonnull NSString *)key - value:(BOOL)value; - -@end - diff --git a/Assets/Adjust/iOS/ADJThirdPartySharing.h.meta b/Assets/Adjust/iOS/ADJThirdPartySharing.h.meta deleted file mode 100644 index b5248018..00000000 --- a/Assets/Adjust/iOS/ADJThirdPartySharing.h.meta +++ /dev/null @@ -1,24 +0,0 @@ -fileFormatVersion: 2 -guid: e34005ea3283c4e88bf3dc78e9e845e4 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/Adjust.h b/Assets/Adjust/iOS/Adjust.h deleted file mode 100644 index d4b1039c..00000000 --- a/Assets/Adjust/iOS/Adjust.h +++ /dev/null @@ -1,497 +0,0 @@ -// -// Adjust.h -// Adjust SDK -// -// V4.38.2 -// Created by Christian Wellenbrock (@wellle) on 23rd July 2013. -// Copyright (c) 2012-2021 Adjust GmbH. All rights reserved. -// - -#import "ADJEvent.h" -#import "ADJConfig.h" -#import "ADJAttribution.h" -#import "ADJSubscription.h" -#import "ADJThirdPartySharing.h" -#import "ADJAdRevenue.h" -#import "ADJLinkResolution.h" -#import "ADJPurchase.h" -#import "ADJPurchaseVerificationResult.h" - -typedef void(^AdjustResolvedDeeplinkBlock)(NSString * _Nonnull resolvedLink); - -@interface AdjustTestOptions : NSObject - -@property (nonatomic, copy, nullable) NSString *urlOverwrite; -@property (nonatomic, copy, nullable) NSString *extraPath; -@property (nonatomic, copy, nullable) NSNumber *timerIntervalInMilliseconds; -@property (nonatomic, copy, nullable) NSNumber *timerStartInMilliseconds; -@property (nonatomic, copy, nullable) NSNumber *sessionIntervalInMilliseconds; -@property (nonatomic, copy, nullable) NSNumber *subsessionIntervalInMilliseconds; -@property (nonatomic, copy, nullable) NSNumber *attStatusInt; -@property (nonatomic, copy, nullable) NSString *idfa; -@property (nonatomic, assign) BOOL teardown; -@property (nonatomic, assign) BOOL deleteState; -@property (nonatomic, assign) BOOL noBackoffWait; -@property (nonatomic, assign) BOOL adServicesFrameworkEnabled; -@property (nonatomic, assign) BOOL enableSigning; -@property (nonatomic, assign) BOOL disableSigning; - -@end - -/** - * Constants for our supported tracking environments. - */ -extern NSString * __nonnull const ADJEnvironmentSandbox; -extern NSString * __nonnull const ADJEnvironmentProduction; - -/** - * Constants for supported ad revenue sources. - */ -extern NSString * __nonnull const ADJAdRevenueSourceAppLovinMAX; -extern NSString * __nonnull const ADJAdRevenueSourceMopub; -extern NSString * __nonnull const ADJAdRevenueSourceAdMob; -extern NSString * __nonnull const ADJAdRevenueSourceIronSource; -extern NSString * __nonnull const ADJAdRevenueSourceAdMost; -extern NSString * __nonnull const ADJAdRevenueSourceUnity; -extern NSString * __nonnull const ADJAdRevenueSourceHeliumChartboost; -extern NSString * __nonnull const ADJAdRevenueSourcePublisher; -extern NSString * __nonnull const ADJAdRevenueSourceTopOn; -extern NSString * __nonnull const ADJAdRevenueSourceADX; -extern NSString * __nonnull const ADJAdRevenueSourceTradplus; - -/** - * Constants for country app's URL strategies. - */ -extern NSString * __nonnull const ADJUrlStrategyIndia; -extern NSString * __nonnull const ADJUrlStrategyChina; -extern NSString * __nonnull const ADJUrlStrategyCn; -extern NSString * __nonnull const ADJUrlStrategyCnOnly; -extern NSString * __nonnull const ADJDataResidencyEU; -extern NSString * __nonnull const ADJDataResidencyTR; -extern NSString * __nonnull const ADJDataResidencyUS; - -/** - * @brief The main interface to Adjust. - * - * @note Use the methods of this class to tell Adjust about the usage of your app. - * See the README for details. - */ -@interface Adjust : NSObject - -/** - * @brief Tell Adjust that the application did launch. - * This is required to initialize Adjust. Call this in the didFinishLaunching - * method of your AppDelegate. - * - * @note See ADJConfig.h for more configuration options - * - * @param adjustConfig The configuration object that includes the environment - * and the App Token of your app. This unique identifier can - * be found it in your dashboard at http://adjust.com and should always - * be 12 characters long. - */ -+ (void)appDidLaunch:(nullable ADJConfig *)adjustConfig; - -/** - * @brief Tell Adjust that a particular event has happened. - * - * @note See ADJEvent.h for more event options. - * - * @param event The Event object for this kind of event. It needs a event token - * that is created in the dashboard at http://adjust.com and should be six - * characters long. - */ -+ (void)trackEvent:(nullable ADJEvent *)event; - -/** - * @brief Tell adjust that the application resumed. - * - * @note Only necessary if the native notifications can't be used - * or if they will happen before call to appDidLaunch: is made. - */ -+ (void)trackSubsessionStart; - -/** - * @brief Tell adjust that the application paused. - * - * @note Only necessary if the native notifications can't be used. - */ -+ (void)trackSubsessionEnd; - -/** - * @brief Enable or disable the adjust SDK. This setting is saved for future sessions. - * - * @param enabled The flag to enable or disable the adjust SDK. - */ -+ (void)setEnabled:(BOOL)enabled; - -/** - * @brief Check if the SDK is enabled or disabled. - * - * return Boolean indicating whether SDK is enabled or not. - */ -+ (BOOL)isEnabled; - -/** - * @brief Read the URL that opened the application to search for an adjust deep link. - * - * @param url URL object which contains info about adjust deep link. - */ -+ (void)appWillOpenUrl:(nonnull NSURL *)url; - -/** - * @brief Process the deep link that has opened an app and potentially get a resolved link. - * - * @param deeplink URL object which contains info about adjust deep link. - * @param completionHandler Completion handler where either resolved or echoed deep link will be sent. - */ -+ (void)processDeeplink:(nonnull NSURL *)deeplink - completionHandler:(void (^_Nonnull)(NSString * _Nonnull resolvedLink))completionHandler; - -/** - * @brief Set the device token used by push notifications. - * - * @param deviceToken Apple push notification token for iOS device as NSData. - */ -+ (void)setDeviceToken:(nonnull NSData *)deviceToken; - -/** - * @brief Set the device token used by push notifications. - * This method is only used by Adjust non native SDKs. Don't use it anywhere else. - * - * @param pushToken Apple push notification token for iOS device as NSString. - */ -+ (void)setPushToken:(nonnull NSString *)pushToken; - -/** - * @brief Enable or disable offline mode. Activities won't be sent but they are saved when - * offline mode is disabled. This feature is not saved for future sessions. - * - * @param enabled The flag to enable or disable offline mode. - */ -+ (void)setOfflineMode:(BOOL)enabled; - -/** - * @brief Retrieve iOS device IDFA value. - * - * @return Device IDFA value. - */ -+ (nullable NSString *)idfa; - -/** - * @brief Retrieve iOS device IDFV value. - * - * @return Device IDFV value. - */ -+ (nullable NSString *)idfv; - - -/** - * @brief Get current adjust identifier for the user. - * - * @note Adjust identifier is available only after installation has been successfully tracked. - * - * @return Current adjust identifier value for the user. - */ -+ (nullable NSString *)adid; - -/** - * @brief Get current attribution for the user. - * - * @note Attribution information is available only after installation has been successfully tracked - * and attribution information arrived after that from the backend. - * - * @return Current attribution value for the user. - */ -+ (nullable ADJAttribution *)attribution; - -/** - * @brief Get current Adjust SDK version string. - * - * @return Adjust SDK version string (iosX.Y.Z). - */ -+ (nullable NSString *)sdkVersion; - -/** - * @brief Convert a universal link style URL to a deeplink style URL with the corresponding scheme. - * - * @param url URL object which contains info about adjust deep link. - * @param scheme Desired scheme to which you want your resulting URL object to be prefixed with. - * - * @return URL object in custom URL scheme style prefixed with given scheme name. - */ -+ (nullable NSURL *)convertUniversalLink:(nonnull NSURL *)url scheme:(nonnull NSString *)scheme; - -/** - * @brief Tell the adjust SDK to stop waiting for delayed initialisation timer to complete but rather to start - * upon this call. This should be called if you have obtained needed callback/partner parameters which you - * wanted to put as default ones before the delayedStart value you have set on ADJConfig has expired. - */ -+ (void)sendFirstPackages; - -/** - * @brief Tell adjust to send the request to Google and check if the installation - * belongs to Google AdWords campaign. - * - * @note Deprecated method, should not be used. - */ -+ (void)sendAdWordsRequest; - -/** - * @brief Add default callback parameter key-value pair which is going to be sent with each tracked session and event. - * - * @param key Default callback parameter key. - * @param value Default callback parameter value. - */ -+ (void)addSessionCallbackParameter:(nonnull NSString *)key value:(nonnull NSString *)value; - -/** - * @brief Add default partner parameter key-value pair which is going to be sent with each tracked session. - * - * @param key Default partner parameter key. - * @param value Default partner parameter value. - */ -+ (void)addSessionPartnerParameter:(nonnull NSString *)key value:(nonnull NSString *)value; - -/** - * @brief Remove default callback parameter from the session packages. - * - * @param key Default callback parameter key. - */ -+ (void)removeSessionCallbackParameter:(nonnull NSString *)key; - -/** - * @brief Remove default partner parameter from the session packages. - * - * @param key Default partner parameter key. - */ -+ (void)removeSessionPartnerParameter:(nonnull NSString *)key; - -/** - * @brief Remove all default callback parameters from the session packages. - */ -+ (void)resetSessionCallbackParameters; - -/** - * @brief Remove all default partner parameters from the session packages. - */ -+ (void)resetSessionPartnerParameters; - -/** - * @brief Give right user to be forgotten in accordance with GDPR law. - */ -+ (void)gdprForgetMe; - -/** - * @brief Track ad revenue for given source. - * - * @param source Ad revenue source. - * @param payload Ad revenue payload. - */ -+ (void)trackAdRevenue:(nonnull NSString *)source payload:(nonnull NSData *)payload; - -/** - * @brief Give right user to disable sharing data to any third-party. - */ -+ (void)disableThirdPartySharing; - -/** - * @brief Track third paty sharing with possibility to allow or disallow it. - * - * @param thirdPartySharing Third party sharing choice. - */ -+ (void)trackThirdPartySharing:(nonnull ADJThirdPartySharing *)thirdPartySharing; - -/** - * @brief Track measurement consent. - * - * @param enabled Value of the consent. - */ -+ (void)trackMeasurementConsent:(BOOL)enabled; - -/** - * @brief Track ad revenue. - * - * @param adRevenue Ad revenue object instance containing all the relevant ad revenue tracking data. - */ -+ (void)trackAdRevenue:(nonnull ADJAdRevenue *)adRevenue; - -/** - * @brief Track subscription. - * - * @param subscription Subscription object. - */ -+ (void)trackSubscription:(nonnull ADJSubscription *)subscription; - -/** - * @brief Adjust wrapper for requestTrackingAuthorizationWithCompletionHandler: method. - * - * @param completion Block which value of tracking authorization status will be delivered to. - */ -+ (void)requestTrackingAuthorizationWithCompletionHandler:(void (^_Nullable)(NSUInteger status))completion; - -/** - * @brief Getter for app tracking authorization status. - * - * @return Value of app tracking authorization status. - */ -+ (int)appTrackingAuthorizationStatus; - -/** - * @brief Adjust wrapper for SKAdNetwork's updateConversionValue: method. - * - * @param conversionValue Conversion value you would like SDK to set for given user. - */ -+ (void)updateConversionValue:(NSInteger)conversionValue; - -/** - * @brief Adjust wrapper for SKAdNetwork's updatePostbackConversionValue:completionHandler: method. - * - * @param conversionValue Conversion value you would like SDK to set for given user. - * @param completion Completion handler you can provide to catch and handle any errors. - */ -+ (void)updatePostbackConversionValue:(NSInteger)conversionValue - completionHandler:(void (^_Nullable)(NSError *_Nullable error))completion; - -/** - * @brief Adjust wrapper for SKAdNetwork's updatePostbackConversionValue:coarseValue:completionHandler: method. - * - * @param fineValue Conversion value you would like SDK to set for given user. - * @param coarseValue One of the possible SKAdNetworkCoarseConversionValue values. - * @param completion Completion handler you can provide to catch and handle any errors. - */ -+ (void)updatePostbackConversionValue:(NSInteger)fineValue - coarseValue:(nonnull NSString *)coarseValue - completionHandler:(void (^_Nullable)(NSError *_Nullable error))completion; - -/** - * @brief Adjust wrapper for SKAdNetwork's updatePostbackConversionValue:coarseValue:lockWindow:completionHandler: method. - * - * @param fineValue Conversion value you would like SDK to set for given user. - * @param coarseValue One of the possible SKAdNetworkCoarseConversionValue values. - * @param lockWindow A Boolean value that indicates whether to send the postback before the conversion window ends. - * @param completion Completion handler you can provide to catch and handle any errors. - */ -+ (void)updatePostbackConversionValue:(NSInteger)fineValue - coarseValue:(nonnull NSString *)coarseValue - lockWindow:(BOOL)lockWindow - completionHandler:(void (^_Nullable)(NSError *_Nullable error))completion; - -/** - * @brief Instruct to Adjust SDK to check current state of att_status. - */ -+ (void)checkForNewAttStatus; - -/** - * @brief Get the last deep link which has opened the app. - * - * @return Last deep link which has opened the app. - */ -+ (nullable NSURL *)lastDeeplink; - -/** - * @brief Verify in-app-purchase. - * - * @param purchase Purchase object. - * @param completionHandler Callback where verification result will be repoted. - */ -+ (void)verifyPurchase:(nonnull ADJPurchase *)purchase - completionHandler:(void (^_Nonnull)(ADJPurchaseVerificationResult * _Nonnull verificationResult))completionHandler; - -/** - * @brief Method used for internal testing only. Don't use it in production. - */ -+ (void)setTestOptions:(nullable AdjustTestOptions *)testOptions; - -/** - * Obtain singleton Adjust object. - */ -+ (nullable instancetype)getInstance; - -- (void)appDidLaunch:(nullable ADJConfig *)adjustConfig; - -- (void)trackEvent:(nullable ADJEvent *)event; - -- (void)setEnabled:(BOOL)enabled; - -- (void)teardown; - -- (void)appWillOpenUrl:(nonnull NSURL *)url; - -- (void)processDeeplink:(nonnull NSURL *)deeplink - completionHandler:(void (^_Nonnull)(NSString * _Nonnull resolvedLink))completionHandler; - -- (void)setOfflineMode:(BOOL)enabled; - -- (void)setDeviceToken:(nonnull NSData *)deviceToken; - -- (void)setPushToken:(nonnull NSString *)pushToken; - -- (void)sendFirstPackages; - -- (void)trackSubsessionEnd; - -- (void)trackSubsessionStart; - -- (void)resetSessionPartnerParameters; - -- (void)resetSessionCallbackParameters; - -- (void)removeSessionPartnerParameter:(nonnull NSString *)key; - -- (void)removeSessionCallbackParameter:(nonnull NSString *)key; - -- (void)addSessionPartnerParameter:(nonnull NSString *)key value:(nonnull NSString *)value; - -- (void)addSessionCallbackParameter:(nonnull NSString *)key value:(nonnull NSString *)value; - -- (void)gdprForgetMe; - -- (void)trackAdRevenue:(nonnull NSString *)source payload:(nonnull NSData *)payload; - -- (void)trackSubscription:(nonnull ADJSubscription *)subscription; - -- (BOOL)isEnabled; - -- (nullable NSString *)adid; - -- (nullable NSString *)idfa; - -- (nullable NSString *)sdkVersion; - -- (nullable ADJAttribution *)attribution; - -- (nullable NSURL *)convertUniversalLink:(nonnull NSURL *)url scheme:(nonnull NSString *)scheme; - -- (void)requestTrackingAuthorizationWithCompletionHandler:(void (^_Nullable)(NSUInteger status))completion; - -- (int)appTrackingAuthorizationStatus; - -- (void)updateConversionValue:(NSInteger)conversionValue; - -- (void)updatePostbackConversionValue:(NSInteger)conversionValue - completionHandler:(void (^_Nullable)(NSError *_Nullable error))completion; - -- (void)updatePostbackConversionValue:(NSInteger)fineValue - coarseValue:(nonnull NSString *)coarseValue - completionHandler:(void (^_Nullable)(NSError *_Nullable error))completion; - -- (void)updatePostbackConversionValue:(NSInteger)fineValue - coarseValue:(nonnull NSString *)coarseValue - lockWindow:(BOOL)lockWindow - completionHandler:(void (^_Nullable)(NSError *_Nullable error))completion; - -- (void)trackThirdPartySharing:(nonnull ADJThirdPartySharing *)thirdPartySharing; - -- (void)trackMeasurementConsent:(BOOL)enabled; - -- (void)trackAdRevenue:(nonnull ADJAdRevenue *)adRevenue; - -- (void)checkForNewAttStatus; - -- (nullable NSURL *)lastDeeplink; - -- (void)verifyPurchase:(nonnull ADJPurchase *)purchase - completionHandler:(void (^_Nonnull)(ADJPurchaseVerificationResult * _Nonnull verificationResult))completionHandler; - -@end diff --git a/Assets/Adjust/iOS/Adjust.h.meta b/Assets/Adjust/iOS/Adjust.h.meta deleted file mode 100644 index 4fd2266c..00000000 --- a/Assets/Adjust/iOS/Adjust.h.meta +++ /dev/null @@ -1,21 +0,0 @@ -fileFormatVersion: 2 -guid: 78f041701c2d94787bdb278a5bff4fae -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 0 - settings: {} - Editor: - enabled: 0 - settings: - DefaultValueInitialized: true - iOS: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/AdjustSdk.a b/Assets/Adjust/iOS/AdjustSdk.a deleted file mode 100644 index 9e7cc051..00000000 Binary files a/Assets/Adjust/iOS/AdjustSdk.a and /dev/null differ diff --git a/Assets/Adjust/iOS/AdjustSdk.a.meta b/Assets/Adjust/iOS/AdjustSdk.a.meta deleted file mode 100644 index bb65f59c..00000000 --- a/Assets/Adjust/iOS/AdjustSdk.a.meta +++ /dev/null @@ -1,147 +0,0 @@ -fileFormatVersion: 2 -guid: 7ecd19f430df2475dad6b1f0cc22114c -timeCreated: 1460026500 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - Exclude tvOS: 1 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - iPhone: iOS - second: - enabled: 1 - settings: - CompileFlags: - FrameworkDependencies: - data: - first: - tvOS: tvOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/AdjustUnity.h b/Assets/Adjust/iOS/AdjustUnity.h deleted file mode 100644 index ae8e8c20..00000000 --- a/Assets/Adjust/iOS/AdjustUnity.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// AdjustUnity.h -// Adjust SDK -// -// Created by Pedro Silva (@nonelse) on 27th March 2014. -// Copyright © 2012-2018 Adjust GmbH. All rights reserved. -// - -/** - * @brief The main interface to Adjust Unity bridge. - */ -@interface AdjustUnity : NSObject - -@end diff --git a/Assets/Adjust/iOS/AdjustUnity.h.meta b/Assets/Adjust/iOS/AdjustUnity.h.meta deleted file mode 100644 index 39950953..00000000 --- a/Assets/Adjust/iOS/AdjustUnity.h.meta +++ /dev/null @@ -1,21 +0,0 @@ -fileFormatVersion: 2 -guid: 9ffff8839c6ab418b983add4c597fb87 -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 0 - settings: {} - Editor: - enabled: 0 - settings: - DefaultValueInitialized: true - iOS: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/AdjustUnity.mm b/Assets/Adjust/iOS/AdjustUnity.mm deleted file mode 100644 index 93adcab4..00000000 --- a/Assets/Adjust/iOS/AdjustUnity.mm +++ /dev/null @@ -1,976 +0,0 @@ -// -// AdjustUnity.mm -// Adjust SDK -// -// Created by Pedro Silva (@nonelse) on 27th March 2014. -// Copyright © 2012-2018 Adjust GmbH. All rights reserved. -// - -#import "Adjust.h" -#import "ADJEvent.h" -#import "ADJConfig.h" -#import "AdjustUnity.h" -#import "AdjustUnityAppDelegate.h" -#import "AdjustUnityDelegate.h" - -@implementation AdjustUnity - -#pragma mark - Object lifecycle methods - -+ (void)load { - // Swizzle AppDelegate on the load. It should be done as early as possible. - [AdjustUnityAppDelegate swizzleAppDelegateCallbacks]; -} - -@end - -#pragma mark - Helper C methods - -// Method for converting JSON stirng parameters into NSArray object. -NSArray* convertArrayParameters(const char* cStringJsonArrayParameters) { - if (cStringJsonArrayParameters == NULL) { - return nil; - } - - NSError *error = nil; - NSArray *arrayParameters = nil; - NSString *stringJsonArrayParameters = [NSString stringWithUTF8String:cStringJsonArrayParameters]; - - if (stringJsonArrayParameters != nil) { - NSData *dataJson = [stringJsonArrayParameters dataUsingEncoding:NSUTF8StringEncoding]; - arrayParameters = [NSJSONSerialization JSONObjectWithData:dataJson options:0 error:&error]; - } - if (error != nil) { - NSString *errorMessage = @"Failed to parse json parameters!"; - NSLog(@"%@", errorMessage); - } - - 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; -} - -void addValueOrEmpty(NSMutableDictionary *dictionary, NSString *key, NSObject *value) { - if (nil != value) { - if ([value isKindOfClass:[NSString class]]) { - [dictionary setObject:[NSString stringWithFormat:@"%@", value] forKey:key]; - } else if ([value isKindOfClass:[NSNumber class]]) { - [dictionary setObject:[NSString stringWithFormat:@"%@", [((NSNumber *)value) stringValue]] forKey:key]; - } else { - [dictionary setObject:@"" forKey:key]; - } - } else { - [dictionary setObject:@"" forKey:key]; - } -} - -#pragma mark - Publicly available C methods - -extern "C" -{ - void _AdjustLaunchApp(const char* appToken, - const char* environment, - const char* sdkPrefix, - const char* userAgent, - const char* defaultTracker, - const char* externalDeviceId, - const char* urlStrategy, - const char* sceneName, - int allowSuppressLogLevel, - int logLevel, - int isDeviceKnown, - int eventBuffering, - int sendInBackground, - int allowAdServicesInfoReading, - int allowIdfaReading, - int deactivateSkAdNetworkHandling, - int linkMeEnabled, - int needsCost, - int coppaCompliant, - int readDeviceInfoOnce, - int64_t secretId, - int64_t info1, - int64_t info2, - int64_t info3, - int64_t info4, - double delayStart, - int attConsentWaitingInterval, - int launchDeferredDeeplink, - int isAttributionCallbackImplemented, - int isEventSuccessCallbackImplemented, - int isEventFailureCallbackImplemented, - int isSessionSuccessCallbackImplemented, - int isSessionFailureCallbackImplemented, - int isDeferredDeeplinkCallbackImplemented, - int isConversionValueUpdatedCallbackImplemented, - int isSkad4ConversionValueUpdatedCallbackImplemented) { - 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 *stringExternalDeviceId = isStringValid(externalDeviceId) == true ? [NSString stringWithUTF8String:externalDeviceId] : nil; - NSString *stringUrlStrategy = isStringValid(urlStrategy) == true ? [NSString stringWithUTF8String:urlStrategy] : nil; - NSString *stringSceneName = isStringValid(sceneName) == true ? [NSString stringWithUTF8String:sceneName] : nil; - - ADJConfig *adjustConfig; - - if (allowSuppressLogLevel != -1) { - adjustConfig = [ADJConfig configWithAppToken:stringAppToken - environment:stringEnvironment - allowSuppressLogLevel:(BOOL)allowSuppressLogLevel]; - } else { - adjustConfig = [ADJConfig configWithAppToken:stringAppToken - environment:stringEnvironment]; - } - - // Set SDK prefix. - [adjustConfig setSdkPrefix:stringSdkPrefix]; - - // Check if user has selected to implement any of the callbacks. - if (isAttributionCallbackImplemented - || isEventSuccessCallbackImplemented - || isEventFailureCallbackImplemented - || isSessionSuccessCallbackImplemented - || isSessionFailureCallbackImplemented - || isDeferredDeeplinkCallbackImplemented - || isConversionValueUpdatedCallbackImplemented - || isSkad4ConversionValueUpdatedCallbackImplemented) { - [adjustConfig setDelegate: - [AdjustUnityDelegate getInstanceWithSwizzleOfAttributionCallback:isAttributionCallbackImplemented - eventSuccessCallback:isEventSuccessCallbackImplemented - eventFailureCallback:isEventFailureCallbackImplemented - sessionSuccessCallback:isSessionSuccessCallbackImplemented - sessionFailureCallback:isSessionFailureCallbackImplemented - deferredDeeplinkCallback:isDeferredDeeplinkCallbackImplemented - conversionValueUpdatedCallback:isConversionValueUpdatedCallbackImplemented - skad4ConversionValueUpdatedCallback:isSkad4ConversionValueUpdatedCallbackImplemented - shouldLaunchDeferredDeeplink:launchDeferredDeeplink - withAdjustUnitySceneName:stringSceneName]]; - } - - // Log level. - if (logLevel != -1) { - [adjustConfig setLogLevel:(ADJLogLevel)logLevel]; - } - - // Event buffering. - if (eventBuffering != -1) { - [adjustConfig setEventBufferingEnabled:(BOOL)eventBuffering]; - } - - // Send in background. - if (sendInBackground != -1) { - [adjustConfig setSendInBackground:(BOOL)sendInBackground]; - } - - // Allow AdServices info reading. - if (allowAdServicesInfoReading != -1) { - [adjustConfig setAllowAdServicesInfoReading:(BOOL)allowAdServicesInfoReading]; - } - - // Deactivate default SKAdNetwork handling. - if (deactivateSkAdNetworkHandling != -1) { - [adjustConfig deactivateSKAdNetworkHandling]; - } - - // Allow IDFA reading. - if (allowIdfaReading != -1) { - [adjustConfig setAllowIdfaReading:(BOOL)allowIdfaReading]; - } - - // Enable LinkMe feature. - if (linkMeEnabled != -1) { - [adjustConfig setLinkMeEnabled:(BOOL)linkMeEnabled]; - } - - // Device known. - if (isDeviceKnown != -1) { - [adjustConfig setIsDeviceKnown:(BOOL)isDeviceKnown]; - } - - // Delay start. - if (delayStart != -1) { - [adjustConfig setDelayStart:delayStart]; - } - - // ATT dialog delay. - if (attConsentWaitingInterval != -1) { - [adjustConfig setAttConsentWaitingInterval:attConsentWaitingInterval]; - } - - // Cost data in attribution callback. - if (needsCost != -1) { - [adjustConfig setNeedsCost:(BOOL)needsCost]; - } - - // COPPA compliance. - if (coppaCompliant != -1) { - [adjustConfig setCoppaCompliantEnabled:(BOOL)coppaCompliant]; - } - - // Read device info just once. - if (readDeviceInfoOnce != -1) { - [adjustConfig setReadDeviceInfoOnceEnabled:(BOOL)readDeviceInfoOnce]; - } - - // User agent. - if (stringUserAgent != nil) { - [adjustConfig setUserAgent:stringUserAgent]; - } - - // Default tracker. - if (stringDefaultTracker != nil) { - [adjustConfig setDefaultTracker:stringDefaultTracker]; - } - - // External device identifier. - if (stringExternalDeviceId != nil) { - [adjustConfig setExternalDeviceId:stringExternalDeviceId]; - } - - // URL strategy. - if (stringUrlStrategy != nil) { - if ([stringUrlStrategy isEqualToString:@"china"]) { - [adjustConfig setUrlStrategy:ADJUrlStrategyChina]; - } else if ([stringUrlStrategy isEqualToString:@"india"]) { - [adjustConfig setUrlStrategy:ADJUrlStrategyIndia]; - } else if ([stringUrlStrategy isEqualToString:@"cn"]) { - [adjustConfig setUrlStrategy:ADJUrlStrategyCn]; - } else if ([stringUrlStrategy isEqualToString:@"cn-only"]) { - [adjustConfig setUrlStrategy:ADJUrlStrategyCnOnly]; - } else if ([stringUrlStrategy isEqualToString:@"data-residency-eu"]) { - [adjustConfig setUrlStrategy:ADJDataResidencyEU]; - } else if ([stringUrlStrategy isEqualToString:@"data-residency-tr"]) { - [adjustConfig setUrlStrategy:ADJDataResidencyTR]; - } else if ([stringUrlStrategy isEqualToString:@"data-residency-us"]) { - [adjustConfig setUrlStrategy:ADJDataResidencyUS]; - } - } - - // App secret. - if (secretId != -1 && info1 != -1 && info2 != -1 && info3 != -1 && info4 != 1) { - [adjustConfig setAppSecret:secretId info1:info1 info2:info2 info3:info3 info4:info4]; - } - - // Start the SDK. - [Adjust appDidLaunch:adjustConfig]; - [Adjust trackSubsessionStart]; - } - - void _AdjustTrackEvent(const char* eventToken, - double revenue, - const char* currency, - const char* receipt, - const char* receiptBase64, - const char* productId, - const char* transactionId, - const char* callbackId, - int isReceiptSet, - const char* jsonCallbackParameters, - const char* jsonPartnerParameters) { - NSString *stringEventToken = isStringValid(eventToken) == true ? [NSString stringWithUTF8String:eventToken] : nil; - ADJEvent *event = [ADJEvent eventWithEventToken:stringEventToken]; - - // Revenue and currency. - if (revenue != -1 && currency != NULL) { - NSString *stringCurrency = [NSString stringWithUTF8String:currency]; - [event setRevenue:revenue currency:stringCurrency]; - } - - // Callback parameters. - NSArray *arrayCallbackParameters = convertArrayParameters(jsonCallbackParameters); - if (arrayCallbackParameters != nil) { - NSUInteger count = [arrayCallbackParameters count]; - for (int i = 0; i < count;) { - NSString *key = arrayCallbackParameters[i++]; - NSString *value = arrayCallbackParameters[i++]; - [event addCallbackParameter:key value:value]; - } - } - - NSArray *arrayPartnerParameters = convertArrayParameters(jsonPartnerParameters); - if (arrayPartnerParameters != nil) { - NSUInteger count = [arrayPartnerParameters count]; - for (int i = 0; i < count;) { - NSString *key = arrayPartnerParameters[i++]; - NSString *value = arrayPartnerParameters[i++]; - [event addPartnerParameter:key value:value]; - } - } - - // Transaction ID. - if (transactionId != NULL) { - NSString *stringTransactionId = [NSString stringWithUTF8String:transactionId]; - [event setTransactionId:stringTransactionId]; - } - - // Product ID. - if (productId != NULL) { - NSString *stringProductId = [NSString stringWithUTF8String:productId]; - [event setProductId:stringProductId]; - } - - // Receipt. - if (receipt != NULL) { - NSString *stringReceipt = [NSString stringWithUTF8String:receipt]; - [event setReceipt:[stringReceipt dataUsingEncoding:NSUTF8StringEncoding]]; - } - - // Base64 encoded receipt. - if (receiptBase64 != NULL) { - // If both (receipt and receiptBase64) set, receiptBase64 will be used. - NSString *stringReceiptBase64 = [NSString stringWithUTF8String:receiptBase64]; - NSData *decodedData = [[NSData alloc] initWithBase64EncodedString:stringReceiptBase64 options:0]; - [event setReceipt:decodedData]; - } - - // Callback ID. - if (callbackId != NULL) { - NSString *stringCallbackId = [NSString stringWithUTF8String:callbackId]; - [event setCallbackId:stringCallbackId]; - } - - // Receipt (legacy). - // if ([[NSNumber numberWithInt:isReceiptSet] boolValue]) { - // NSString *stringReceipt = nil; - // NSString *stringTransactionId = nil; - - // if (receipt != NULL) { - // stringReceipt = [NSString stringWithUTF8String:receipt]; - // } - // if (transactionId != NULL) { - // stringTransactionId = [NSString stringWithUTF8String:transactionId]; - // } - - // [event setReceipt:[stringReceipt dataUsingEncoding:NSUTF8StringEncoding] transactionId:stringTransactionId]; - // } - - // Track event. - [Adjust trackEvent:event]; - } - - void _AdjustTrackSubsessionStart() { - [Adjust trackSubsessionStart]; - } - - void _AdjustTrackSubsessionEnd() { - [Adjust trackSubsessionEnd]; - } - - void _AdjustSetEnabled(int enabled) { - BOOL bEnabled = (BOOL)enabled; - [Adjust setEnabled:bEnabled]; - } - - int _AdjustIsEnabled() { - BOOL isEnabled = [Adjust isEnabled]; - int iIsEnabled = (int)isEnabled; - return iIsEnabled; - } - - void _AdjustSetOfflineMode(int enabled) { - BOOL bEnabled = (BOOL)enabled; - [Adjust setOfflineMode:bEnabled]; - } - - void _AdjustSetDeviceToken(const char* deviceToken) { - if (deviceToken != NULL) { - NSString *stringDeviceToken = [NSString stringWithUTF8String:deviceToken]; - [Adjust setPushToken:stringDeviceToken]; - } - } - - void _AdjustAppWillOpenUrl(const char* url) { - if (url != NULL) { - NSString *stringUrl = [NSString stringWithUTF8String:url]; - NSURL *nsUrl; - if ([NSString instancesRespondToSelector:@selector(stringByAddingPercentEncodingWithAllowedCharacters:)]) { - nsUrl = [NSURL URLWithString:[stringUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]]; - } else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - nsUrl = [NSURL URLWithString:[stringUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; - } -#pragma clang diagnostic pop - - [Adjust appWillOpenUrl:nsUrl]; - } - } - - char* _AdjustGetIdfa() { - NSString *idfa = [Adjust idfa]; - if (nil == idfa) { - return NULL; - } - - const char* idfaCString = [idfa UTF8String]; - if (NULL == idfaCString) { - return NULL; - } - - char* idfaCStringCopy = strdup(idfaCString); - return idfaCStringCopy; - } - - char* _AdjustGetIdfv() { - NSString *idfv = [Adjust idfv]; - if (nil == idfv) { - return NULL; - } - - const char* idfvCString = [idfv UTF8String]; - if (NULL == idfvCString) { - return NULL; - } - - char* idfvCStringCopy = strdup(idfvCString); - return idfvCStringCopy; - } - - char* _AdjustGetAdid() { - NSString *adid = [Adjust adid]; - if (nil == adid) { - return NULL; - } - - const char* adidCString = [adid UTF8String]; - if (NULL == adidCString) { - return NULL; - } - - char* adidCStringCopy = strdup(adidCString); - return adidCStringCopy; - } - - char* _AdjustGetSdkVersion() { - NSString *sdkVersion = [Adjust sdkVersion]; - if (nil == sdkVersion) { - return NULL; - } - - const char* sdkVersionCString = [sdkVersion UTF8String]; - if (NULL == sdkVersionCString) { - return NULL; - } - - char* sdkVersionCStringCopy = strdup(sdkVersionCString); - return sdkVersionCStringCopy; - } - - char* _AdjustGetAttribution() { - ADJAttribution *attribution = [Adjust attribution]; - if (nil == attribution) { - return NULL; - } - - NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; - addValueOrEmpty(dictionary, @"trackerToken", attribution.trackerToken); - addValueOrEmpty(dictionary, @"trackerName", attribution.trackerName); - addValueOrEmpty(dictionary, @"network", attribution.network); - addValueOrEmpty(dictionary, @"campaign", attribution.campaign); - addValueOrEmpty(dictionary, @"creative", attribution.creative); - addValueOrEmpty(dictionary, @"adgroup", attribution.adgroup); - addValueOrEmpty(dictionary, @"clickLabel", attribution.clickLabel); - addValueOrEmpty(dictionary, @"adid", attribution.adid); - addValueOrEmpty(dictionary, @"costType", attribution.costType); - addValueOrEmpty(dictionary, @"costAmount", attribution.costAmount); - addValueOrEmpty(dictionary, @"costCurrency", attribution.costCurrency); - - NSData *dataAttribution = [NSJSONSerialization dataWithJSONObject:dictionary options:0 error:nil]; - NSString *stringAttribution = [[NSString alloc] initWithBytes:[dataAttribution bytes] - length:[dataAttribution length] - encoding:NSUTF8StringEncoding]; - const char* attributionCString = [stringAttribution UTF8String]; - char* attributionCStringCopy = strdup(attributionCString); - return attributionCStringCopy; - } - - void _AdjustSendFirstPackages() { - [Adjust sendFirstPackages]; - } - - void _AdjustGdprForgetMe() { - [Adjust gdprForgetMe]; - } - - void _AdjustDisableThirdPartySharing() { - [Adjust disableThirdPartySharing]; - } - - void _AdjustAddSessionPartnerParameter(const char* key, const char* value) { - if (key != NULL && value != NULL) { - NSString *stringKey = [NSString stringWithUTF8String:key]; - NSString *stringValue = [NSString stringWithUTF8String:value]; - [Adjust addSessionPartnerParameter:stringKey value:stringValue]; - } - } - - void _AdjustAddSessionCallbackParameter(const char* key, const char* value) { - if (key != NULL && value != NULL) { - NSString *stringKey = [NSString stringWithUTF8String:key]; - NSString *stringValue = [NSString stringWithUTF8String:value]; - [Adjust addSessionCallbackParameter:stringKey value:stringValue]; - } - } - - void _AdjustRemoveSessionPartnerParameter(const char* key) { - if (key != NULL) { - NSString *stringKey = [NSString stringWithUTF8String:key]; - [Adjust removeSessionPartnerParameter:stringKey]; - } - } - - void _AdjustRemoveSessionCallbackParameter(const char* key) { - if (key != NULL) { - NSString *stringKey = [NSString stringWithUTF8String:key]; - [Adjust removeSessionCallbackParameter:stringKey]; - } - } - - void _AdjustResetSessionPartnerParameters() { - [Adjust resetSessionPartnerParameters]; - } - - void _AdjustResetSessionCallbackParameters() { - [Adjust resetSessionCallbackParameters]; - } - - void _AdjustTrackAdRevenue(const char* source, const char* payload) { - if (source != NULL && payload != NULL) { - NSString *stringSource = [NSString stringWithUTF8String:source]; - NSString *stringPayload = [NSString stringWithUTF8String:payload]; - NSData *dataPayload = [stringPayload dataUsingEncoding:NSUTF8StringEncoding]; - [Adjust trackAdRevenue:stringSource payload:dataPayload]; - } - } - - void _AdjustTrackAdRevenueNew(const char* source, - double revenue, - const char* currency, - int adImpressionsCount, - const char* adRevenueNetwork, - const char* adRevenueUnit, - const char* adRevenuePlacement, - const char* jsonCallbackParameters, - const char* jsonPartnerParameters) { - NSString *stringSource = isStringValid(source) == true ? [NSString stringWithUTF8String:source] : nil; - ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:stringSource]; - - // Revenue and currency. - if (revenue != -1 && currency != NULL) { - NSString *stringCurrency = [NSString stringWithUTF8String:currency]; - [adRevenue setRevenue:revenue currency:stringCurrency]; - } - - // Ad impressions count. - if (adImpressionsCount != -1) { - [adRevenue setAdImpressionsCount:adImpressionsCount]; - } - - // Ad revenue network. - if (adRevenueNetwork != NULL) { - NSString *stringAdRevenueNetwork = [NSString stringWithUTF8String:adRevenueNetwork]; - [adRevenue setAdRevenueNetwork:stringAdRevenueNetwork]; - } - - // Ad revenue unit. - if (adRevenueUnit != NULL) { - NSString *stringAdRevenueUnit = [NSString stringWithUTF8String:adRevenueUnit]; - [adRevenue setAdRevenueUnit:stringAdRevenueUnit]; - } - - // Ad revenue placement. - if (adRevenuePlacement != NULL) { - NSString *stringAdRevenuePlacement = [NSString stringWithUTF8String:adRevenuePlacement]; - [adRevenue setAdRevenuePlacement:stringAdRevenuePlacement]; - } - - // Callback parameters. - NSArray *arrayCallbackParameters = convertArrayParameters(jsonCallbackParameters); - if (arrayCallbackParameters != nil) { - NSUInteger count = [arrayCallbackParameters count]; - for (int i = 0; i < count;) { - NSString *key = arrayCallbackParameters[i++]; - NSString *value = arrayCallbackParameters[i++]; - [adRevenue addCallbackParameter:key value:value]; - } - } - - NSArray *arrayPartnerParameters = convertArrayParameters(jsonPartnerParameters); - if (arrayPartnerParameters != nil) { - NSUInteger count = [arrayPartnerParameters count]; - for (int i = 0; i < count;) { - NSString *key = arrayPartnerParameters[i++]; - NSString *value = arrayPartnerParameters[i++]; - [adRevenue addPartnerParameter:key value:value]; - } - } - - // Track ad revenue. - [Adjust trackAdRevenue:adRevenue]; - } - - void _AdjustTrackAppStoreSubscription(const char* price, - const char* currency, - const char* transactionId, - const char* receipt, - const char* billingStore, - const char* transactionDate, - const char* salesRegion, - const char* jsonCallbackParameters, - const char* jsonPartnerParameters) { - // Mandatory fields. - NSDecimalNumber *mPrice; - NSString *mCurrency; - NSString *mTransactionId; - NSData *mReceipt; - NSString *mBillingStore; - - // Price. - if (price != NULL) { - mPrice = [NSDecimalNumber decimalNumberWithString:[NSString stringWithUTF8String:price]]; - } - - // Currency. - if (currency != NULL) { - mCurrency = [NSString stringWithUTF8String:currency]; - } - - // Transaction ID. - if (transactionId != NULL) { - mTransactionId = [NSString stringWithUTF8String:transactionId]; - } - - // Receipt. - if (receipt != NULL) { - mReceipt = [[NSString stringWithUTF8String:receipt] dataUsingEncoding:NSUTF8StringEncoding]; - } - - // Billing store (not used ATM, maybe in the future). - if (billingStore != NULL) { - mBillingStore = [NSString stringWithUTF8String:billingStore]; - } - - ADJSubscription *subscription = [[ADJSubscription alloc] initWithPrice:mPrice - currency:mCurrency - transactionId:mTransactionId - andReceipt:mReceipt]; - - // Optional fields. - - // Transaction date. - if (transactionDate != NULL) { - NSTimeInterval transactionDateInterval = [[NSString stringWithUTF8String:transactionDate] doubleValue] / 1000.0; - NSDate *oTransactionDate = [NSDate dateWithTimeIntervalSince1970:transactionDateInterval]; - [subscription setTransactionDate:oTransactionDate]; - } - - // Sales region. - if (salesRegion != NULL) { - NSString *oSalesRegion = [NSString stringWithUTF8String:salesRegion]; - [subscription setSalesRegion:oSalesRegion]; - } - - // Callback parameters. - NSArray *arrayCallbackParameters = convertArrayParameters(jsonCallbackParameters); - if (arrayCallbackParameters != nil) { - NSUInteger count = [arrayCallbackParameters count]; - for (int i = 0; i < count;) { - NSString *key = arrayCallbackParameters[i++]; - NSString *value = arrayCallbackParameters[i++]; - [subscription addCallbackParameter:key value:value]; - } - } - - // Partner parameters. - NSArray *arrayPartnerParameters = convertArrayParameters(jsonPartnerParameters); - if (arrayPartnerParameters != nil) { - NSUInteger count = [arrayPartnerParameters count]; - for (int i = 0; i < count;) { - NSString *key = arrayPartnerParameters[i++]; - NSString *value = arrayPartnerParameters[i++]; - [subscription addPartnerParameter:key value:value]; - } - } - - // Track subscription. - [Adjust trackSubscription:subscription]; - } - - void _AdjustTrackThirdPartySharing(int enabled, const char* jsonGranularOptions, const char* jsonPartnerSharingSettings) { - NSNumber *nEnabled = enabled >= 0 ? [NSNumber numberWithInt:enabled] : nil; - ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:nEnabled]; - - NSArray *arrayGranularOptions = convertArrayParameters(jsonGranularOptions); - if (arrayGranularOptions != nil) { - NSUInteger count = [arrayGranularOptions count]; - for (int i = 0; i < count;) { - NSString *partnerName = arrayGranularOptions[i++]; - NSString *granularOptions = arrayGranularOptions[i++]; - // granularOptions is now NSString which pretty much contains array of partner key-value pairs - if (granularOptions != nil) { - NSData *dataJson = [granularOptions dataUsingEncoding:NSUTF8StringEncoding]; - NSArray *partnerGranularOptions = [NSJSONSerialization JSONObjectWithData:dataJson options:0 error:nil]; - if (partnerGranularOptions != nil) { - // in here we have partner and key-value pair for it - for (int j = 0; j < [partnerGranularOptions count];) { - [adjustThirdPartySharing addGranularOption:partnerName - key:partnerGranularOptions[j++] - value:partnerGranularOptions[j++]]; - } - } - } - } - } - NSArray *arrayPartnerSharingSettings = convertArrayParameters(jsonPartnerSharingSettings); - if (arrayPartnerSharingSettings != nil) { - NSUInteger count = [arrayPartnerSharingSettings count]; - for (int i = 0; i < count;) { - NSString *partnerName = arrayPartnerSharingSettings[i++]; - NSString *sharingSettings = arrayPartnerSharingSettings[i++]; - // sharingSettings is now NSString which pretty much contains array of partner key-value pairs - if (sharingSettings != nil) { - NSData *dataJson = [sharingSettings dataUsingEncoding:NSUTF8StringEncoding]; - NSArray *partnerSharingSettings = [NSJSONSerialization JSONObjectWithData:dataJson options:0 error:nil]; - if (partnerSharingSettings != nil) { - // in here we have partner and key-value pair for it - for (int j = 0; j < [partnerSharingSettings count];) { - [adjustThirdPartySharing addPartnerSharingSetting:partnerName - key:partnerSharingSettings[j++] - value:[partnerSharingSettings[j++] boolValue]]; - } - } - } - } - } - - [Adjust trackThirdPartySharing:adjustThirdPartySharing]; - } - - void _AdjustTrackMeasurementConsent(int enabled) { - BOOL bEnabled = (BOOL)enabled; - [Adjust trackMeasurementConsent:bEnabled]; - } - - void _AdjustRequestTrackingAuthorizationWithCompletionHandler(const char* sceneName) { - NSString *stringSceneName = isStringValid(sceneName) == true ? [NSString stringWithUTF8String:sceneName] : nil; - if (stringSceneName == nil) { - return; - } - - [Adjust requestTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) { - NSString *stringStatus = [NSString stringWithFormat:@"%tu", status]; - const char* charStatus = [stringStatus UTF8String]; - UnitySendMessage([stringSceneName UTF8String], "GetAuthorizationStatus", charStatus); - }]; - } - - void _AdjustUpdateConversionValue(int conversionValue) { - [Adjust updateConversionValue:conversionValue]; - } - - void _AdjustUpdateConversionValueWithCallback(int conversionValue, const char* sceneName) { - NSString *stringSceneName = isStringValid(sceneName) == true ? [NSString stringWithUTF8String:sceneName] : nil; - [Adjust updatePostbackConversionValue:conversionValue completionHandler:^(NSError * _Nullable error) { - if (stringSceneName == nil) { - return; - } - NSString *errorString = [error description]; - const char* errorChar = [errorString UTF8String]; - UnitySendMessage([stringSceneName UTF8String], "GetNativeSkadCompletionDelegate", errorChar); - }]; - } - - void _AdjustUpdateConversionValueWithCallbackSkad4(int conversionValue, const char* coarseValue, int lockWindow, const char* sceneName) { - NSString *stringSceneName = isStringValid(sceneName) == true ? [NSString stringWithUTF8String:sceneName] : nil; - if (coarseValue != NULL) { - NSString *stringCoarseValue = [NSString stringWithUTF8String:coarseValue]; - BOOL bLockWindow = (BOOL)lockWindow; - [Adjust updatePostbackConversionValue:conversionValue - coarseValue:stringCoarseValue - lockWindow:bLockWindow - completionHandler:^(NSError * _Nullable error) { - if (stringSceneName == nil) { - return; - } - NSString *errorString = [error description]; - const char* errorChar = [errorString UTF8String]; - UnitySendMessage([stringSceneName UTF8String], "GetNativeSkad4CompletionDelegate", errorChar); - }]; - } - } - - void _AdjustCheckForNewAttStatus() { - [Adjust checkForNewAttStatus]; - } - - int _AdjustGetAppTrackingAuthorizationStatus() { - return [Adjust appTrackingAuthorizationStatus]; - } - - char* _AdjustGetLastDeeplink() { - NSURL *lastDeeplink = [Adjust lastDeeplink]; - if (nil == lastDeeplink) { - return NULL; - } - NSString *lastDeeplinkString = [lastDeeplink absoluteString]; - if (nil == lastDeeplinkString) { - return NULL; - } - const char* lastDeeplinkCString = [lastDeeplinkString UTF8String]; - if (NULL == lastDeeplinkCString) { - return NULL; - } - - char* lastDeeplinkCStringCopy = strdup(lastDeeplinkCString); - return lastDeeplinkCStringCopy; - } - - void _AdjustVerifyAppStorePurchase(const char* transactionId, - const char* productId, - const char* receipt, - const char* sceneName) { - // Mandatory fields. - NSString *strTransactionId; - NSString *strProductId; - NSData *dataReceipt; - NSString *strSceneName; - - // Transaction ID. - if (transactionId != NULL) { - strTransactionId = [NSString stringWithUTF8String:transactionId]; - } - - // Product ID. - if (productId != NULL) { - strProductId = [NSString stringWithUTF8String:productId]; - } - - // Receipt. - if (receipt != NULL) { - NSString *stringReceiptBase64 = [NSString stringWithUTF8String:receipt]; - dataReceipt = [[NSData alloc] initWithBase64EncodedString:stringReceiptBase64 options:0]; - } - - // Scene name. - strSceneName = isStringValid(sceneName) == true ? [NSString stringWithUTF8String:sceneName] : nil; - - // Verify the purchase. - ADJPurchase *purchase = [[ADJPurchase alloc] initWithTransactionId:strTransactionId - productId:strProductId - andReceipt:dataReceipt]; - [Adjust verifyPurchase:purchase - completionHandler:^(ADJPurchaseVerificationResult * _Nonnull verificationResult) { - if (strSceneName == nil) { - return; - } - if (verificationResult == nil) { - return; - } - - NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; - addValueOrEmpty(dictionary, @"verificationStatus", verificationResult.verificationStatus); - addValueOrEmpty(dictionary, @"code", [NSString stringWithFormat:@"%d", verificationResult.code]); - addValueOrEmpty(dictionary, @"message", verificationResult.message); - - NSData *dataVerificationInfo = [NSJSONSerialization dataWithJSONObject:dictionary options:0 error:nil]; - NSString *strVerificationInfo = [[NSString alloc] initWithBytes:[dataVerificationInfo bytes] - length:[dataVerificationInfo length] - encoding:NSUTF8StringEncoding]; - const char* verificationInfoCString = [strVerificationInfo UTF8String]; - UnitySendMessage([strSceneName UTF8String], "GetNativeVerificationInfo", verificationInfoCString); - }]; - } - - void _AdjustProcessDeeplink(const char* url, const char* sceneName) { - NSString *strSceneName = isStringValid(sceneName) == true ? [NSString stringWithUTF8String:sceneName] : nil; - if (url != NULL) { - NSString *stringUrl = [NSString stringWithUTF8String:url]; - NSURL *nsUrl; - if ([NSString instancesRespondToSelector:@selector(stringByAddingPercentEncodingWithAllowedCharacters:)]) { - nsUrl = [NSURL URLWithString:[stringUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]]; - } else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - nsUrl = [NSURL URLWithString:[stringUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; - } -#pragma clang diagnostic pop - - [Adjust processDeeplink:nsUrl completionHandler:^(NSString * _Nonnull resolvedLink) { - if (strSceneName == nil) { - return; - } - if (resolvedLink == nil) { - return; - } - const char* resolvedLinkCString = [resolvedLink UTF8String]; - UnitySendMessage([strSceneName UTF8String], "GetNativeResolvedLink", resolvedLinkCString); - }]; - } - } - - void _AdjustSetTestOptions(const char* overwriteUrl, - const char* extraPath, - long timerIntervalInMilliseconds, - long timerStartInMilliseconds, - long sessionIntervalInMilliseconds, - long subsessionIntervalInMilliseconds, - int teardown, - int deleteState, - int noBackoffWait, - int adServicesFrameworkEnabled, - int attStatus, - const char *idfa) { - AdjustTestOptions *testOptions = [[AdjustTestOptions alloc] init]; - - NSString *stringOverwriteUrl = isStringValid(overwriteUrl) == true ? [NSString stringWithUTF8String:overwriteUrl] : nil; - if (stringOverwriteUrl != nil) { - [testOptions setUrlOverwrite:stringOverwriteUrl]; - } - NSString *stringExtraPath = isStringValid(extraPath) == true ? [NSString stringWithUTF8String:extraPath] : nil; - if (stringExtraPath != nil && [stringExtraPath length] > 0) { - [testOptions setExtraPath:stringExtraPath]; - } - NSString *stringIdfa = isStringValid(idfa) == true ? [NSString stringWithUTF8String:idfa] : nil; - if (stringIdfa != nil && [stringIdfa length] > 0) { - [testOptions setIdfa:stringIdfa]; - } - - testOptions.timerIntervalInMilliseconds = [NSNumber numberWithLong:timerIntervalInMilliseconds]; - testOptions.timerStartInMilliseconds = [NSNumber numberWithLong:timerStartInMilliseconds]; - testOptions.sessionIntervalInMilliseconds = [NSNumber numberWithLong:sessionIntervalInMilliseconds]; - testOptions.subsessionIntervalInMilliseconds = [NSNumber numberWithLong:subsessionIntervalInMilliseconds]; - testOptions.attStatusInt = [NSNumber numberWithInt:attStatus]; - - if (teardown != -1) { - [AdjustUnityDelegate teardown]; - [testOptions setTeardown:(BOOL)teardown]; - } - if (deleteState != -1) { - [testOptions setDeleteState:(BOOL)deleteState]; - } - if (noBackoffWait != -1) { - [testOptions setNoBackoffWait:(BOOL)noBackoffWait]; - } - if (adServicesFrameworkEnabled != -1) { - [testOptions setAdServicesFrameworkEnabled:(BOOL)adServicesFrameworkEnabled]; - } - - [Adjust setTestOptions:testOptions]; - } -} diff --git a/Assets/Adjust/iOS/AdjustUnity.mm.meta b/Assets/Adjust/iOS/AdjustUnity.mm.meta deleted file mode 100644 index 2b85fff8..00000000 --- a/Assets/Adjust/iOS/AdjustUnity.mm.meta +++ /dev/null @@ -1,131 +0,0 @@ -fileFormatVersion: 2 -guid: 3e17e20d987e4449489d9e3accbd8602 -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - Exclude tvOS: 1 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - iPhone: iOS - second: - enabled: 1 - settings: - CompileFlags: - FrameworkDependencies: - data: - first: - tvOS: tvOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/AdjustUnityAppDelegate.h.meta b/Assets/Adjust/iOS/AdjustUnityAppDelegate.h.meta deleted file mode 100644 index 1b4f2bd7..00000000 --- a/Assets/Adjust/iOS/AdjustUnityAppDelegate.h.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: ac4b0b80967dd499b94e6bd430ac6662 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/AdjustUnityDelegate.h b/Assets/Adjust/iOS/AdjustUnityDelegate.h deleted file mode 100644 index 0e45f0fb..00000000 --- a/Assets/Adjust/iOS/AdjustUnityDelegate.h +++ /dev/null @@ -1,59 +0,0 @@ -// -// AdjustUnityDelegate.h -// Adjust SDK -// -// Created by Uglješa Erceg (@uerceg) on 5th December 2016. -// Copyright © 2012-2018 Adjust GmbH. All rights reserved. -// - -#import "Adjust.h" - -/** - * @brief The main interface to Adjust Unity delegate. Used to do callback methods swizzling where needed. - */ -@interface AdjustUnityDelegate : NSObject - -/** - * @brief Boolean indicating whether deferred deep link should be launched by SDK or not. - */ -@property (nonatomic) BOOL shouldLaunchDeferredDeeplink; - -/** - * @brief Name of the Unity scene that loads Adjust SDK. - */ -@property (nonatomic, copy) NSString *adjustUnitySceneName; - -/** - * @brief Get instance of the AdjustUnityDelegate with properly swizzled callback methods. - * - * @param swizzleAttributionCallback Indicator whether attribution callback should be swizzled or not. - * @param swizzleEventSuccessCallback Indicator whether event success callback should be swizzled or not. - * @param swizzleEventFailureCallback Indicator whether event failure callback should be swizzled or not. - * @param swizzleSessionSuccessCallback Indicator whether session success callback should be swizzled or not. - * @param swizzleSessionFailureCallback Indicator whether session failure callback should be swizzled or not. - * @param swizzleDeferredDeeplinkCallback Indicator whether deferred deep link callback should be swizzled or not. - * @param swizzleConversionValueUpdatedCallback Indicator whether SKAD conversion value update callback should be swizzled or not. - * @param swizzleSkad4ConversionValueUpdatedCallback Indicator whether SKAD4 conversion value update callback should be swizzled or not. - * @param shouldLaunchDeferredDeeplink Indicator whether SDK should launch deferred deep link by default or not. - * @param adjustUnitySceneName Name of the Unity scene that loads Adjust SDK. - * - * @return AdjustUnityDelegate object instance with properly swizzled callback methods. - */ -+ (id)getInstanceWithSwizzleOfAttributionCallback:(BOOL)swizzleAttributionCallback - eventSuccessCallback:(BOOL)swizzleEventSuccessCallback - eventFailureCallback:(BOOL)swizzleEventFailureCallback - sessionSuccessCallback:(BOOL)swizzleSessionSuccessCallback - sessionFailureCallback:(BOOL)swizzleSessionFailureCallback - deferredDeeplinkCallback:(BOOL)swizzleDeferredDeeplinkCallback - conversionValueUpdatedCallback:(BOOL)swizzleConversionValueUpdatedCallback - skad4ConversionValueUpdatedCallback:(BOOL)swizzleSkad4ConversionValueUpdatedCallback - shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink - withAdjustUnitySceneName:(NSString *)adjustUnitySceneName; - -/** - * @brief Teardown method used to reset static AdjustUnityDelegate instance. - * Used for testing purposes only. - */ -+ (void)teardown; - -@end diff --git a/Assets/Adjust/iOS/AdjustUnityDelegate.h.meta b/Assets/Adjust/iOS/AdjustUnityDelegate.h.meta deleted file mode 100644 index 5c1040a2..00000000 --- a/Assets/Adjust/iOS/AdjustUnityDelegate.h.meta +++ /dev/null @@ -1,147 +0,0 @@ -fileFormatVersion: 2 -guid: 5d2beef19c617f74fbca612cc97e3c60 -timeCreated: 1489655216 -licenseType: Pro -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - Exclude tvOS: 1 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - iPhone: iOS - second: - enabled: 1 - settings: - CompileFlags: - FrameworkDependencies: - data: - first: - tvOS: tvOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/AdjustUnityDelegate.mm b/Assets/Adjust/iOS/AdjustUnityDelegate.mm deleted file mode 100644 index 587235b1..00000000 --- a/Assets/Adjust/iOS/AdjustUnityDelegate.mm +++ /dev/null @@ -1,270 +0,0 @@ -// -// AdjustUnityDelegate.mm -// Adjust SDK -// -// Created by Uglješa Erceg (@uerceg) on 5th December 2016. -// Copyright © 2012-2018 Adjust GmbH. All rights reserved. -// - -#import -#import "AdjustUnityDelegate.h" - -static dispatch_once_t onceToken; -static AdjustUnityDelegate *defaultInstance = nil; - -@implementation AdjustUnityDelegate - -#pragma mark - Object lifecycle methods - -- (id)init { - self = [super init]; - if (nil == self) { - return nil; - } - return self; -} - -#pragma mark - Public methods - -+ (id)getInstanceWithSwizzleOfAttributionCallback:(BOOL)swizzleAttributionCallback - eventSuccessCallback:(BOOL)swizzleEventSuccessCallback - eventFailureCallback:(BOOL)swizzleEventFailureCallback - sessionSuccessCallback:(BOOL)swizzleSessionSuccessCallback - sessionFailureCallback:(BOOL)swizzleSessionFailureCallback - deferredDeeplinkCallback:(BOOL)swizzleDeferredDeeplinkCallback - conversionValueUpdatedCallback:(BOOL)swizzleConversionValueUpdatedCallback - skad4ConversionValueUpdatedCallback:(BOOL)swizzleSkad4ConversionValueUpdatedCallback - shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink - withAdjustUnitySceneName:(NSString *)adjustUnitySceneName { - dispatch_once(&onceToken, ^{ - defaultInstance = [[AdjustUnityDelegate alloc] init]; - - // Do the swizzling where and if needed. - if (swizzleAttributionCallback) { - [defaultInstance swizzleOriginalSelector:@selector(adjustAttributionChanged:) - withSelector:@selector(adjustAttributionChangedWannabe:)]; - } - if (swizzleEventSuccessCallback) { - [defaultInstance swizzleOriginalSelector:@selector(adjustEventTrackingSucceeded:) - withSelector:@selector(adjustEventTrackingSucceededWannabe:)]; - } - if (swizzleEventFailureCallback) { - [defaultInstance swizzleOriginalSelector:@selector(adjustEventTrackingFailed:) - withSelector:@selector(adjustEventTrackingFailedWannabe:)]; - } - if (swizzleSessionSuccessCallback) { - [defaultInstance swizzleOriginalSelector:@selector(adjustSessionTrackingSucceeded:) - withSelector:@selector(adjustSessionTrackingSucceededWannabe:)]; - } - if (swizzleSessionFailureCallback) { - [defaultInstance swizzleOriginalSelector:@selector(adjustSessionTrackingFailed:) - withSelector:@selector(adjustSessionTrackingFailedWannabe:)]; - } - if (swizzleDeferredDeeplinkCallback) { - [defaultInstance swizzleOriginalSelector:@selector(adjustDeeplinkResponse:) - withSelector:@selector(adjustDeeplinkResponseWannabe:)]; - } - if (swizzleConversionValueUpdatedCallback) { - [defaultInstance swizzleOriginalSelector:@selector(adjustConversionValueUpdated:) - withSelector:@selector(adjustConversionValueUpdatedWannabe:)]; - } - if (swizzleSkad4ConversionValueUpdatedCallback) { - [defaultInstance swizzleOriginalSelector:@selector(adjustConversionValueUpdated:coarseValue:lockWindow:) - withSelector:@selector(adjustConversionValueUpdatedWannabe:coarseValue:lockWindow:)]; - } - - [defaultInstance setShouldLaunchDeferredDeeplink:shouldLaunchDeferredDeeplink]; - [defaultInstance setAdjustUnitySceneName:adjustUnitySceneName]; - }); - - return defaultInstance; -} - -+ (void)teardown { - defaultInstance = nil; - onceToken = 0; -} - -#pragma mark - Private & helper methods - -- (void)adjustAttributionChangedWannabe:(ADJAttribution *)attribution { - if (attribution == nil) { - return; - } - - NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; - [self addValueOrEmpty:attribution.trackerToken forKey:@"trackerToken" toDictionary:dictionary]; - [self addValueOrEmpty:attribution.trackerName forKey:@"trackerName" toDictionary:dictionary]; - [self addValueOrEmpty:attribution.network forKey:@"network" toDictionary:dictionary]; - [self addValueOrEmpty:attribution.campaign forKey:@"campaign" toDictionary:dictionary]; - [self addValueOrEmpty:attribution.creative forKey:@"creative" toDictionary:dictionary]; - [self addValueOrEmpty:attribution.adgroup forKey:@"adgroup" toDictionary:dictionary]; - [self addValueOrEmpty:attribution.clickLabel forKey:@"clickLabel" toDictionary:dictionary]; - [self addValueOrEmpty:attribution.adid forKey:@"adid" toDictionary:dictionary]; - [self addValueOrEmpty:attribution.costType forKey:@"costType" toDictionary:dictionary]; - [self addValueOrEmpty:attribution.costAmount forKey:@"costAmount" toDictionary:dictionary]; - [self addValueOrEmpty:attribution.costCurrency forKey:@"costCurrency" toDictionary:dictionary]; - - NSData *dataAttribution = [NSJSONSerialization dataWithJSONObject:dictionary options:0 error:nil]; - NSString *stringAttribution = [[NSString alloc] initWithBytes:[dataAttribution bytes] - length:[dataAttribution length] - encoding:NSUTF8StringEncoding]; - const char* charArrayAttribution = [stringAttribution UTF8String]; - UnitySendMessage([self.adjustUnitySceneName UTF8String], "GetNativeAttribution", charArrayAttribution); -} - -- (void)adjustEventTrackingSucceededWannabe:(ADJEventSuccess *)eventSuccessResponseData { - if (nil == eventSuccessResponseData) { - return; - } - - NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; - [self addValueOrEmpty:eventSuccessResponseData.message forKey:@"message" toDictionary:dictionary]; - [self addValueOrEmpty:eventSuccessResponseData.timeStamp forKey:@"timestamp" toDictionary:dictionary]; - [self addValueOrEmpty:eventSuccessResponseData.adid forKey:@"adid" toDictionary:dictionary]; - [self addValueOrEmpty:eventSuccessResponseData.eventToken forKey:@"eventToken" toDictionary:dictionary]; - [self addValueOrEmpty:eventSuccessResponseData.callbackId forKey:@"callbackId" toDictionary:dictionary]; - if (eventSuccessResponseData.jsonResponse != nil) { - [dictionary setObject:eventSuccessResponseData.jsonResponse forKey:@"jsonResponse"]; - } - - NSData *dataEventSuccess = [NSJSONSerialization dataWithJSONObject:dictionary options:0 error:nil]; - NSString *stringEventSuccess = [[NSString alloc] initWithBytes:[dataEventSuccess bytes] - length:[dataEventSuccess length] - encoding:NSUTF8StringEncoding]; - const char* charArrayEventSuccess = [stringEventSuccess UTF8String]; - UnitySendMessage([self.adjustUnitySceneName UTF8String], "GetNativeEventSuccess", charArrayEventSuccess); -} - -- (void)adjustEventTrackingFailedWannabe:(ADJEventFailure *)eventFailureResponseData { - if (nil == eventFailureResponseData) { - return; - } - - NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; - [self addValueOrEmpty:eventFailureResponseData.message forKey:@"message" toDictionary:dictionary]; - [self addValueOrEmpty:eventFailureResponseData.timeStamp forKey:@"timestamp" toDictionary:dictionary]; - [self addValueOrEmpty:eventFailureResponseData.adid forKey:@"adid" toDictionary:dictionary]; - [self addValueOrEmpty:eventFailureResponseData.eventToken forKey:@"eventToken" toDictionary:dictionary]; - [self addValueOrEmpty:eventFailureResponseData.callbackId forKey:@"callbackId" toDictionary:dictionary]; - [dictionary setObject:(eventFailureResponseData.willRetry ? @"true" : @"false") forKey:@"willRetry"]; - if (eventFailureResponseData.jsonResponse != nil) { - [dictionary setObject:eventFailureResponseData.jsonResponse forKey:@"jsonResponse"]; - } - - NSData *dataEventFailure = [NSJSONSerialization dataWithJSONObject:dictionary options:0 error:nil]; - NSString *stringEventFailure = [[NSString alloc] initWithBytes:[dataEventFailure bytes] - length:[dataEventFailure length] - encoding:NSUTF8StringEncoding]; - const char* charArrayEventFailure = [stringEventFailure UTF8String]; - UnitySendMessage([self.adjustUnitySceneName UTF8String], "GetNativeEventFailure", charArrayEventFailure); -} - -- (void)adjustSessionTrackingSucceededWannabe:(ADJSessionSuccess *)sessionSuccessResponseData { - if (nil == sessionSuccessResponseData) { - return; - } - - NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; - [self addValueOrEmpty:sessionSuccessResponseData.message forKey:@"message" toDictionary:dictionary]; - [self addValueOrEmpty:sessionSuccessResponseData.timeStamp forKey:@"timestamp" toDictionary:dictionary]; - [self addValueOrEmpty:sessionSuccessResponseData.adid forKey:@"adid" toDictionary:dictionary]; - if (sessionSuccessResponseData.jsonResponse != nil) { - [dictionary setObject:sessionSuccessResponseData.jsonResponse forKey:@"jsonResponse"]; - } - - NSData *dataSessionSuccess = [NSJSONSerialization dataWithJSONObject:dictionary options:0 error:nil]; - NSString *stringSessionSuccess = [[NSString alloc] initWithBytes:[dataSessionSuccess bytes] - length:[dataSessionSuccess length] - encoding:NSUTF8StringEncoding]; - const char* charArraySessionSuccess = [stringSessionSuccess UTF8String]; - UnitySendMessage([self.adjustUnitySceneName UTF8String], "GetNativeSessionSuccess", charArraySessionSuccess); -} - -- (void)adjustSessionTrackingFailedWannabe:(ADJSessionFailure *)sessionFailureResponseData { - if (nil == sessionFailureResponseData) { - return; - } - - NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; - [self addValueOrEmpty:sessionFailureResponseData.message forKey:@"message" toDictionary:dictionary]; - [self addValueOrEmpty:sessionFailureResponseData.timeStamp forKey:@"timestamp" toDictionary:dictionary]; - [self addValueOrEmpty:sessionFailureResponseData.adid forKey:@"adid" toDictionary:dictionary]; - [dictionary setObject:(sessionFailureResponseData.willRetry ? @"true" : @"false") forKey:@"willRetry"]; - if (sessionFailureResponseData.jsonResponse != nil) { - [dictionary setObject:sessionFailureResponseData.jsonResponse forKey:@"jsonResponse"]; - } - - NSData *dataSessionFailure = [NSJSONSerialization dataWithJSONObject:dictionary options:0 error:nil]; - NSString *stringSessionFailure = [[NSString alloc] initWithBytes:[dataSessionFailure bytes] - length:[dataSessionFailure length] - encoding:NSUTF8StringEncoding]; - const char* charArraySessionFailure = [stringSessionFailure UTF8String]; - UnitySendMessage([self.adjustUnitySceneName UTF8String], "GetNativeSessionFailure", charArraySessionFailure); -} - -- (BOOL)adjustDeeplinkResponseWannabe:(NSURL *)deeplink { - NSString *stringDeeplink = [deeplink absoluteString]; - const char* charDeeplink = [stringDeeplink UTF8String]; - UnitySendMessage([self.adjustUnitySceneName UTF8String], "GetNativeDeferredDeeplink", charDeeplink); - return _shouldLaunchDeferredDeeplink; -} - -- (void)adjustConversionValueUpdatedWannabe:(NSNumber *)conversionValue { - NSString *stringConversionValue = [conversionValue stringValue]; - const char* charConversionValue = [stringConversionValue UTF8String]; - UnitySendMessage([self.adjustUnitySceneName UTF8String], "GetNativeConversionValueUpdated", charConversionValue); -} - -- (void)adjustConversionValueUpdatedWannabe:(nullable NSNumber *)fineValue - coarseValue:(nullable NSString *)coarseValue - lockWindow:(nullable NSNumber *)lockWindow { - NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; - [self addValueOrEmpty:fineValue forKey:@"fineValue" toDictionary:dictionary]; - [self addValueOrEmpty:coarseValue forKey:@"coarseValue" toDictionary:dictionary]; - [self addValueOrEmpty:lockWindow forKey:@"lockWindow" toDictionary:dictionary]; - NSData *dataConversionValueUpdate = [NSJSONSerialization dataWithJSONObject:dictionary options:0 error:nil]; - NSString *stringConversionValueUpdate = [[NSString alloc] initWithBytes:[dataConversionValueUpdate bytes] - length:[dataConversionValueUpdate length] - encoding:NSUTF8StringEncoding]; - const char* charConversionValueUpdate = [stringConversionValueUpdate UTF8String]; - UnitySendMessage([self.adjustUnitySceneName UTF8String], "GetNativeSkad4ConversionValueUpdated", charConversionValueUpdate); -} - -- (void)swizzleOriginalSelector:(SEL)originalSelector - withSelector:(SEL)swizzledSelector { - Class className = [self class]; - Method originalMethod = class_getInstanceMethod(className, originalSelector); - Method swizzledMethod = class_getInstanceMethod(className, swizzledSelector); - - BOOL didAddMethod = class_addMethod(className, - originalSelector, - method_getImplementation(swizzledMethod), - method_getTypeEncoding(swizzledMethod)); - if (didAddMethod) { - class_replaceMethod(className, - swizzledSelector, - method_getImplementation(originalMethod), - method_getTypeEncoding(originalMethod)); - } else { - method_exchangeImplementations(originalMethod, swizzledMethod); - } -} - -- (void)addValueOrEmpty:(NSObject *)value - forKey:(NSString *)key - toDictionary:(NSMutableDictionary *)dictionary { - if (nil != value) { - if ([value isKindOfClass:[NSString class]]) { - [dictionary setObject:[NSString stringWithFormat:@"%@", value] forKey:key]; - } else if ([value isKindOfClass:[NSNumber class]]) { - [dictionary setObject:[NSString stringWithFormat:@"%@", [((NSNumber *)value) stringValue]] forKey:key]; - } else { - [dictionary setObject:@"" forKey:key]; - } - } else { - [dictionary setObject:@"" forKey:key]; - } -} - -@end diff --git a/Assets/Adjust/iOS/AdjustUnityDelegate.mm.meta b/Assets/Adjust/iOS/AdjustUnityDelegate.mm.meta deleted file mode 100644 index 553d0cd4..00000000 --- a/Assets/Adjust/iOS/AdjustUnityDelegate.mm.meta +++ /dev/null @@ -1,133 +0,0 @@ -fileFormatVersion: 2 -guid: 81438eed05b2e4b489f13efc94d5476a -timeCreated: 1489655217 -licenseType: Pro -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - Exclude tvOS: 1 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - OS: AnyOS - data: - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - iPhone: iOS - second: - enabled: 1 - settings: - CompileFlags: - FrameworkDependencies: - data: - first: - tvOS: tvOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/AdjustiOS.cs b/Assets/Adjust/iOS/AdjustiOS.cs deleted file mode 100644 index b2730e92..00000000 --- a/Assets/Adjust/iOS/AdjustiOS.cs +++ /dev/null @@ -1,637 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using UnityEngine; - -namespace com.adjust.sdk -{ -#if UNITY_IOS - public class AdjustiOS - { - private const string sdkPrefix = "unity4.38.1"; - - [DllImport("__Internal")] - private static extern void _AdjustLaunchApp( - string appToken, - string environment, - string sdkPrefix, - string userAgent, - string defaultTracker, - string extenralDeviceId, - string urlStrategy, - string sceneName, - int allowSuppressLogLevel, - int logLevel, - int isDeviceKnown, - int eventBuffering, - int sendInBackground, - int allowAdServicesInfoReading, - int allowIdfaReading, - int deactivateSkAdNetworkHandling, - int linkMeEnabled, - int needsCost, - int coppaCompliant, - int readDeviceInfoOnce, - long secretId, - long info1, - long info2, - long info3, - long info4, - double delayStart, - int attConsentWaitingInterval, - int launchDeferredDeeplink, - int isAttributionCallbackImplemented, - int isEventSuccessCallbackImplemented, - int isEventFailureCallbackImplemented, - int isSessionSuccessCallbackImplemented, - int isSessionFailureCallbackImplemented, - int isDeferredDeeplinkCallbackImplemented, - int isConversionValueUpdatedCallbackImplemented, - int isSkad4ConversionValueUpdatedCallbackImplemented); - - [DllImport("__Internal")] - private static extern void _AdjustTrackEvent( - string eventToken, - double revenue, - string currency, - string receipt, - string receiptBase64, - string productId, - string transactionId, - string callbackId, - int isReceiptSet, - string jsonCallbackParameters, - string jsonPartnerParameters); - - [DllImport("__Internal")] - private static extern void _AdjustSetEnabled(int enabled); - - [DllImport("__Internal")] - private static extern int _AdjustIsEnabled(); - - [DllImport("__Internal")] - private static extern void _AdjustSetOfflineMode(int enabled); - - [DllImport("__Internal")] - private static extern void _AdjustSetDeviceToken(string deviceToken); - - [DllImport("__Internal")] - private static extern void _AdjustAppWillOpenUrl(string url); - - [DllImport("__Internal")] - private static extern string _AdjustGetIdfa(); - - [DllImport("__Internal")] - private static extern string _AdjustGetIdfv(); - - [DllImport("__Internal")] - private static extern string _AdjustGetAdid(); - - [DllImport("__Internal")] - private static extern string _AdjustGetSdkVersion(); - - [DllImport("__Internal")] - private static extern void _AdjustGdprForgetMe(); - - [DllImport("__Internal")] - private static extern void _AdjustDisableThirdPartySharing(); - - [DllImport("__Internal")] - private static extern string _AdjustGetAttribution(); - - [DllImport("__Internal")] - private static extern void _AdjustSendFirstPackages(); - - [DllImport("__Internal")] - private static extern void _AdjustAddSessionPartnerParameter(string key, string value); - - [DllImport("__Internal")] - private static extern void _AdjustAddSessionCallbackParameter(string key, string value); - - [DllImport("__Internal")] - private static extern void _AdjustRemoveSessionPartnerParameter(string key); - - [DllImport("__Internal")] - private static extern void _AdjustRemoveSessionCallbackParameter(string key); - - [DllImport("__Internal")] - private static extern void _AdjustResetSessionPartnerParameters(); - - [DllImport("__Internal")] - private static extern void _AdjustResetSessionCallbackParameters(); - - [DllImport("__Internal")] - private static extern void _AdjustTrackAdRevenue(string source, string payload); - - [DllImport("__Internal")] - private static extern void _AdjustTrackAdRevenueNew( - string source, - double revenue, - string currency, - int adImpressionsCount, - string adRevenueNetwork, - string adRevenueUnit, - string adRevenuePlacement, - string jsonCallbackParameters, - string jsonPartnerParameters); - - [DllImport("__Internal")] - private static extern void _AdjustTrackAppStoreSubscription( - string price, - string currency, - string transactionId, - string receipt, - string billingStore, - string transactionDate, - string salesRegion, - string jsonCallbackParameters, - string jsonPartnerParameters); - - [DllImport("__Internal")] - private static extern void _AdjustTrackThirdPartySharing(int enabled, string jsonGranularOptions, string jsonPartnerSharingSettings); - - [DllImport("__Internal")] - private static extern void _AdjustTrackMeasurementConsent(int enabled); - - [DllImport("__Internal")] - private static extern void _AdjustSetTestOptions( - string overwriteUrl, - string extraPath, - long timerIntervalInMilliseconds, - long timerStartInMilliseconds, - long sessionIntervalInMilliseconds, - long subsessionIntervalInMilliseconds, - int teardown, - int deleteState, - int noBackoffWait, - int adServicesFrameworkEnabled, - int attStatus, - string idfa); - - [DllImport("__Internal")] - private static extern void _AdjustRequestTrackingAuthorizationWithCompletionHandler(string sceneName); - - [DllImport("__Internal")] - private static extern void _AdjustUpdateConversionValue(int conversionValue); - - [DllImport("__Internal")] - private static extern void _AdjustUpdateConversionValueWithCallback(int conversionValue, string sceneName); - - [DllImport("__Internal")] - private static extern void _AdjustUpdateConversionValueWithCallbackSkad4(int conversionValue, string coarseValue, int lockedWindow, string sceneName); - - [DllImport("__Internal")] - private static extern void _AdjustCheckForNewAttStatus(); - - [DllImport("__Internal")] - private static extern int _AdjustGetAppTrackingAuthorizationStatus(); - - [DllImport("__Internal")] - private static extern void _AdjustTrackSubsessionStart(); - - [DllImport("__Internal")] - private static extern void _AdjustTrackSubsessionEnd(); - - [DllImport("__Internal")] - private static extern string _AdjustGetLastDeeplink(); - - [DllImport("__Internal")] - private static extern void _AdjustVerifyAppStorePurchase( - string transactionId, - string productId, - string receipt, - string sceneName); - - [DllImport("__Internal")] - private static extern void _AdjustProcessDeeplink(string url, string sceneName); - - public AdjustiOS() {} - - public static void Start(AdjustConfig adjustConfig) - { - 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 externalDeviceId = adjustConfig.externalDeviceId != null ? adjustConfig.externalDeviceId : "ADJ_INVALID"; - string urlStrategy = adjustConfig.urlStrategy != null ? adjustConfig.urlStrategy : "ADJ_INVALID"; - string environment = adjustConfig.environment.ToLowercaseString(); - long info1 = AdjustUtils.ConvertLong(adjustConfig.info1); - long info2 = AdjustUtils.ConvertLong(adjustConfig.info2); - long info3 = AdjustUtils.ConvertLong(adjustConfig.info3); - long info4 = AdjustUtils.ConvertLong(adjustConfig.info4); - long secretId = AdjustUtils.ConvertLong(adjustConfig.secretId); - double delayStart = AdjustUtils.ConvertDouble(adjustConfig.delayStart); - int attConsentWaitingInterval = AdjustUtils.ConvertInt(adjustConfig.attConsentWaitingInterval); - int logLevel = AdjustUtils.ConvertLogLevel(adjustConfig.logLevel); - int isDeviceKnown = AdjustUtils.ConvertBool(adjustConfig.isDeviceKnown); - int sendInBackground = AdjustUtils.ConvertBool(adjustConfig.sendInBackground); - int eventBufferingEnabled = AdjustUtils.ConvertBool(adjustConfig.eventBufferingEnabled); - int allowAdServicesInfoReading = AdjustUtils.ConvertBool(adjustConfig.allowAdServicesInfoReading); - int allowIdfaReading = AdjustUtils.ConvertBool(adjustConfig.allowIdfaReading); - int allowSuppressLogLevel = AdjustUtils.ConvertBool(adjustConfig.allowSuppressLogLevel); - int launchDeferredDeeplink = AdjustUtils.ConvertBool(adjustConfig.launchDeferredDeeplink); - int deactivateSkAdNetworkHandling = AdjustUtils.ConvertBool(adjustConfig.skAdNetworkHandling); - int linkMeEnabled = AdjustUtils.ConvertBool(adjustConfig.linkMeEnabled); - int needsCost = AdjustUtils.ConvertBool(adjustConfig.needsCost); - int coppaCompliant = AdjustUtils.ConvertBool(adjustConfig.coppaCompliantEnabled); - int readDeviceInfoOnce = AdjustUtils.ConvertBool(adjustConfig.readDeviceInfoOnceEnabled); - int isAttributionCallbackImplemented = AdjustUtils.ConvertBool(adjustConfig.getAttributionChangedDelegate() != null); - int isEventSuccessCallbackImplemented = AdjustUtils.ConvertBool(adjustConfig.getEventSuccessDelegate() != null); - int isEventFailureCallbackImplemented = AdjustUtils.ConvertBool(adjustConfig.getEventFailureDelegate() != null); - int isSessionSuccessCallbackImplemented = AdjustUtils.ConvertBool(adjustConfig.getSessionSuccessDelegate() != null); - int isSessionFailureCallbackImplemented = AdjustUtils.ConvertBool(adjustConfig.getSessionFailureDelegate() != null); - int isDeferredDeeplinkCallbackImplemented = AdjustUtils.ConvertBool(adjustConfig.getDeferredDeeplinkDelegate() != null); - int isConversionValueUpdatedCallbackImplemented = AdjustUtils.ConvertBool(adjustConfig.getConversionValueUpdatedDelegate() != null); - int isSkad4ConversionValueUpdatedCallbackImplemented = AdjustUtils.ConvertBool(adjustConfig.getSkad4ConversionValueUpdatedDelegate() != null); - - _AdjustLaunchApp( - appToken, - environment, - sdkPrefix, - userAgent, - defaultTracker, - externalDeviceId, - urlStrategy, - sceneName, - allowSuppressLogLevel, - logLevel, - isDeviceKnown, - eventBufferingEnabled, - sendInBackground, - allowAdServicesInfoReading, - allowIdfaReading, - deactivateSkAdNetworkHandling, - linkMeEnabled, - needsCost, - coppaCompliant, - readDeviceInfoOnce, - secretId, - info1, - info2, - info3, - info4, - delayStart, - attConsentWaitingInterval, - launchDeferredDeeplink, - isAttributionCallbackImplemented, - isEventSuccessCallbackImplemented, - isEventFailureCallbackImplemented, - isSessionSuccessCallbackImplemented, - isSessionFailureCallbackImplemented, - isDeferredDeeplinkCallbackImplemented, - isConversionValueUpdatedCallbackImplemented, - isSkad4ConversionValueUpdatedCallbackImplemented); - } - - public static void TrackEvent(AdjustEvent adjustEvent) - { - int isReceiptSet = AdjustUtils.ConvertBool(adjustEvent.isReceiptSet); - double revenue = AdjustUtils.ConvertDouble(adjustEvent.revenue); - string eventToken = adjustEvent.eventToken; - string currency = adjustEvent.currency; - string receipt = adjustEvent.receipt; - string receiptBase64 = adjustEvent.receiptBase64; - string productId = adjustEvent.productId; - string transactionId = adjustEvent.transactionId; - string callbackId = adjustEvent.callbackId; - string stringJsonCallbackParameters = AdjustUtils.ConvertListToJson(adjustEvent.callbackList); - string stringJsonPartnerParameters = AdjustUtils.ConvertListToJson(adjustEvent.partnerList); - - _AdjustTrackEvent( - eventToken, - revenue, - currency, - receipt, - receiptBase64, - productId, - transactionId, - callbackId, - isReceiptSet, - stringJsonCallbackParameters, - stringJsonPartnerParameters); - } - - public static void SetEnabled(bool enabled) - { - _AdjustSetEnabled(AdjustUtils.ConvertBool(enabled)); - } - - public static bool IsEnabled() - { - var iIsEnabled = _AdjustIsEnabled(); - return Convert.ToBoolean(iIsEnabled); - } - - public static void SetOfflineMode(bool enabled) - { - _AdjustSetOfflineMode(AdjustUtils.ConvertBool(enabled)); - } - - public static void SendFirstPackages() - { - _AdjustSendFirstPackages(); - } - - public static void AppWillOpenUrl(string url) - { - _AdjustAppWillOpenUrl(url); - } - - public static void AddSessionPartnerParameter(string key, string value) - { - _AdjustAddSessionPartnerParameter(key, value); - } - - public static void AddSessionCallbackParameter(string key, string value) - { - _AdjustAddSessionCallbackParameter(key, value); - } - - public static void RemoveSessionPartnerParameter(string key) - { - _AdjustRemoveSessionPartnerParameter(key); - } - - public static void RemoveSessionCallbackParameter(string key) - { - _AdjustRemoveSessionCallbackParameter(key); - } - - public static void ResetSessionPartnerParameters() - { - _AdjustResetSessionPartnerParameters(); - } - - public static void ResetSessionCallbackParameters() - { - _AdjustResetSessionCallbackParameters(); - } - - public static void TrackAdRevenue(string source, string payload) - { - _AdjustTrackAdRevenue(source, payload); - } - - public static void TrackAdRevenue(AdjustAdRevenue adRevenue) - { - string source = adRevenue.source; - double revenue = AdjustUtils.ConvertDouble(adRevenue.revenue); - string currency = adRevenue.currency; - int adImpressionsCount = AdjustUtils.ConvertInt(adRevenue.adImpressionsCount); - string adRevenueNetwork = adRevenue.adRevenueNetwork; - string adRevenueUnit = adRevenue.adRevenueUnit; - string adRevenuePlacement = adRevenue.adRevenuePlacement; - string stringJsonCallbackParameters = AdjustUtils.ConvertListToJson(adRevenue.callbackList); - string stringJsonPartnerParameters = AdjustUtils.ConvertListToJson(adRevenue.partnerList); - - _AdjustTrackAdRevenueNew( - source, - revenue, - currency, - adImpressionsCount, - adRevenueNetwork, - adRevenueUnit, - adRevenuePlacement, - stringJsonCallbackParameters, - stringJsonPartnerParameters); - } - - public static void TrackAppStoreSubscription(AdjustAppStoreSubscription subscription) - { - string price = subscription.price; - string currency = subscription.currency; - string transactionId = subscription.transactionId; - string receipt = subscription.receipt; - string billingStore = subscription.billingStore; - string transactionDate = subscription.transactionDate; - string salesRegion = subscription.salesRegion; - string stringJsonCallbackParameters = AdjustUtils.ConvertListToJson(subscription.callbackList); - string stringJsonPartnerParameters = AdjustUtils.ConvertListToJson(subscription.partnerList); - - _AdjustTrackAppStoreSubscription( - price, - currency, - transactionId, - receipt, - billingStore, - transactionDate, - salesRegion, - stringJsonCallbackParameters, - stringJsonPartnerParameters); - } - - public static void TrackThirdPartySharing(AdjustThirdPartySharing thirdPartySharing) - { - int enabled = AdjustUtils.ConvertBool(thirdPartySharing.isEnabled); - List jsonGranularOptions = new List(); - foreach (KeyValuePair> entry in thirdPartySharing.granularOptions) - { - jsonGranularOptions.Add(entry.Key); - jsonGranularOptions.Add(AdjustUtils.ConvertListToJson(entry.Value)); - } - List jsonPartnerSharingSettings = new List(); - foreach (KeyValuePair> entry in thirdPartySharing.partnerSharingSettings) - { - jsonPartnerSharingSettings.Add(entry.Key); - jsonPartnerSharingSettings.Add(AdjustUtils.ConvertListToJson(entry.Value)); - } - - _AdjustTrackThirdPartySharing(enabled, AdjustUtils.ConvertListToJson(jsonGranularOptions), AdjustUtils.ConvertListToJson(jsonPartnerSharingSettings)); - } - - public static void TrackMeasurementConsent(bool enabled) - { - _AdjustTrackMeasurementConsent(AdjustUtils.ConvertBool(enabled)); - } - - public static void RequestTrackingAuthorizationWithCompletionHandler(string sceneName) - { - string cSceneName = sceneName != null ? sceneName : "ADJ_INVALID"; - _AdjustRequestTrackingAuthorizationWithCompletionHandler(cSceneName); - } - - public static void UpdateConversionValue(int conversionValue) - { - _AdjustUpdateConversionValue(conversionValue); - } - - public static void UpdateConversionValue(int conversionValue, string sceneName) - { - string cSceneName = sceneName != null ? sceneName : "ADJ_INVALID"; - _AdjustUpdateConversionValueWithCallback(conversionValue, cSceneName); - } - - public static void UpdateConversionValue(int conversionValue, string coarseValue, bool lockedWindow, string sceneName) - { - string cSceneName = sceneName != null ? sceneName : "ADJ_INVALID"; - _AdjustUpdateConversionValueWithCallbackSkad4(conversionValue, coarseValue, AdjustUtils.ConvertBool(lockedWindow), cSceneName); - } - - public static void CheckForNewAttStatus() - { - _AdjustCheckForNewAttStatus(); - } - - public static int GetAppTrackingAuthorizationStatus() - { - return _AdjustGetAppTrackingAuthorizationStatus(); - } - - public static void SetDeviceToken(string deviceToken) - { - _AdjustSetDeviceToken(deviceToken); - } - - public static string GetIdfa() - { - return _AdjustGetIdfa(); - } - - public static string GetIdfv() - { - return _AdjustGetIdfv(); - } - - public static string GetAdid() - { - return _AdjustGetAdid(); - } - - public static string GetSdkVersion() - { - return sdkPrefix + "@" + _AdjustGetSdkVersion(); - } - - public static void GdprForgetMe() - { - _AdjustGdprForgetMe(); - } - - public static void DisableThirdPartySharing() - { - _AdjustDisableThirdPartySharing(); - } - - public static AdjustAttribution GetAttribution() - { - string attributionString = _AdjustGetAttribution(); - if (null == attributionString) - { - return null; - } - - var attribution = new AdjustAttribution(attributionString); - return attribution; - } - - public static string GetLastDeeplink() - { - return _AdjustGetLastDeeplink(); - } - - public static void VerifyAppStorePurchase(AdjustAppStorePurchase purchase, string sceneName) - { - string transactionId = purchase.transactionId; - string productId = purchase.productId; - string receipt = purchase.receipt; - string cSceneName = sceneName != null ? sceneName : "ADJ_INVALID"; - - _AdjustVerifyAppStorePurchase( - transactionId, - productId, - receipt, - cSceneName); - } - - public static void ProcessDeeplink(string url, string sceneName) - { - _AdjustProcessDeeplink(url, sceneName); - } - - // Used for testing only. - public static void SetTestOptions(Dictionary testOptions) - { - string overwriteUrl = testOptions[AdjustUtils.KeyTestOptionsOverwriteUrl]; - string extraPath = testOptions.ContainsKey(AdjustUtils.KeyTestOptionsExtraPath) ? testOptions[AdjustUtils.KeyTestOptionsExtraPath] : null; - string idfa = testOptions.ContainsKey(AdjustUtils.KeyTestOptionsIdfa) ? testOptions[AdjustUtils.KeyTestOptionsIdfa] : null; - long timerIntervalMilis = -1; - long timerStartMilis = -1; - long sessionIntMilis = -1; - long subsessionIntMilis = -1; - bool teardown = false; - bool deleteState = false; - bool noBackoffWait = false; - bool adServicesFrameworkEnabled = false; - int attStatus = -1; - - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsTimerIntervalInMilliseconds)) - { - timerIntervalMilis = long.Parse(testOptions[AdjustUtils.KeyTestOptionsTimerIntervalInMilliseconds]); - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsTimerStartInMilliseconds)) - { - timerStartMilis = long.Parse(testOptions[AdjustUtils.KeyTestOptionsTimerStartInMilliseconds]); - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsSessionIntervalInMilliseconds)) - { - sessionIntMilis = long.Parse(testOptions[AdjustUtils.KeyTestOptionsSessionIntervalInMilliseconds]); - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsSubsessionIntervalInMilliseconds)) - { - subsessionIntMilis = long.Parse(testOptions[AdjustUtils.KeyTestOptionsSubsessionIntervalInMilliseconds]); - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsTeardown)) - { - teardown = testOptions[AdjustUtils.KeyTestOptionsTeardown].ToLower() == "true"; - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsDeleteState)) - { - deleteState = testOptions[AdjustUtils.KeyTestOptionsDeleteState].ToLower() == "true"; - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsNoBackoffWait)) - { - noBackoffWait = testOptions[AdjustUtils.KeyTestOptionsNoBackoffWait].ToLower() == "true"; - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsAdServicesFrameworkEnabled)) - { - adServicesFrameworkEnabled = testOptions[AdjustUtils.KeyTestOptionsAdServicesFrameworkEnabled].ToLower() == "true"; - } - if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsAttStatus)) - { - attStatus = int.Parse(testOptions[AdjustUtils.KeyTestOptionsAttStatus]); - } - - _AdjustSetTestOptions( - overwriteUrl, - extraPath, - timerIntervalMilis, - timerStartMilis, - sessionIntMilis, - subsessionIntMilis, - AdjustUtils.ConvertBool(teardown), - AdjustUtils.ConvertBool(deleteState), - AdjustUtils.ConvertBool(noBackoffWait), - AdjustUtils.ConvertBool(adServicesFrameworkEnabled), - attStatus, - idfa); - } - - public static void TrackSubsessionStart(string testingArgument = null) - { - if (testingArgument == "test") - { - _AdjustTrackSubsessionStart(); - } - } - - public static void TrackSubsessionEnd(string testingArgument = null) - { - if (testingArgument == "test") - { - _AdjustTrackSubsessionEnd(); - } - } - } -#endif -} diff --git a/Assets/Adjust/iOS/AdjustiOS.cs.meta b/Assets/Adjust/iOS/AdjustiOS.cs.meta deleted file mode 100644 index ab29d210..00000000 --- a/Assets/Adjust/iOS/AdjustiOS.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e0210f5940cff42e699945b0c5aa4c9b -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Adjust/iOS/Test/ATLBlockingQueue.h.meta b/Assets/Adjust/iOS/Test/ATLBlockingQueue.h.meta deleted file mode 100644 index a1a00d54..00000000 --- a/Assets/Adjust/iOS/Test/ATLBlockingQueue.h.meta +++ /dev/null @@ -1,94 +0,0 @@ -fileFormatVersion: 2 -guid: ef3b9f1dbdef14c37bbf3d557730e0fd -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - iPhone: iOS - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLConstants.h.meta b/Assets/Adjust/iOS/Test/ATLConstants.h.meta deleted file mode 100644 index 5a1ef461..00000000 --- a/Assets/Adjust/iOS/Test/ATLConstants.h.meta +++ /dev/null @@ -1,94 +0,0 @@ -fileFormatVersion: 2 -guid: 59e32915eced5480d8643df406797f10 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - iPhone: iOS - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLControlSignal.h.meta b/Assets/Adjust/iOS/Test/ATLControlSignal.h.meta deleted file mode 100644 index 7c3c8fbb..00000000 --- a/Assets/Adjust/iOS/Test/ATLControlSignal.h.meta +++ /dev/null @@ -1,94 +0,0 @@ -fileFormatVersion: 2 -guid: 7c532d2580f954f34b770a248c498264 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - iPhone: iOS - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLControlWebSocketClient.h.meta b/Assets/Adjust/iOS/Test/ATLControlWebSocketClient.h.meta deleted file mode 100644 index d35f61f9..00000000 --- a/Assets/Adjust/iOS/Test/ATLControlWebSocketClient.h.meta +++ /dev/null @@ -1,94 +0,0 @@ -fileFormatVersion: 2 -guid: 15bd0bbe0544343b88cdfb5b2c146966 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - iPhone: iOS - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLTestInfo.h.meta b/Assets/Adjust/iOS/Test/ATLTestInfo.h.meta deleted file mode 100644 index 5a9f909a..00000000 --- a/Assets/Adjust/iOS/Test/ATLTestInfo.h.meta +++ /dev/null @@ -1,94 +0,0 @@ -fileFormatVersion: 2 -guid: 95bf139b1f4874c7c9202282fa36cc63 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - iPhone: iOS - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLTestLibrary.h.meta b/Assets/Adjust/iOS/Test/ATLTestLibrary.h.meta deleted file mode 100644 index 18192e77..00000000 --- a/Assets/Adjust/iOS/Test/ATLTestLibrary.h.meta +++ /dev/null @@ -1,94 +0,0 @@ -fileFormatVersion: 2 -guid: 93b60ed433f0141819847fc7c6a85fe8 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - iPhone: iOS - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLUtil.h.meta b/Assets/Adjust/iOS/Test/ATLUtil.h.meta deleted file mode 100644 index 78bc22cf..00000000 --- a/Assets/Adjust/iOS/Test/ATLUtil.h.meta +++ /dev/null @@ -1,94 +0,0 @@ -fileFormatVersion: 2 -guid: 9e8bba3a0776145bfb795894c0777f74 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - iPhone: iOS - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLUtilNetworking.h.meta b/Assets/Adjust/iOS/Test/ATLUtilNetworking.h.meta deleted file mode 100644 index 2fc0c7f1..00000000 --- a/Assets/Adjust/iOS/Test/ATLUtilNetworking.h.meta +++ /dev/null @@ -1,94 +0,0 @@ -fileFormatVersion: 2 -guid: 2592997034d4b4aec99a85c3e0822d85 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - iPhone: iOS - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/AdjustTestLibrary.a.meta b/Assets/Adjust/iOS/Test/AdjustTestLibrary.a.meta deleted file mode 100644 index 0aff8155..00000000 --- a/Assets/Adjust/iOS/Test/AdjustTestLibrary.a.meta +++ /dev/null @@ -1,94 +0,0 @@ -fileFormatVersion: 2 -guid: d9a3e7223bfcc4ee781ede411dde8b51 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - iPhone: iOS - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/AdjustUnityCommandExecutor.h.meta b/Assets/Adjust/iOS/Test/AdjustUnityCommandExecutor.h.meta deleted file mode 100644 index ac027619..00000000 --- a/Assets/Adjust/iOS/Test/AdjustUnityCommandExecutor.h.meta +++ /dev/null @@ -1,94 +0,0 @@ -fileFormatVersion: 2 -guid: 5a2ec8ae1aeb0452a87c1e729bf70e6d -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - iPhone: iOS - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/AdjustUnityCommandExecutor.mm.meta b/Assets/Adjust/iOS/Test/AdjustUnityCommandExecutor.mm.meta deleted file mode 100644 index 1143072d..00000000 --- a/Assets/Adjust/iOS/Test/AdjustUnityCommandExecutor.mm.meta +++ /dev/null @@ -1,39 +0,0 @@ -fileFormatVersion: 2 -guid: 577bfef9030934ae19a27010287b239a -timeCreated: 1565086820 -licenseType: Pro -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - iPhone: iOS - second: - enabled: 1 - settings: {} - data: - first: - tvOS: tvOS - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/AdjustUnityTestLibrary.h.meta b/Assets/Adjust/iOS/Test/AdjustUnityTestLibrary.h.meta deleted file mode 100644 index b87c4734..00000000 --- a/Assets/Adjust/iOS/Test/AdjustUnityTestLibrary.h.meta +++ /dev/null @@ -1,94 +0,0 @@ -fileFormatVersion: 2 -guid: 196e61b400d604c828320d551e09177c -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - Exclude iOS: 0 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - - first: - iPhone: iOS - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/AdjustUnityTestLibrary.mm.meta b/Assets/Adjust/iOS/Test/AdjustUnityTestLibrary.mm.meta deleted file mode 100644 index eeeca588..00000000 --- a/Assets/Adjust/iOS/Test/AdjustUnityTestLibrary.mm.meta +++ /dev/null @@ -1,39 +0,0 @@ -fileFormatVersion: 2 -guid: 63e21571196d34f15a2e5e541e1e6aa0 -timeCreated: 1565086820 -licenseType: Pro -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - Any: - second: - enabled: 0 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - data: - first: - iPhone: iOS - second: - enabled: 1 - settings: {} - data: - first: - tvOS: tvOS - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Adjust/package.json b/Assets/Adjust/package.json new file mode 100644 index 00000000..bf2df094 --- /dev/null +++ b/Assets/Adjust/package.json @@ -0,0 +1,12 @@ +{ + "name": "com.adjust.sdk", + "version": "5.0.0", + "unity": "2019.4", + "displayName": "Adjust", + "license": "MIT", + "homepage": "https://www.adjust.com", + "author": { + "name": "Adjust", + "url": "https://github.com/adjust/unity_sdk" + } +} \ No newline at end of file diff --git a/Assets/Adjust/package.json.meta b/Assets/Adjust/package.json.meta new file mode 100644 index 00000000..a5cc689c --- /dev/null +++ b/Assets/Adjust/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e70aaf9215a0244c1b2675cd72030bbe +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/Test.meta b/Assets/Test.meta similarity index 77% rename from Assets/Adjust/Test.meta rename to Assets/Test.meta index 6bbf9f9f..37b19236 100644 --- a/Assets/Adjust/Test.meta +++ b/Assets/Test.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 390a746638dbd44f2a38fbd688fa67d5 +guid: dab8050b32fe94d7abd07dbf58020037 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Adjust/Test/3rdParty.meta b/Assets/Test/3rdParty.meta similarity index 100% rename from Assets/Adjust/Test/3rdParty.meta rename to Assets/Test/3rdParty.meta diff --git a/Assets/Adjust/Test/3rdParty/JsonNet-Lite.meta b/Assets/Test/3rdParty/JsonNet-Lite.meta similarity index 100% rename from Assets/Adjust/Test/3rdParty/JsonNet-Lite.meta rename to Assets/Test/3rdParty/JsonNet-Lite.meta diff --git a/Assets/Adjust/Test/3rdParty/JsonNet-Lite.unitypackage.json b/Assets/Test/3rdParty/JsonNet-Lite.unitypackage.json similarity index 100% rename from Assets/Adjust/Test/3rdParty/JsonNet-Lite.unitypackage.json rename to Assets/Test/3rdParty/JsonNet-Lite.unitypackage.json diff --git a/Assets/Adjust/Test/3rdParty/JsonNet-Lite.unitypackage.json.meta b/Assets/Test/3rdParty/JsonNet-Lite.unitypackage.json.meta similarity index 100% rename from Assets/Adjust/Test/3rdParty/JsonNet-Lite.unitypackage.json.meta rename to Assets/Test/3rdParty/JsonNet-Lite.unitypackage.json.meta diff --git a/Assets/Adjust/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll b/Assets/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll similarity index 100% rename from Assets/Adjust/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll rename to Assets/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll diff --git a/Assets/Adjust/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll.mdb b/Assets/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll.mdb similarity index 100% rename from Assets/Adjust/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll.mdb rename to Assets/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll.mdb diff --git a/Assets/Adjust/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll.mdb.meta b/Assets/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll.mdb.meta similarity index 100% rename from Assets/Adjust/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll.mdb.meta rename to Assets/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll.mdb.meta diff --git a/Assets/Adjust/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll.meta b/Assets/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll.meta similarity index 100% rename from Assets/Adjust/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll.meta rename to Assets/Test/3rdParty/JsonNet-Lite/Newtonsoft.Json.dll.meta diff --git a/Assets/Adjust/Test/3rdParty/JsonNet-Lite/link.xml b/Assets/Test/3rdParty/JsonNet-Lite/link.xml similarity index 100% rename from Assets/Adjust/Test/3rdParty/JsonNet-Lite/link.xml rename to Assets/Test/3rdParty/JsonNet-Lite/link.xml diff --git a/Assets/Adjust/Test/3rdParty/JsonNet-Lite/link.xml.meta b/Assets/Test/3rdParty/JsonNet-Lite/link.xml.meta similarity index 100% rename from Assets/Adjust/Test/3rdParty/JsonNet-Lite/link.xml.meta rename to Assets/Test/3rdParty/JsonNet-Lite/link.xml.meta diff --git a/Assets/Test/Native.meta b/Assets/Test/Native.meta new file mode 100644 index 00000000..47eb30c7 --- /dev/null +++ b/Assets/Test/Native.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8adf6ac3dd4f147a98becbe57f671a60 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Test/Native/Android.meta b/Assets/Test/Native/Android.meta new file mode 100644 index 00000000..1664b400 --- /dev/null +++ b/Assets/Test/Native/Android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 577d5cb59433f4c0aa15aa9f40a19596 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/Android/Test/Java-WebSocket-1.4.0.jar b/Assets/Test/Native/Android/Java-WebSocket-1.4.0.jar similarity index 100% rename from Assets/Adjust/Android/Test/Java-WebSocket-1.4.0.jar rename to Assets/Test/Native/Android/Java-WebSocket-1.4.0.jar diff --git a/Assets/Adjust/Android/Test/Java-WebSocket-1.4.0.jar.meta b/Assets/Test/Native/Android/Java-WebSocket-1.4.0.jar.meta similarity index 92% rename from Assets/Adjust/Android/Test/Java-WebSocket-1.4.0.jar.meta rename to Assets/Test/Native/Android/Java-WebSocket-1.4.0.jar.meta index 7abfc5c1..37a51655 100644 --- a/Assets/Adjust/Android/Test/Java-WebSocket-1.4.0.jar.meta +++ b/Assets/Test/Native/Android/Java-WebSocket-1.4.0.jar.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e16880198afee4a3eabecd09eef41ed2 +guid: 50d69a5765a53473f99e6a7c0686f9bf PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Adjust/Android/Test/adjust-test-library.aar b/Assets/Test/Native/Android/adjust-test-library.aar similarity index 100% rename from Assets/Adjust/Android/Test/adjust-test-library.aar rename to Assets/Test/Native/Android/adjust-test-library.aar diff --git a/Assets/Adjust/Android/Test/adjust-test-library.aar.meta b/Assets/Test/Native/Android/adjust-test-library.aar.meta similarity index 92% rename from Assets/Adjust/Android/Test/adjust-test-library.aar.meta rename to Assets/Test/Native/Android/adjust-test-library.aar.meta index fd490cf4..45095fdc 100644 --- a/Assets/Adjust/Android/Test/adjust-test-library.aar.meta +++ b/Assets/Test/Native/Android/adjust-test-library.aar.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a27481e095d1841aebeff9ee5c766dec +guid: 5969d91cbd58f4497accd549cd46ae47 PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Adjust/Android/Test/adjust-test-options.aar b/Assets/Test/Native/Android/adjust-test-options.aar similarity index 100% rename from Assets/Adjust/Android/Test/adjust-test-options.aar rename to Assets/Test/Native/Android/adjust-test-options.aar diff --git a/Assets/Adjust/Android/Test/adjust-test-options.aar.meta b/Assets/Test/Native/Android/adjust-test-options.aar.meta similarity index 92% rename from Assets/Adjust/Android/Test/adjust-test-options.aar.meta rename to Assets/Test/Native/Android/adjust-test-options.aar.meta index 27476c97..01068e02 100644 --- a/Assets/Adjust/Android/Test/adjust-test-options.aar.meta +++ b/Assets/Test/Native/Android/adjust-test-options.aar.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: caefa483331854de9a131fa2cfc61ef2 +guid: 1fd8576d51edf490db65b3e9dff71b8f PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Adjust/Android/Test/gson-2.8.6.jar b/Assets/Test/Native/Android/gson-2.8.6.jar similarity index 100% rename from Assets/Adjust/Android/Test/gson-2.8.6.jar rename to Assets/Test/Native/Android/gson-2.8.6.jar diff --git a/Assets/Adjust/Android/Test/gson-2.8.6.jar.meta b/Assets/Test/Native/Android/gson-2.8.6.jar.meta similarity index 92% rename from Assets/Adjust/Android/Test/gson-2.8.6.jar.meta rename to Assets/Test/Native/Android/gson-2.8.6.jar.meta index a58c9fba..d7a4afdd 100644 --- a/Assets/Adjust/Android/Test/gson-2.8.6.jar.meta +++ b/Assets/Test/Native/Android/gson-2.8.6.jar.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b9fc97b4047d64da8bfdd4dba2c1f356 +guid: bd1bce312d35542aeb227e307435cbd5 PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Adjust/Android/Test/slf4j-api-1.7.30.jar b/Assets/Test/Native/Android/slf4j-api-1.7.30.jar similarity index 100% rename from Assets/Adjust/Android/Test/slf4j-api-1.7.30.jar rename to Assets/Test/Native/Android/slf4j-api-1.7.30.jar diff --git a/Assets/Adjust/Android/Test/slf4j-api-1.7.30.jar.meta b/Assets/Test/Native/Android/slf4j-api-1.7.30.jar.meta similarity index 92% rename from Assets/Adjust/Android/Test/slf4j-api-1.7.30.jar.meta rename to Assets/Test/Native/Android/slf4j-api-1.7.30.jar.meta index 2f827829..2ebf62eb 100644 --- a/Assets/Adjust/Android/Test/slf4j-api-1.7.30.jar.meta +++ b/Assets/Test/Native/Android/slf4j-api-1.7.30.jar.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 96649bd10ee17492b87adc742ea8740d +guid: 0f8adf3f009df40449e838f29bc40135 PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Test/Native/iOS.meta b/Assets/Test/Native/iOS.meta new file mode 100644 index 00000000..32ff7995 --- /dev/null +++ b/Assets/Test/Native/iOS.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 057f448e5c108492a8ff61fa7f36366f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLBlockingQueue.h b/Assets/Test/Native/iOS/ATLBlockingQueue.h similarity index 100% rename from Assets/Adjust/iOS/Test/ATLBlockingQueue.h rename to Assets/Test/Native/iOS/ATLBlockingQueue.h diff --git a/Assets/Adjust/iOS/AdjustUnityAppDelegate.m.meta b/Assets/Test/Native/iOS/ATLBlockingQueue.h.meta similarity index 57% rename from Assets/Adjust/iOS/AdjustUnityAppDelegate.m.meta rename to Assets/Test/Native/iOS/ATLBlockingQueue.h.meta index d1b99f26..a17dda33 100644 --- a/Assets/Adjust/iOS/AdjustUnityAppDelegate.m.meta +++ b/Assets/Test/Native/iOS/ATLBlockingQueue.h.meta @@ -1,16 +1,29 @@ fileFormatVersion: 2 -guid: ea1bc374f78b747f8a81fcc82cd77d96 +guid: 862996479db914295a7e69bbb6e71cbf PluginImporter: externalObjects: {} serializedVersion: 2 iconMap: {} executionOrder: {} - defineConstraints: [] isPreloaded: 0 isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 - first: Any: second: @@ -27,11 +40,6 @@ PluginImporter: second: enabled: 1 settings: {} - - first: - tvOS: tvOS - second: - enabled: 1 - settings: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLConstants.h b/Assets/Test/Native/iOS/ATLConstants.h similarity index 100% rename from Assets/Adjust/iOS/Test/ATLConstants.h rename to Assets/Test/Native/iOS/ATLConstants.h diff --git a/Assets/Test/Native/iOS/ATLConstants.h.meta b/Assets/Test/Native/iOS/ATLConstants.h.meta new file mode 100644 index 00000000..0bca4519 --- /dev/null +++ b/Assets/Test/Native/iOS/ATLConstants.h.meta @@ -0,0 +1,45 @@ +fileFormatVersion: 2 +guid: 43ad23fd200ee470a999d0254cfbc0fd +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLControlChannel.h b/Assets/Test/Native/iOS/ATLControlChannel.h similarity index 100% rename from Assets/Adjust/iOS/Test/ATLControlChannel.h rename to Assets/Test/Native/iOS/ATLControlChannel.h diff --git a/Assets/Test/Native/iOS/ATLControlChannel.h.meta b/Assets/Test/Native/iOS/ATLControlChannel.h.meta new file mode 100644 index 00000000..aaa0c73e --- /dev/null +++ b/Assets/Test/Native/iOS/ATLControlChannel.h.meta @@ -0,0 +1,45 @@ +fileFormatVersion: 2 +guid: 92aeb7aba9e6543e89b1cf70d5ae01bd +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLControlSignal.h b/Assets/Test/Native/iOS/ATLControlSignal.h similarity index 100% rename from Assets/Adjust/iOS/Test/ATLControlSignal.h rename to Assets/Test/Native/iOS/ATLControlSignal.h diff --git a/Assets/Test/Native/iOS/ATLControlSignal.h.meta b/Assets/Test/Native/iOS/ATLControlSignal.h.meta new file mode 100644 index 00000000..3d06dd7f --- /dev/null +++ b/Assets/Test/Native/iOS/ATLControlSignal.h.meta @@ -0,0 +1,45 @@ +fileFormatVersion: 2 +guid: 4af5327ccec5d4590982d97a8a80585b +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLControlWebSocketClient.h b/Assets/Test/Native/iOS/ATLControlWebSocketClient.h similarity index 100% rename from Assets/Adjust/iOS/Test/ATLControlWebSocketClient.h rename to Assets/Test/Native/iOS/ATLControlWebSocketClient.h diff --git a/Assets/Test/Native/iOS/ATLControlWebSocketClient.h.meta b/Assets/Test/Native/iOS/ATLControlWebSocketClient.h.meta new file mode 100644 index 00000000..cb3edad0 --- /dev/null +++ b/Assets/Test/Native/iOS/ATLControlWebSocketClient.h.meta @@ -0,0 +1,45 @@ +fileFormatVersion: 2 +guid: 65fd847d97b764bddbe51b233a859408 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLTestInfo.h b/Assets/Test/Native/iOS/ATLTestInfo.h similarity index 100% rename from Assets/Adjust/iOS/Test/ATLTestInfo.h rename to Assets/Test/Native/iOS/ATLTestInfo.h diff --git a/Assets/Test/Native/iOS/ATLTestInfo.h.meta b/Assets/Test/Native/iOS/ATLTestInfo.h.meta new file mode 100644 index 00000000..7a685cff --- /dev/null +++ b/Assets/Test/Native/iOS/ATLTestInfo.h.meta @@ -0,0 +1,45 @@ +fileFormatVersion: 2 +guid: 0166498b869424b1b939bb166ab551e7 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLTestLibrary.h b/Assets/Test/Native/iOS/ATLTestLibrary.h similarity index 100% rename from Assets/Adjust/iOS/Test/ATLTestLibrary.h rename to Assets/Test/Native/iOS/ATLTestLibrary.h diff --git a/Assets/Test/Native/iOS/ATLTestLibrary.h.meta b/Assets/Test/Native/iOS/ATLTestLibrary.h.meta new file mode 100644 index 00000000..9dd6b909 --- /dev/null +++ b/Assets/Test/Native/iOS/ATLTestLibrary.h.meta @@ -0,0 +1,45 @@ +fileFormatVersion: 2 +guid: 3c9eaef644d3344ff80a13e9a8049e72 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLUtil.h b/Assets/Test/Native/iOS/ATLUtil.h similarity index 100% rename from Assets/Adjust/iOS/Test/ATLUtil.h rename to Assets/Test/Native/iOS/ATLUtil.h diff --git a/Assets/Test/Native/iOS/ATLUtil.h.meta b/Assets/Test/Native/iOS/ATLUtil.h.meta new file mode 100644 index 00000000..2fbe958f --- /dev/null +++ b/Assets/Test/Native/iOS/ATLUtil.h.meta @@ -0,0 +1,45 @@ +fileFormatVersion: 2 +guid: c7fe63ce0e0a44e7ca36e77e0e251ac9 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/ATLUtilNetworking.h b/Assets/Test/Native/iOS/ATLUtilNetworking.h similarity index 100% rename from Assets/Adjust/iOS/Test/ATLUtilNetworking.h rename to Assets/Test/Native/iOS/ATLUtilNetworking.h diff --git a/Assets/Test/Native/iOS/ATLUtilNetworking.h.meta b/Assets/Test/Native/iOS/ATLUtilNetworking.h.meta new file mode 100644 index 00000000..d6277cd9 --- /dev/null +++ b/Assets/Test/Native/iOS/ATLUtilNetworking.h.meta @@ -0,0 +1,45 @@ +fileFormatVersion: 2 +guid: feabc47fcec1d41d7be2f2c50ad96ade +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/AdjustTestLibrary.a b/Assets/Test/Native/iOS/AdjustTestLibrary.a similarity index 100% rename from Assets/Adjust/iOS/Test/AdjustTestLibrary.a rename to Assets/Test/Native/iOS/AdjustTestLibrary.a diff --git a/Assets/Test/Native/iOS/AdjustTestLibrary.a.meta b/Assets/Test/Native/iOS/AdjustTestLibrary.a.meta new file mode 100644 index 00000000..ef209cd8 --- /dev/null +++ b/Assets/Test/Native/iOS/AdjustTestLibrary.a.meta @@ -0,0 +1,45 @@ +fileFormatVersion: 2 +guid: f08c8ed2257994e27bd312f6171d1556 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/AdjustUnityCommandExecutor.h b/Assets/Test/Native/iOS/AdjustUnityCommandExecutor.h similarity index 100% rename from Assets/Adjust/iOS/Test/AdjustUnityCommandExecutor.h rename to Assets/Test/Native/iOS/AdjustUnityCommandExecutor.h diff --git a/Assets/Test/Native/iOS/AdjustUnityCommandExecutor.h.meta b/Assets/Test/Native/iOS/AdjustUnityCommandExecutor.h.meta new file mode 100644 index 00000000..838a21d7 --- /dev/null +++ b/Assets/Test/Native/iOS/AdjustUnityCommandExecutor.h.meta @@ -0,0 +1,45 @@ +fileFormatVersion: 2 +guid: 9508b12b5637945b6a2821be409124f4 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/AdjustUnityCommandExecutor.mm b/Assets/Test/Native/iOS/AdjustUnityCommandExecutor.mm similarity index 100% rename from Assets/Adjust/iOS/Test/AdjustUnityCommandExecutor.mm rename to Assets/Test/Native/iOS/AdjustUnityCommandExecutor.mm diff --git a/Assets/Test/Native/iOS/AdjustUnityCommandExecutor.mm.meta b/Assets/Test/Native/iOS/AdjustUnityCommandExecutor.mm.meta new file mode 100644 index 00000000..7b21e255 --- /dev/null +++ b/Assets/Test/Native/iOS/AdjustUnityCommandExecutor.mm.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: 439d86829199545f3b4aa77df3164111 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + - first: + tvOS: tvOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/AdjustUnityTestLibrary.h b/Assets/Test/Native/iOS/AdjustUnityTestLibrary.h similarity index 100% rename from Assets/Adjust/iOS/Test/AdjustUnityTestLibrary.h rename to Assets/Test/Native/iOS/AdjustUnityTestLibrary.h diff --git a/Assets/Test/Native/iOS/AdjustUnityTestLibrary.h.meta b/Assets/Test/Native/iOS/AdjustUnityTestLibrary.h.meta new file mode 100644 index 00000000..c9947237 --- /dev/null +++ b/Assets/Test/Native/iOS/AdjustUnityTestLibrary.h.meta @@ -0,0 +1,45 @@ +fileFormatVersion: 2 +guid: 64102ae28c06743b1ad3460bac604598 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/iOS/Test/AdjustUnityTestLibrary.mm b/Assets/Test/Native/iOS/AdjustUnityTestLibrary.mm similarity index 100% rename from Assets/Adjust/iOS/Test/AdjustUnityTestLibrary.mm rename to Assets/Test/Native/iOS/AdjustUnityTestLibrary.mm diff --git a/Assets/Test/Native/iOS/AdjustUnityTestLibrary.mm.meta b/Assets/Test/Native/iOS/AdjustUnityTestLibrary.mm.meta new file mode 100644 index 00000000..73b12f12 --- /dev/null +++ b/Assets/Test/Native/iOS/AdjustUnityTestLibrary.mm.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: 96fddcee2ff1647d3ae5e4234b56a72c +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + - first: + tvOS: tvOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Test/Scripts.meta b/Assets/Test/Scripts.meta new file mode 100644 index 00000000..f5965ebf --- /dev/null +++ b/Assets/Test/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 895407002691942b68eda7d05f269ae8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Adjust/Test/Command.cs b/Assets/Test/Scripts/Command.cs similarity index 98% rename from Assets/Adjust/Test/Command.cs rename to Assets/Test/Scripts/Command.cs index f07adb2d..8d6f4b48 100644 --- a/Assets/Adjust/Test/Command.cs +++ b/Assets/Test/Scripts/Command.cs @@ -3,7 +3,7 @@ using Newtonsoft.Json; #endif -namespace com.adjust.sdk.test +namespace AdjustSdk.Test { public class Command { diff --git a/Assets/Adjust/Test/Command.cs.meta b/Assets/Test/Scripts/Command.cs.meta similarity index 69% rename from Assets/Adjust/Test/Command.cs.meta rename to Assets/Test/Scripts/Command.cs.meta index 26455832..af8bc74b 100644 --- a/Assets/Adjust/Test/Command.cs.meta +++ b/Assets/Test/Scripts/Command.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 071d2d4f11239450fba443973b6a01fb -timeCreated: 1565086819 -licenseType: Pro +guid: 12d030bd37da1469d864611110b3c915 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Adjust/Test/CommandExecutor.cs b/Assets/Test/Scripts/CommandExecutor.cs similarity index 73% rename from Assets/Adjust/Test/CommandExecutor.cs rename to Assets/Test/Scripts/CommandExecutor.cs index defa8682..51ec4b66 100644 --- a/Assets/Adjust/Test/CommandExecutor.cs +++ b/Assets/Test/Scripts/CommandExecutor.cs @@ -1,17 +1,10 @@ using System; using System.Collections.Generic; using UnityEngine; -#if (UNITY_WSA || UNITY_WP8) -using TestLibraryInterface; -#endif -namespace com.adjust.sdk.test +namespace AdjustSdk.Test { -#if (UNITY_WSA || UNITY_WP8) - public class CommandExecutor : IAdjustCommandExecutor -#else public class CommandExecutor -#endif { public string ExtraPath { get; set; } @@ -50,28 +43,25 @@ public void ExecuteCommand(Command command) case "resume": Resume(); break; case "pause": Pause(); break; case "setEnabled": SetEnabled(); break; - case "setReferrer": SetReferrer(); break; case "setOfflineMode": SetOfflineMode(); break; - case "sendFirstPackages": SendFirstPackages(); break; - case "addSessionCallbackParameter": AddSessionCallbackParameter(); break; - case "addSessionPartnerParameter": AddSessionPartnerParameter(); break; - case "removeSessionCallbackParameter": RemoveSessionCallbackParameter(); break; - case "removeSessionPartnerParameter": RemoveSessionPartnerParameter(); break; - case "resetSessionCallbackParameters": ResetSessionCallbackParameters(); break; - case "resetSessionPartnerParameters": ResetSessionPartnerParameters(); break; + case "addGlobalCallbackParameter": AddGlobalCallbackParameter(); break; + case "addGlobalPartnerParameter": AddGlobalPartnerParameter(); break; + case "removeGlobalCallbackParameter": RemoveGlobalCallbackParameter(); break; + case "removeGlobalPartnerParameter": RemoveGlobalPartnerParameter(); break; + case "removeGlobalCallbackParameters": RemoveGlobalCallbackParameters(); break; + case "removeGlobalPartnerParameters": RemoveGlobalPartnerParameters(); break; case "setPushToken": SetPushToken(); break; case "openDeeplink": OpenDeepLink(); break; - case "sendReferrer": SetReferrer(); break; case "gdprForgetMe": GdprForgetMe(); break; - case "trackAdRevenue": TrackAdRevenue(); break; - case "disableThirdPartySharing": DisableThirdPartySharing(); break; case "trackSubscription": TrackSubscription(); break; case "thirdPartySharing": ThirdPartySharing(); break; case "measurementConsent": MeasurementConsent(); break; - case "trackAdRevenueV2": TrackAdRevenueV2(); break; + case "trackAdRevenue": TrackAdRevenue(); break; case "getLastDeeplink": GetLastDeeplink(); break; case "verifyPurchase": VerifyPurchase(); break; - case "processDeeplink": ProcessDeeplink(); break; + case "processDeeplink": ProcessAndResolveDeeplink(); break; + case "attributionGetter": AttributionGetter(); break; + case "verifyTrack": VerifyAndTrack(); break; default: CommandNotFound(_command.ClassName, _command.MethodName); break; } } @@ -129,6 +119,18 @@ private void TestOptions() { testOptions[AdjustUtils.KeyTestOptionsIdfa] = _command.GetFirstParameterValue("idfa"); } + if (_command.ContainsParameter("doNotIgnoreSystemLifecycleBootstrap")) + { + string strDoNotIgnoreSystemLifecycleBootstrap = _command.GetFirstParameterValue("doNotIgnoreSystemLifecycleBootstrap"); + if (strDoNotIgnoreSystemLifecycleBootstrap != null) + { + bool bDoNotIgnoreSystemLifecycleBootstrap = bool.Parse(strDoNotIgnoreSystemLifecycleBootstrap); + if (bDoNotIgnoreSystemLifecycleBootstrap == true) + { + testOptions[AdjustUtils.KeyTestOptionsIgnoreSystemLifecycleBootstrap] = "false"; + } + } + } #if UNITY_ANDROID bool useTestConnectionOptions = false; #endif @@ -260,12 +262,9 @@ private void Config() if (logLevel.HasValue) { - adjustConfig.setLogLevel(logLevel.Value); + adjustConfig.LogLevel = logLevel.Value; } -#if (UNITY_WSA || UNITY_WP8) - adjustConfig.logDelegate = msg => Debug.Log(msg); -#endif _savedConfigs.Add(configNumber, adjustConfig); } @@ -276,129 +275,77 @@ private void Config() if (_command.ContainsParameter("defaultTracker")) { - adjustConfig.setDefaultTracker(_command.GetFirstParameterValue("defaultTracker")); + adjustConfig.DefaultTracker = _command.GetFirstParameterValue("defaultTracker"); } if (_command.ContainsParameter("externalDeviceId")) { - adjustConfig.setExternalDeviceId(_command.GetFirstParameterValue("externalDeviceId")); - } - - if (_command.ContainsParameter("delayStart")) - { - var delayStartStr = _command.GetFirstParameterValue("delayStart"); - var delayStart = double.Parse(delayStartStr, System.Globalization.CultureInfo.InvariantCulture); - adjustConfig.setDelayStart(delayStart); - } - - if (_command.ContainsParameter("appSecret")) - { - var appSecretList = _command.Parameters["appSecret"]; - if (!string.IsNullOrEmpty(appSecretList[0]) && appSecretList.Count == 5) - { - long secretId, info1, info2, info3, info4; - long.TryParse(appSecretList[0], out secretId); - long.TryParse(appSecretList[1], out info1); - long.TryParse(appSecretList[2], out info2); - long.TryParse(appSecretList[3], out info3); - long.TryParse(appSecretList[4], out info4); - - adjustConfig.setAppSecret(secretId, info1, info2, info3, info4); - } + adjustConfig.ExternalDeviceId = _command.GetFirstParameterValue("externalDeviceId"); } - if (_command.ContainsParameter("deviceKnown")) - { - var deviceKnownS = _command.GetFirstParameterValue("deviceKnown"); - var deviceKnown = deviceKnownS.ToLower() == "true"; - adjustConfig.setIsDeviceKnown(deviceKnown); - } - - if (_command.ContainsParameter("eventBufferingEnabled")) + if (_command.ContainsParameter("sendInBackground")) { - var eventBufferingEnabledS = _command.GetFirstParameterValue("eventBufferingEnabled"); - var eventBufferingEnabled = eventBufferingEnabledS.ToLower() == "true"; - adjustConfig.setEventBufferingEnabled(eventBufferingEnabled); + var sendInBackgroundS = _command.GetFirstParameterValue("sendInBackground"); + var sendInBackground = sendInBackgroundS.ToLower() == "true"; + adjustConfig.IsSendingInBackgroundEnabled = sendInBackground; } if (_command.ContainsParameter("coppaCompliant")) { var coppaCompliantS = _command.GetFirstParameterValue("coppaCompliant"); var coppaCompliant = coppaCompliantS.ToLower() == "true"; - adjustConfig.setCoppaCompliantEnabled(coppaCompliant); + adjustConfig.IsCoppaComplianceEnabled = coppaCompliant; } if (_command.ContainsParameter("playStoreKids")) { var playStoreKidsS = _command.GetFirstParameterValue("playStoreKids"); var playStoreKids = playStoreKidsS.ToLower() == "true"; - adjustConfig.setPlayStoreKidsAppEnabled(playStoreKids); - } - - if (_command.ContainsParameter("finalAttributionEnabled")) - { - var finalAndroidAttributionEnabledS = _command.GetFirstParameterValue("finalAttributionEnabled"); - var finalAndroidAttributionEnabled = finalAndroidAttributionEnabledS.ToLower() == "true"; - adjustConfig.setFinalAndroidAttributionEnabled(finalAndroidAttributionEnabled); - } - - if (_command.ContainsParameter("sendInBackground")) - { - var sendInBackgroundS = _command.GetFirstParameterValue("sendInBackground"); - var sendInBackground = sendInBackgroundS.ToLower() == "true"; - adjustConfig.sendInBackground = sendInBackground; + adjustConfig.IsPlayStoreKidsComplianceEnabled = playStoreKids; } if (_command.ContainsParameter("allowAdServicesInfoReading")) { var allowAdServicesInfoReadingS = _command.GetFirstParameterValue("allowAdServicesInfoReading"); var allowAdServicesInfoReading = allowAdServicesInfoReadingS.ToLower() == "true"; - adjustConfig.allowAdServicesInfoReading = allowAdServicesInfoReading; + adjustConfig.IsAdServicesEnabled = allowAdServicesInfoReading; } if (_command.ContainsParameter("allowIdfaReading")) { var allowIdfaReadingS = _command.GetFirstParameterValue("allowIdfaReading"); var allowIdfaReading = allowIdfaReadingS.ToLower() == "true"; - adjustConfig.allowIdfaReading = allowIdfaReading; + adjustConfig.IsIdfaReadingEnabled = allowIdfaReading; } if (_command.ContainsParameter("allowSkAdNetworkHandling")) { var allowSkAdNetworkHandlingS = _command.GetFirstParameterValue("allowSkAdNetworkHandling"); var allowSkAdNetworkHandling = allowSkAdNetworkHandlingS.ToLower() == "true"; - if (allowSkAdNetworkHandling == false) - { - adjustConfig.deactivateSKAdNetworkHandling(); - } - } - - if (_command.ContainsParameter("userAgent")) - { - var userAgent = _command.GetFirstParameterValue("userAgent"); - if (userAgent.Equals("null")) - { - adjustConfig.setUserAgent(null); - } - else - { - adjustConfig.setUserAgent(userAgent); - } + adjustConfig.IsSkanAttributionEnabled = allowSkAdNetworkHandling; } if (_command.ContainsParameter("attConsentWaitingSeconds")) { var attConsentWaitingSecondsStr = _command.GetFirstParameterValue("attConsentWaitingSeconds"); var attConsentWaitingSeconds = int.Parse(attConsentWaitingSecondsStr, System.Globalization.CultureInfo.InvariantCulture); - adjustConfig.setAttConsentWaitingInterval(attConsentWaitingSeconds); + adjustConfig.AttConsentWaitingInterval = attConsentWaitingSeconds; + } + + if (_command.ContainsParameter("eventDeduplicationIdsMaxSize")) + { + var eventDeduplicationIdsMaxSizeStr = _command.GetFirstParameterValue("eventDeduplicationIdsMaxSize"); + var eventDeduplicationIdsMaxSize = int.Parse(eventDeduplicationIdsMaxSizeStr, System.Globalization.CultureInfo.InvariantCulture); + adjustConfig.EventDeduplicationIdsMaxSize = eventDeduplicationIdsMaxSize; } if (_command.ContainsParameter("deferredDeeplinkCallback")) { bool launchDeferredDeeplink = _command.GetFirstParameterValue("deferredDeeplinkCallback") == "true"; - adjustConfig.setLaunchDeferredDeeplink(launchDeferredDeeplink); + adjustConfig.IsDeferredDeeplinkOpeningEnabled = launchDeferredDeeplink; + string localExtraPath = ExtraPath; - adjustConfig.setDeferredDeeplinkDelegate(uri => + adjustConfig.DeferredDeeplinkDelegate = (uri => { _testLibrary.AddInfoToSend("deeplink", uri); _testLibrary.SendInfoToServer(localExtraPath); @@ -408,20 +355,19 @@ private void Config() if (_command.ContainsParameter("attributionCallbackSendAll")) { string localExtraPath = ExtraPath; - adjustConfig.setAttributionChangedDelegate(attribution => + adjustConfig.AttributionChangedDelegate = (attribution => { - _testLibrary.AddInfoToSend("trackerToken", attribution.trackerToken); - _testLibrary.AddInfoToSend("trackerName", attribution.trackerName); - _testLibrary.AddInfoToSend("network", attribution.network); - _testLibrary.AddInfoToSend("campaign", attribution.campaign); - _testLibrary.AddInfoToSend("adgroup", attribution.adgroup); - _testLibrary.AddInfoToSend("creative", attribution.creative); - _testLibrary.AddInfoToSend("clickLabel", attribution.clickLabel); - _testLibrary.AddInfoToSend("adid", attribution.adid); - _testLibrary.AddInfoToSend("costType", attribution.costType); - _testLibrary.AddInfoToSend("costAmount", attribution.costAmount.ToString()); - _testLibrary.AddInfoToSend("costCurrency", attribution.costCurrency); - _testLibrary.AddInfoToSend("fbInstallReferrer", attribution.fbInstallReferrer); + _testLibrary.AddInfoToSend("tracker_token", attribution.TrackerToken); + _testLibrary.AddInfoToSend("tracker_name", attribution.TrackerName); + _testLibrary.AddInfoToSend("network", attribution.Network); + _testLibrary.AddInfoToSend("campaign", attribution.Campaign); + _testLibrary.AddInfoToSend("adgroup", attribution.Adgroup); + _testLibrary.AddInfoToSend("creative", attribution.Creative); + _testLibrary.AddInfoToSend("click_label", attribution.ClickLabel); + _testLibrary.AddInfoToSend("cost_type", attribution.CostType); + _testLibrary.AddInfoToSend("cost_amount", attribution.CostAmount.ToString()); + _testLibrary.AddInfoToSend("cost_currency", attribution.CostCurrency); + _testLibrary.AddInfoToSend("fb_install_referrer", attribution.FbInstallReferrer); _testLibrary.SendInfoToServer(localExtraPath); }); } @@ -429,14 +375,14 @@ private void Config() if (_command.ContainsParameter("sessionCallbackSendSuccess")) { string localExtraPath = ExtraPath; - adjustConfig.setSessionSuccessDelegate(sessionSuccessResponseData => + adjustConfig.SessionSuccessDelegate = (sessionSuccessResponseData => { _testLibrary.AddInfoToSend("message", sessionSuccessResponseData.Message); _testLibrary.AddInfoToSend("timestamp", sessionSuccessResponseData.Timestamp); _testLibrary.AddInfoToSend("adid", sessionSuccessResponseData.Adid); if (sessionSuccessResponseData.JsonResponse != null) { - _testLibrary.AddInfoToSend("jsonResponse", sessionSuccessResponseData.GetJsonResponse()); + _testLibrary.AddInfoToSend("jsonResponse", sessionSuccessResponseData.GetJsonResponseAsString()); } _testLibrary.SendInfoToServer(localExtraPath); }); @@ -445,7 +391,7 @@ private void Config() if (_command.ContainsParameter("sessionCallbackSendFailure")) { string localExtraPath = ExtraPath; - adjustConfig.setSessionFailureDelegate(sessionFailureResponseData => + adjustConfig.SessionFailureDelegate = (sessionFailureResponseData => { _testLibrary.AddInfoToSend("message", sessionFailureResponseData.Message); _testLibrary.AddInfoToSend("timestamp", sessionFailureResponseData.Timestamp); @@ -453,7 +399,7 @@ private void Config() _testLibrary.AddInfoToSend("willRetry", sessionFailureResponseData.WillRetry.ToString().ToLower()); if (sessionFailureResponseData.JsonResponse != null) { - _testLibrary.AddInfoToSend("jsonResponse", sessionFailureResponseData.GetJsonResponse()); + _testLibrary.AddInfoToSend("jsonResponse", sessionFailureResponseData.GetJsonResponseAsString()); } _testLibrary.SendInfoToServer(localExtraPath); }); @@ -462,7 +408,7 @@ private void Config() if (_command.ContainsParameter("eventCallbackSendSuccess")) { string localExtraPath = ExtraPath; - adjustConfig.setEventSuccessDelegate(eventSuccessResponseData => + adjustConfig.EventSuccessDelegate = (eventSuccessResponseData => { _testLibrary.AddInfoToSend("message", eventSuccessResponseData.Message); _testLibrary.AddInfoToSend("timestamp", eventSuccessResponseData.Timestamp); @@ -471,7 +417,7 @@ private void Config() _testLibrary.AddInfoToSend("callbackId", eventSuccessResponseData.CallbackId); if (eventSuccessResponseData.JsonResponse != null) { - _testLibrary.AddInfoToSend("jsonResponse", eventSuccessResponseData.GetJsonResponse()); + _testLibrary.AddInfoToSend("jsonResponse", eventSuccessResponseData.GetJsonResponseAsString()); } _testLibrary.SendInfoToServer(localExtraPath); }); @@ -480,7 +426,7 @@ private void Config() if (_command.ContainsParameter("eventCallbackSendFailure")) { string localExtraPath = ExtraPath; - adjustConfig.setEventFailureDelegate(eventFailureResponseData => + adjustConfig.EventFailureDelegate = (eventFailureResponseData => { _testLibrary.AddInfoToSend("message", eventFailureResponseData.Message); _testLibrary.AddInfoToSend("timestamp", eventFailureResponseData.Timestamp); @@ -490,7 +436,20 @@ private void Config() _testLibrary.AddInfoToSend("willRetry", eventFailureResponseData.WillRetry.ToString().ToLower()); if (eventFailureResponseData.JsonResponse != null) { - _testLibrary.AddInfoToSend("jsonResponse", eventFailureResponseData.GetJsonResponse()); + _testLibrary.AddInfoToSend("jsonResponse", eventFailureResponseData.GetJsonResponseAsString()); + } + _testLibrary.SendInfoToServer(localExtraPath); + }); + } + + if (_command.ContainsParameter("skanCallback")) + { + string localExtraPath = ExtraPath; + adjustConfig.SkanUpdatedDelegate = (skanUpdatedData => + { + foreach (KeyValuePair entry in skanUpdatedData) + { + _testLibrary.AddInfoToSend(entry.Key, entry.Value); } _testLibrary.SendInfoToServer(localExtraPath); }); @@ -509,7 +468,7 @@ private void Start() } var adjustConfig = _savedConfigs[configNumber]; - Adjust.start(adjustConfig); + Adjust.InitSdk(adjustConfig); _savedConfigs.Remove(0); } @@ -539,7 +498,7 @@ private void Event() var revenueParams = _command.Parameters["revenue"]; var currency = revenueParams[0]; var revenue = double.Parse(revenueParams[1], System.Globalization.CultureInfo.InvariantCulture); - adjustEvent.setRevenue(revenue, currency); + adjustEvent.SetRevenue(revenue, currency); } if (_command.ContainsParameter("callbackParams")) @@ -549,7 +508,7 @@ private void Event() { var key = callbackParams[i]; var value = callbackParams[i + 1]; - adjustEvent.addCallbackParameter(key, value); + adjustEvent.AddCallbackParameter(key, value); } } @@ -560,44 +519,38 @@ private void Event() { var key = partnerParams[i]; var value = partnerParams[i + 1]; - adjustEvent.addPartnerParameter(key, value); + adjustEvent.AddPartnerParameter(key, value); } } - if (_command.ContainsParameter("orderId")) - { - var orderId = _command.GetFirstParameterValue("orderId"); - adjustEvent.setTransactionId(orderId); - } - if (_command.ContainsParameter("callbackId")) { var callbackId = _command.GetFirstParameterValue("callbackId"); - adjustEvent.setCallbackId(callbackId); + adjustEvent.CallbackId = callbackId; } if (_command.ContainsParameter("transactionId")) { var transactionId = _command.GetFirstParameterValue("transactionId"); - adjustEvent.setTransactionId(transactionId); + adjustEvent.TransactionId = transactionId; } if (_command.ContainsParameter("productId")) { var productId = _command.GetFirstParameterValue("productId"); - adjustEvent.setProductId(productId); + adjustEvent.ProductId = productId; } - if (_command.ContainsParameter("receipt")) + if (_command.ContainsParameter("purchaseToken")) { - var receipt = _command.GetFirstParameterValue("receipt"); - adjustEvent.setReceipt(receipt); + var purchaseToken = _command.GetFirstParameterValue("purchaseToken"); + adjustEvent.PurchaseToken = purchaseToken; } - if (_command.ContainsParameter("purchaseToken")) + if (_command.ContainsParameter("deduplicationId")) { - var purchaseToken = _command.GetFirstParameterValue("purchaseToken"); - adjustEvent.setPurchaseToken(purchaseToken); + var deduplicationId = _command.GetFirstParameterValue("deduplicationId"); + adjustEvent.DeduplicationId = deduplicationId; } } @@ -613,7 +566,7 @@ private void TrackEvent() } var adjustEvent = _savedEvents[eventNumber]; - Adjust.trackEvent(adjustEvent); + Adjust.TrackEvent(adjustEvent); _savedEvents.Remove(0); } @@ -622,9 +575,7 @@ private void Resume() #if UNITY_IOS AdjustiOS.TrackSubsessionStart("test"); #elif UNITY_ANDROID - AdjustAndroid.OnResume(); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.OnResume(); + AdjustAndroid.OnResume("test"); #else Debug.Log("TestApp - Command Executor - Error! Cannot Resume. None of the supported platforms selected."); #endif @@ -635,9 +586,7 @@ private void Pause() #if UNITY_IOS AdjustiOS.TrackSubsessionEnd("test"); #elif UNITY_ANDROID - AdjustAndroid.OnPause(); -#elif (UNITY_WSA || UNITY_WP8) - AdjustWindows.OnPause(); + AdjustAndroid.OnPause("test"); #else Debug.Log("TestApp - Command Executor - Error! Cannot Pause. None of the supported platforms selected."); #endif @@ -646,34 +595,35 @@ private void Pause() private void SetEnabled() { var enabled = bool.Parse(_command.GetFirstParameterValue("enabled")); - Adjust.setEnabled(enabled); + if (enabled == true) + { + Adjust.Enable(); + } + else + { + Adjust.Disable(); + } } public void GdprForgetMe() { - Adjust.gdprForgetMe(); - } - - public void DisableThirdPartySharing() - { - Adjust.disableThirdPartySharing(); + Adjust.GdprForgetMe(); } private void SetOfflineMode() { var enabled = bool.Parse(_command.GetFirstParameterValue("enabled")); - Adjust.setOfflineMode(enabled); - } - - private void SetReferrer() - { - string referrer = _command.GetFirstParameterValue("referrer"); - #pragma warning disable CS0618 - Adjust.setReferrer(referrer); - #pragma warning restore CS0618 + if (enabled == true) + { + Adjust.SwitchToOfflineMode(); + } + else + { + Adjust.SwitchBackToOnlineMode(); + } } - private void AddSessionCallbackParameter() + private void AddGlobalCallbackParameter() { if (!_command.ContainsParameter("KeyValue")) { @@ -685,16 +635,11 @@ private void AddSessionCallbackParameter() { var key = keyValuePairs[i]; var value = keyValuePairs[i + 1]; - Adjust.addSessionCallbackParameter(key, value); + Adjust.AddGlobalCallbackParameter(key, value); } } - private void SendFirstPackages() - { - Adjust.sendFirstPackages(); - } - - private void AddSessionPartnerParameter() + private void AddGlobalPartnerParameter() { if (!_command.ContainsParameter("KeyValue")) { @@ -706,11 +651,11 @@ private void AddSessionPartnerParameter() { var key = keyValuePairs[i]; var value = keyValuePairs[i + 1]; - Adjust.addSessionPartnerParameter(key, value); + Adjust.AddGlobalPartnerParameter(key, value); } } - private void RemoveSessionCallbackParameter() + private void RemoveGlobalCallbackParameter() { if (!_command.ContainsParameter("key")) { @@ -721,11 +666,11 @@ private void RemoveSessionCallbackParameter() for (var i = 0; i < keys.Count; i = i + 1) { var key = keys[i]; - Adjust.removeSessionCallbackParameter(key); + Adjust.RemoveGlobalCallbackParameter(key); } } - private void RemoveSessionPartnerParameter() + private void RemoveGlobalPartnerParameter() { if (!_command.ContainsParameter("key")) { @@ -736,28 +681,18 @@ private void RemoveSessionPartnerParameter() for (var i = 0; i < keys.Count; i = i + 1) { var key = keys[i]; - Adjust.removeSessionPartnerParameter(key); + Adjust.RemoveGlobalPartnerParameter(key); } } - private void ResetSessionCallbackParameters() + private void RemoveGlobalCallbackParameters() { - Adjust.resetSessionCallbackParameters(); + Adjust.RemoveGlobalCallbackParameters(); } - private void ResetSessionPartnerParameters() + private void RemoveGlobalPartnerParameters() { - Adjust.resetSessionPartnerParameters(); - } - - private void ResetSessionCallbackParameters(JSONNode parameters) - { - Adjust.resetSessionCallbackParameters(); - } - - private void ResetSessionPartnerParameters(JSONNode parameters) - { - Adjust.resetSessionPartnerParameters(); + Adjust.RemoveGlobalPartnerParameters(); } private void SetPushToken() @@ -768,11 +703,11 @@ private void SetPushToken() { if (pushToken.Equals("null")) { - Adjust.setDeviceToken(null); + Adjust.SetPushToken(null); } else { - Adjust.setDeviceToken(pushToken); + Adjust.SetPushToken(pushToken); } } } @@ -780,14 +715,8 @@ private void SetPushToken() private void OpenDeepLink() { var deeplink = _command.GetFirstParameterValue("deeplink"); - Adjust.appWillOpenUrl(deeplink); - } - - private void TrackAdRevenue() - { - string source = _command.GetFirstParameterValue("adRevenueSource"); - string payload = _command.GetFirstParameterValue("adRevenueJsonString"); - Adjust.trackAdRevenue(source, payload); + AdjustDeeplink adjustDeeplink = new AdjustDeeplink(deeplink); + Adjust.ProcessDeeplink(adjustDeeplink); } private void TrackSubscription() @@ -796,17 +725,15 @@ private void TrackSubscription() string price = _command.GetFirstParameterValue("revenue"); string currency = _command.GetFirstParameterValue("currency"); string transactionId = _command.GetFirstParameterValue("transactionId"); - string receipt = _command.GetFirstParameterValue("receipt"); string transactionDate = _command.GetFirstParameterValue("transactionDate"); string salesRegion = _command.GetFirstParameterValue("salesRegion"); AdjustAppStoreSubscription subscription = new AdjustAppStoreSubscription( price, currency, - transactionId, - receipt); - subscription.setTransactionDate(transactionDate); - subscription.setSalesRegion(salesRegion); + transactionId); + subscription.TransactionDate = transactionDate; + subscription.SalesRegion = salesRegion; if (_command.ContainsParameter("callbackParams")) { @@ -815,7 +742,7 @@ private void TrackSubscription() { var key = callbackParams[i]; var value = callbackParams[i + 1]; - subscription.addCallbackParameter(key, value); + subscription.AddCallbackParameter(key, value); } } @@ -826,16 +753,16 @@ private void TrackSubscription() { var key = partnerParams[i]; var value = partnerParams[i + 1]; - subscription.addPartnerParameter(key, value); + subscription.AddPartnerParameter(key, value); } } - Adjust.trackAppStoreSubscription(subscription); + Adjust.TrackAppStoreSubscription(subscription); #elif UNITY_ANDROID string price = _command.GetFirstParameterValue("revenue"); string currency = _command.GetFirstParameterValue("currency"); string purchaseTime = _command.GetFirstParameterValue("transactionDate"); - string sku = _command.GetFirstParameterValue("productId"); + string productId = _command.GetFirstParameterValue("productId"); string signature = _command.GetFirstParameterValue("receipt"); string purchaseToken = _command.GetFirstParameterValue("purchaseToken"); string orderId = _command.GetFirstParameterValue("transactionId"); @@ -843,11 +770,11 @@ private void TrackSubscription() AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription( price, currency, - sku, + productId, orderId, signature, purchaseToken); - subscription.setPurchaseTime(purchaseTime); + subscription.PurchaseTime = purchaseTime; if (_command.ContainsParameter("callbackParams")) { @@ -856,7 +783,7 @@ private void TrackSubscription() { var key = callbackParams[i]; var value = callbackParams[i + 1]; - subscription.addCallbackParameter(key, value); + subscription.AddCallbackParameter(key, value); } } @@ -867,11 +794,11 @@ private void TrackSubscription() { var key = partnerParams[i]; var value = partnerParams[i + 1]; - subscription.addPartnerParameter(key, value); + subscription.AddPartnerParameter(key, value); } } - Adjust.trackPlayStoreSubscription(subscription); + Adjust.TrackPlayStoreSubscription(subscription); #endif } @@ -894,7 +821,7 @@ private void ThirdPartySharing() var partnerName = granularOptions[i]; var key = granularOptions[i+1]; var value = granularOptions[i+2]; - adjustThirdPartySharing.addGranularOption(partnerName, key, value); + adjustThirdPartySharing.AddGranularOption(partnerName, key, value); } } @@ -906,20 +833,20 @@ private void ThirdPartySharing() var partnerName = partnerSharingSettings[i]; var key = partnerSharingSettings[i+1]; var value = partnerSharingSettings[i+2]; - adjustThirdPartySharing.addPartnerSharingSetting(partnerName, key, bool.Parse(value)); + adjustThirdPartySharing.AddPartnerSharingSetting(partnerName, key, bool.Parse(value)); } } - Adjust.trackThirdPartySharing(adjustThirdPartySharing); + Adjust.TrackThirdPartySharing(adjustThirdPartySharing); } private void MeasurementConsent() { var enabled = bool.Parse(_command.GetFirstParameterValue("isEnabled")); - Adjust.trackMeasurementConsent(enabled); + Adjust.TrackMeasurementConsent(enabled); } - private void TrackAdRevenueV2() + private void TrackAdRevenue() { string source = _command.GetFirstParameterValue("adRevenueSource"); AdjustAdRevenue adRevenue = new AdjustAdRevenue(source); @@ -929,31 +856,31 @@ private void TrackAdRevenueV2() var revenueParams = _command.Parameters["revenue"]; var currency = revenueParams[0]; var revenue = double.Parse(revenueParams[1], System.Globalization.CultureInfo.InvariantCulture); - adRevenue.setRevenue(revenue, currency); + adRevenue.SetRevenue(revenue, currency); } if (_command.ContainsParameter("adImpressionsCount")) { int adImpressionsCount = int.Parse(_command.GetFirstParameterValue("adImpressionsCount")); - adRevenue.setAdImpressionsCount(adImpressionsCount); + adRevenue.AdImpressionsCount = adImpressionsCount; } if (_command.ContainsParameter("adRevenueUnit")) { string adRevenueUnit = _command.GetFirstParameterValue("adRevenueUnit"); - adRevenue.setAdRevenueUnit(adRevenueUnit); + adRevenue.AdRevenueUnit = adRevenueUnit; } if (_command.ContainsParameter("adRevenuePlacement")) { string adRevenuePlacement = _command.GetFirstParameterValue("adRevenuePlacement"); - adRevenue.setAdRevenuePlacement(adRevenuePlacement); + adRevenue.AdRevenuePlacement = adRevenuePlacement; } if (_command.ContainsParameter("adRevenueNetwork")) { string adRevenueNetwork = _command.GetFirstParameterValue("adRevenueNetwork"); - adRevenue.setAdRevenueNetwork(adRevenueNetwork); + adRevenue.AdRevenueNetwork = adRevenueNetwork; } if (_command.ContainsParameter("callbackParams")) @@ -963,7 +890,7 @@ private void TrackAdRevenueV2() { var key = callbackParams[i]; var value = callbackParams[i + 1]; - adRevenue.addCallbackParameter(key, value); + adRevenue.AddCallbackParameter(key, value); } } @@ -974,20 +901,17 @@ private void TrackAdRevenueV2() { var key = partnerParams[i]; var value = partnerParams[i + 1]; - adRevenue.addPartnerParameter(key, value); + adRevenue.AddPartnerParameter(key, value); } } - Adjust.trackAdRevenue(adRevenue); + Adjust.TrackAdRevenue(adRevenue); } private void GetLastDeeplink() { #if UNITY_IOS - string localExtraPath = ExtraPath; - string lastDeeplink = Adjust.getLastDeeplink(); - _testLibrary.AddInfoToSend("last_deeplink", lastDeeplink); - _testLibrary.SendInfoToServer(localExtraPath); + Adjust.GetLastDeeplink(LastDeeplinkCallback); #endif } @@ -996,18 +920,12 @@ private void VerifyPurchase() #if UNITY_IOS string transactionId = _command.GetFirstParameterValue("transactionId"); string productId = _command.GetFirstParameterValue("productId"); - string receipt = _command.GetFirstParameterValue("receipt"); - - // recreate UnityIAP base64 encoding of the receipt - var receiptBytes = System.Text.Encoding.UTF8.GetBytes(receipt); - string receiptBase64 = System.Convert.ToBase64String(receiptBytes); AdjustAppStorePurchase purchase = new AdjustAppStorePurchase( transactionId, - productId, - receiptBase64); + productId); - Adjust.verifyAppStorePurchase(purchase, VerificationInfoCallback); + Adjust.VerifyAppStorePurchase(purchase, VerificationResultCallback); #elif UNITY_ANDROID string productId = _command.GetFirstParameterValue("productId"); string purchaseToken = _command.GetFirstParameterValue("purchaseToken"); @@ -1016,24 +934,77 @@ private void VerifyPurchase() productId, purchaseToken); - Adjust.verifyPlayStorePurchase(purchase, VerificationInfoCallback); + Adjust.VerifyPlayStorePurchase(purchase, VerificationResultCallback); #endif } - private void ProcessDeeplink() + private void ProcessAndResolveDeeplink() { var deeplink = _command.GetFirstParameterValue("deeplink"); - Adjust.processDeeplink(deeplink, DeeplinkResolvedCallback); + AdjustDeeplink adjustDeeplink = new AdjustDeeplink(deeplink); + Adjust.ProcessAndResolveDeeplink(adjustDeeplink, DeeplinkResolvedCallback); } - // helper methods + private void AttributionGetter() + { + string localExtraPath = ExtraPath; + Adjust.GetAttribution((attribution) => + { + _testLibrary.AddInfoToSend("tracker_token", attribution.TrackerToken); + _testLibrary.AddInfoToSend("tracker_name", attribution.TrackerName); + _testLibrary.AddInfoToSend("network", attribution.Network); + _testLibrary.AddInfoToSend("campaign", attribution.Campaign); + _testLibrary.AddInfoToSend("adgroup", attribution.Adgroup); + _testLibrary.AddInfoToSend("creative", attribution.Creative); + _testLibrary.AddInfoToSend("click_label", attribution.ClickLabel); + _testLibrary.AddInfoToSend("cost_type", attribution.CostType); + _testLibrary.AddInfoToSend("cost_amount", attribution.CostAmount.ToString()); + _testLibrary.AddInfoToSend("cost_currency", attribution.CostCurrency); + _testLibrary.AddInfoToSend("fb_install_referrer", attribution.FbInstallReferrer); + _testLibrary.SendInfoToServer(localExtraPath); + }); + } - private void VerificationInfoCallback(AdjustPurchaseVerificationInfo verificationInfo) + private void VerifyAndTrack() { string localExtraPath = ExtraPath; - _testLibrary.AddInfoToSend("verification_status", verificationInfo.verificationStatus); - _testLibrary.AddInfoToSend("code", verificationInfo.code.ToString()); - _testLibrary.AddInfoToSend("message", verificationInfo.message); + + Event(); + var eventNumber = 0; + if (_command.ContainsParameter("eventName")) + { + var eventName = _command.GetFirstParameterValue("eventName"); + eventNumber = int.Parse(eventName.Substring(eventName.Length - 1)); + } + + var adjustEvent = _savedEvents[eventNumber]; + +#if UNITY_IOS + Adjust.VerifyAndTrackAppStorePurchase(adjustEvent, (verificationResult) => + { + _testLibrary.AddInfoToSend("verification_status", verificationResult.VerificationStatus); + _testLibrary.AddInfoToSend("code", verificationResult.Code.ToString()); + _testLibrary.AddInfoToSend("message", verificationResult.Message); + _testLibrary.SendInfoToServer(localExtraPath); + }); +#elif UNITY_ANDROID + Adjust.VerifyAndTrackPlayStorePurchase(adjustEvent, (verificationResult) => + { + _testLibrary.AddInfoToSend("verification_status", verificationResult.VerificationStatus); + _testLibrary.AddInfoToSend("code", verificationResult.Code.ToString()); + _testLibrary.AddInfoToSend("message", verificationResult.Message); + _testLibrary.SendInfoToServer(localExtraPath); + }); +#endif + } + + // helper methods + private void VerificationResultCallback(AdjustPurchaseVerificationResult verificationResult) + { + string localExtraPath = ExtraPath; + _testLibrary.AddInfoToSend("verification_status", verificationResult.VerificationStatus); + _testLibrary.AddInfoToSend("code", verificationResult.Code.ToString()); + _testLibrary.AddInfoToSend("message", verificationResult.Message); _testLibrary.SendInfoToServer(localExtraPath); } @@ -1044,6 +1015,13 @@ private void DeeplinkResolvedCallback(string resolvedLink) _testLibrary.SendInfoToServer(localExtraPath); } + private void LastDeeplinkCallback(string lastDeeplink) + { + string localExtraPath = ExtraPath; + _testLibrary.AddInfoToSend("last_deeplink", lastDeeplink); + _testLibrary.SendInfoToServer(localExtraPath); + } + private void CommandNotFound(string className, string methodName) { TestApp.Log("Adjust Test: Method '" + methodName + "' not found for class '" + className + "'"); diff --git a/Assets/Adjust/Test/CommandExecutor.cs.meta b/Assets/Test/Scripts/CommandExecutor.cs.meta similarity index 69% rename from Assets/Adjust/Test/CommandExecutor.cs.meta rename to Assets/Test/Scripts/CommandExecutor.cs.meta index 13434375..5028dc75 100644 --- a/Assets/Adjust/Test/CommandExecutor.cs.meta +++ b/Assets/Test/Scripts/CommandExecutor.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: b1f7d534bff8b45b3bfe06ddafd2436c -timeCreated: 1565086819 -licenseType: Pro +guid: 4eeaf8a57f43540fbb264416b52051ec MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Adjust/Test/CommandListenerAndroid.cs b/Assets/Test/Scripts/CommandListenerAndroid.cs similarity index 96% rename from Assets/Adjust/Test/CommandListenerAndroid.cs rename to Assets/Test/Scripts/CommandListenerAndroid.cs index 920118c1..9789a11a 100644 --- a/Assets/Adjust/Test/CommandListenerAndroid.cs +++ b/Assets/Test/Scripts/CommandListenerAndroid.cs @@ -3,7 +3,7 @@ using Newtonsoft.Json; #endif -namespace com.adjust.sdk.test +namespace AdjustSdk.Test { public class CommandListenerAndroid : AndroidJavaProxy { diff --git a/Assets/Adjust/Test/CommandListenerAndroid.cs.meta b/Assets/Test/Scripts/CommandListenerAndroid.cs.meta similarity index 69% rename from Assets/Adjust/Test/CommandListenerAndroid.cs.meta rename to Assets/Test/Scripts/CommandListenerAndroid.cs.meta index 7006b00e..eb08e160 100644 --- a/Assets/Adjust/Test/CommandListenerAndroid.cs.meta +++ b/Assets/Test/Scripts/CommandListenerAndroid.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: bc4500c47ca57423e9f77ca93d99fd1c -timeCreated: 1565086819 -licenseType: Pro +guid: 65db0e264b985478cb175e32e51a9bed MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Adjust/Test/ExportOptions.plist b/Assets/Test/Scripts/ExportOptions.plist similarity index 100% rename from Assets/Adjust/Test/ExportOptions.plist rename to Assets/Test/Scripts/ExportOptions.plist diff --git a/Assets/Adjust/Test/ExportOptions.plist.meta b/Assets/Test/Scripts/ExportOptions.plist.meta similarity index 74% rename from Assets/Adjust/Test/ExportOptions.plist.meta rename to Assets/Test/Scripts/ExportOptions.plist.meta index 3963117a..9e5e89b8 100644 --- a/Assets/Adjust/Test/ExportOptions.plist.meta +++ b/Assets/Test/Scripts/ExportOptions.plist.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: cca09ebbb683849078c3443744e6aed4 +guid: 061650c94605b4585a14f5b192f6326d DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Adjust/Test/ITestLibrary.cs b/Assets/Test/Scripts/ITestLibrary.cs similarity index 89% rename from Assets/Adjust/Test/ITestLibrary.cs rename to Assets/Test/Scripts/ITestLibrary.cs index 7075a9ba..453621cf 100644 --- a/Assets/Adjust/Test/ITestLibrary.cs +++ b/Assets/Test/Scripts/ITestLibrary.cs @@ -1,4 +1,4 @@ -namespace com.adjust.sdk.test +namespace AdjustSdk.Test { public interface ITestLibrary { diff --git a/Assets/Adjust/Test/ITestLibrary.cs.meta b/Assets/Test/Scripts/ITestLibrary.cs.meta similarity index 69% rename from Assets/Adjust/Test/ITestLibrary.cs.meta rename to Assets/Test/Scripts/ITestLibrary.cs.meta index 95f45f9f..2ae7696c 100644 --- a/Assets/Adjust/Test/ITestLibrary.cs.meta +++ b/Assets/Test/Scripts/ITestLibrary.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 82b695cfa04c9448f821410c1c92d5ee -timeCreated: 1565086819 -licenseType: Pro +guid: 229bdb4832b9f473c8931fe19df04003 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Adjust/Test/TestConectionOptions.cs b/Assets/Test/Scripts/TestConectionOptions.cs similarity index 92% rename from Assets/Adjust/Test/TestConectionOptions.cs rename to Assets/Test/Scripts/TestConectionOptions.cs index 0a51d691..2288d310 100644 --- a/Assets/Adjust/Test/TestConectionOptions.cs +++ b/Assets/Test/Scripts/TestConectionOptions.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace com.adjust.sdk.test +namespace AdjustSdk.Test { #if UNITY_ANDROID public class TestConnectionOptions diff --git a/Assets/Adjust/Test/TestConectionOptions.cs.meta b/Assets/Test/Scripts/TestConectionOptions.cs.meta similarity index 83% rename from Assets/Adjust/Test/TestConectionOptions.cs.meta rename to Assets/Test/Scripts/TestConectionOptions.cs.meta index a0fbb75f..a23fd879 100644 --- a/Assets/Adjust/Test/TestConectionOptions.cs.meta +++ b/Assets/Test/Scripts/TestConectionOptions.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 80d3fa7f7150a441fac3ebcaa5e2dafb +guid: f2cd1fd38567940fca183a638904ea3f MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Adjust/Test/TestLibraryAndroid.cs b/Assets/Test/Scripts/TestLibraryAndroid.cs similarity index 88% rename from Assets/Adjust/Test/TestLibraryAndroid.cs rename to Assets/Test/Scripts/TestLibraryAndroid.cs index 4f53addd..2af069fc 100644 --- a/Assets/Adjust/Test/TestLibraryAndroid.cs +++ b/Assets/Test/Scripts/TestLibraryAndroid.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace com.adjust.sdk.test +namespace AdjustSdk.Test { #if UNITY_ANDROID public class TestLibraryAndroid : ITestLibrary @@ -21,7 +21,10 @@ public TestLibraryAndroid(string overwriteUrl, string controlUrl) public void StartTestSession() { - ajoTestLibrary.Call("startTestSession", Adjust.getSdkVersion()); + Adjust.GetSdkVersion(sdkVersion => + { + ajoTestLibrary.Call("startTestSession", sdkVersion); + }); } public void AddInfoToSend(string key, string paramValue) diff --git a/Assets/Adjust/Test/TestLibraryAndroid.cs.meta b/Assets/Test/Scripts/TestLibraryAndroid.cs.meta similarity index 69% rename from Assets/Adjust/Test/TestLibraryAndroid.cs.meta rename to Assets/Test/Scripts/TestLibraryAndroid.cs.meta index 5f514925..554acff6 100644 --- a/Assets/Adjust/Test/TestLibraryAndroid.cs.meta +++ b/Assets/Test/Scripts/TestLibraryAndroid.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: f141c93a6168043c4a96890b4f36eefe -timeCreated: 1565086819 -licenseType: Pro +guid: 4affdb5ae6cd94ecdb7ca49cb9624b94 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Adjust/Test/TestLibraryBridgeiOS.cs b/Assets/Test/Scripts/TestLibraryBridgeiOS.cs similarity index 98% rename from Assets/Adjust/Test/TestLibraryBridgeiOS.cs rename to Assets/Test/Scripts/TestLibraryBridgeiOS.cs index 9a5751bc..4d93a7f1 100644 --- a/Assets/Adjust/Test/TestLibraryBridgeiOS.cs +++ b/Assets/Test/Scripts/TestLibraryBridgeiOS.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.InteropServices; -namespace com.adjust.sdk.test +namespace AdjustSdk.Test { #if UNITY_IOS public static class TestLibraryBridgeiOS diff --git a/Assets/Adjust/Test/TestLibraryBridgeiOS.cs.meta b/Assets/Test/Scripts/TestLibraryBridgeiOS.cs.meta similarity index 69% rename from Assets/Adjust/Test/TestLibraryBridgeiOS.cs.meta rename to Assets/Test/Scripts/TestLibraryBridgeiOS.cs.meta index 740b1bf2..ef1e8786 100644 --- a/Assets/Adjust/Test/TestLibraryBridgeiOS.cs.meta +++ b/Assets/Test/Scripts/TestLibraryBridgeiOS.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 3bfb10485e475419098b280f5b71b955 -timeCreated: 1565086819 -licenseType: Pro +guid: c759f3ee619a949b194fedf465a76b0c MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Adjust/Test/TestLibraryiOS.cs b/Assets/Test/Scripts/TestLibraryiOS.cs similarity index 92% rename from Assets/Adjust/Test/TestLibraryiOS.cs rename to Assets/Test/Scripts/TestLibraryiOS.cs index acc71a73..6120f5d7 100644 --- a/Assets/Adjust/Test/TestLibraryiOS.cs +++ b/Assets/Test/Scripts/TestLibraryiOS.cs @@ -1,7 +1,7 @@ using System; using Newtonsoft.Json; -namespace com.adjust.sdk.test +namespace AdjustSdk.Test { public class TestLibraryiOS : ITestLibrary { @@ -17,7 +17,9 @@ public TestLibraryiOS(string overwriteUrl, string controlUrl) public void StartTestSession() { TestApp.Log("TestLibrary -> StartTestSession()"); - TestLibraryBridgeiOS.StartTestSession(Adjust.getSdkVersion()); + Adjust.GetSdkVersion((sdkVersion) => { + TestLibraryBridgeiOS.StartTestSession(sdkVersion); + }); } public void AddInfoToSend(string key, string paramValue) diff --git a/Assets/Adjust/Test/TestLibraryiOS.cs.meta b/Assets/Test/Scripts/TestLibraryiOS.cs.meta similarity index 69% rename from Assets/Adjust/Test/TestLibraryiOS.cs.meta rename to Assets/Test/Scripts/TestLibraryiOS.cs.meta index dcec1eb9..7669361c 100644 --- a/Assets/Adjust/Test/TestLibraryiOS.cs.meta +++ b/Assets/Test/Scripts/TestLibraryiOS.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 9214c1417bcf34fff97194e5b2aba260 -timeCreated: 1565086819 -licenseType: Pro +guid: 9cbcff03e12224a7f846f87d6142a97f MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Test/TestApp.meta b/Assets/Test/TestApp.meta new file mode 100644 index 00000000..fa2eae88 --- /dev/null +++ b/Assets/Test/TestApp.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b2913d9fba4f246dfb6669e2c2e2c599 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Test/TestApp/TestApp.cs b/Assets/Test/TestApp/TestApp.cs new file mode 100644 index 00000000..ed3836a5 --- /dev/null +++ b/Assets/Test/TestApp/TestApp.cs @@ -0,0 +1,105 @@ +#if (UNITY_ANDROID || UNITY_IOS) +using System; +#endif +using UnityEngine; +using AdjustSdk.Test; + +public class TestApp : MonoBehaviour +{ + public static readonly string TAG = "[TestApp]"; + +#if UNITY_ANDROID + private const string PORT = ":8443"; + private const string PROTOCOL = "https://"; + private const string IP = "192.168.1.102"; +#elif UNITY_IOS + private const string PORT = ":8080"; + private const string PROTOCOL = "http://"; + private const string IP = "192.168.1.102"; + private TestLibraryiOS _testLibraryiOS; +#else + private const string PORT = ":8080"; + private const string PROTOCOL = "http://"; + private const string IP = "localhost"; +#endif + private const string OVERWRITE_URL = PROTOCOL + IP + PORT; + private const string CONTROL_URL = "ws://" + IP + ":1987"; + + void OnGUI() + { + if (GUI.Button(new Rect(0, Screen.height * 0 / 2, Screen.width, Screen.height / 2), "Start test")) + { + StartTestSession(); + } + } + + private void StartTestSession() + { + ITestLibrary testLibrary = GetPlatformSpecificTestLibrary(); +#if UNITY_IOS + _testLibraryiOS = testLibrary as TestLibraryiOS; +#endif + // Set specific tests to run. + // testLibrary.AddTest("Test_ThirdPartySharing_after_install"); + // testLibrary.AddTestDirectory("purchase-verification"); + + Log("Starting test session."); + testLibrary.StartTestSession(); + } + + private ITestLibrary GetPlatformSpecificTestLibrary() + { +#if UNITY_IOS + return new TestLibraryiOS(OVERWRITE_URL, CONTROL_URL); +#elif UNITY_ANDROID + return new TestLibraryAndroid(OVERWRITE_URL, CONTROL_URL); +#else + Debug.Log("Cannot run integration tests (Error in TestApp.GetPlatformSpecificTestLibrary(...)). None of the supported platforms selected."); + return null; +#endif + } + +#if UNITY_IOS + public void ExecuteCommand(string commandJson) + { + _testLibraryiOS.ExecuteCommand(commandJson); + } +#endif + public static void Log(string message, bool useUnityDebug = false) + { +#if UNITY_ANDROID + var now = DateTime.Now; + string currentTimeString = string.Format("{0}:{1}", now.ToShortTimeString(), now.Second); + string output = string.Format("[{0}{1}]: {2}", currentTimeString, TAG, message); + if (!useUnityDebug) + { + Console.WriteLine(output); + } + else + { + Debug.Log(output); + } +#else + Debug.Log(message); +#endif + } + + public static void LogError(string message, bool useUnityDebug = false) + { +#if UNITY_ANDROID + var now = DateTime.Now; + string currentTimeString = string.Format("{0}:{1}", now.ToShortTimeString(), now.Second); + string output = string.Format("[{0}{1}][Error!]: {2}", currentTimeString, TAG, message); + if (!useUnityDebug) + { + Console.WriteLine(output); + } + else + { + Debug.Log(output); + } +#else + Debug.LogError(message); +#endif + } +} diff --git a/Assets/Adjust/Test/TestApp.cs.meta b/Assets/Test/TestApp/TestApp.cs.meta similarity index 69% rename from Assets/Adjust/Test/TestApp.cs.meta rename to Assets/Test/TestApp/TestApp.cs.meta index bab96280..a3768ce9 100644 --- a/Assets/Adjust/Test/TestApp.cs.meta +++ b/Assets/Test/TestApp/TestApp.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 19fa3cf972a0e4bac87d29dca00d8f23 -timeCreated: 1565086819 -licenseType: Pro +guid: c420967931ab34a33abb412b340a032b MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Adjust/Test/TestApp.unity b/Assets/Test/TestApp/TestApp.unity similarity index 98% rename from Assets/Adjust/Test/TestApp.unity rename to Assets/Test/TestApp/TestApp.unity index a4a9253a..8d8ce546 100644 --- a/Assets/Adjust/Test/TestApp.unity +++ b/Assets/Test/TestApp/TestApp.unity @@ -179,7 +179,7 @@ MonoBehaviour: m_GameObject: {fileID: 1736520634} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 19fa3cf972a0e4bac87d29dca00d8f23, type: 3} + m_Script: {fileID: 11500000, guid: c420967931ab34a33abb412b340a032b, type: 3} m_Name: m_EditorClassIdentifier: --- !u!4 &1736520636 diff --git a/Assets/Test/TestApp/TestApp.unity.meta b/Assets/Test/TestApp/TestApp.unity.meta new file mode 100644 index 00000000..acaef158 --- /dev/null +++ b/Assets/Test/TestApp/TestApp.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3a2594287e34943c49b2b2765c0c5f24 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/CHANGELOG.md b/CHANGELOG.md index f7e41bf0..159fb028 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +### Version 5.0.0 (12th August 2024) + +We're excited to release our major new SDK version (v5). Among many internal improvements, our spoofing protection solution is now included out of the box, reinforcing our commitment to accurate, actionable, and fraud-free data. + +To try out SDK v5 in your app, you can follow our new v4 to v5 [migration guide](https://dev.adjust.com/en/sdk/unity/migration/v4-to-v5). + +If you are a current Adjust client and have questions about SDK v5, please email [sdk-v5@adjust.com](mailto:sdk-v5@adjust.com). + +In case you were using beta version of the SDK v5, please switch to the official v5 release. + +#### Native SDKs +- [iOS@v5.0.0][ios_sdk_v5.0.0] +- [Android@v5.0.0][android_sdk_v5.0.0] + +--- + ### Version 4.38.1 (30th April 2024) #### Added - Added sending of the additional iOS SDK observability parameters for debugging purposes. @@ -1259,6 +1275,7 @@ Kudos to [Ivan](https://github.com/MatkovIvan) and [Evgeny](https://github.com/e [ios_sdk_v4.37.2]: https://github.com/adjust/ios_sdk/tree/v4.37.2 [ios_sdk_v4.38.0]: https://github.com/adjust/ios_sdk/tree/v4.38.0 [ios_sdk_v4.38.2]: https://github.com/adjust/ios_sdk/tree/v4.38.2 +[ios_sdk_v5.0.0]: https://github.com/adjust/ios_sdk/tree/v5.0.0 [android_sdk_v3.5.0]: https://github.com/adjust/android_sdk/tree/v3.5.0 [android_sdk_v4.1.0]: https://github.com/adjust/android_sdk/tree/v4.1.0 @@ -1311,6 +1328,7 @@ Kudos to [Ivan](https://github.com/MatkovIvan) and [Evgeny](https://github.com/e [android_sdk_v4.38.1]: https://github.com/adjust/android_sdk/tree/v4.38.1 [android_sdk_v4.38.2]: https://github.com/adjust/android_sdk/tree/v4.38.2 [android_sdk_v4.38.3]: https://github.com/adjust/android_sdk/tree/v4.38.3 +[android_sdk_v5.0.0]: https://github.com/adjust/android_sdk/tree/v5.0.0 [windows_sdk_v4.12.0]: https://github.com/adjust/windows_sdk/tree/v4.12.0 [windows_sdk_v4.13.0]: https://github.com/adjust/windows_sdk/tree/v4.13.0 diff --git a/LICENSE b/LICENSE index c5ce2d4b..c0d24c16 100644 --- a/LICENSE +++ b/LICENSE @@ -1,20 +1,22 @@ The MIT License (MIT) -Copyright (c) 2012-2017 adjust GmbH +Copyright (c) 2012-Present Adjust GmbH, http://www.adjust.com -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index be9d52ce..e46567c9 100644 --- a/README.md +++ b/README.md @@ -1,1273 +1,7 @@ -## Summary +# Adjust SDK for Unity -This is the Unity SDK of Adjust™. It supports iOS, Android, Windows Store 8.1 and Windows 10 targets. You can read more about Adjust™ at [adjust.com]. - -**Note**: As of version **4.12.0**, Adjust Unity SDK is compatible with **Unity 5 and newer** versions. - -**Note**: As of version **4.19.2**, Adjust Unity SDK is compatible with **Unity 2017.1.1 and newer** versions. - -**Note**: As of version **4.21.0**, Adjust Unity SDK is compatible with **Unity 2017.4.1 and newer** versions. - -Read this in other languages: [English][en-readme], [中文][zh-readme], [日本語][ja-readme], [한국어][ko-readme]. - -## Table of contents - -### Quick start - - * [Getting started](#qs-getting-started) - * [Get the SDK](#qs-get-sdk) - * [Add the SDK to your project](#qs-add-sdk) - * [Integrate the SDK into your app](#qs-integrate-sdk) - * [Adjust logging](#qs-adjust-logging) - * [Google Play Services](#qs-gps) - * [Proguard settings](#qs-android-proguard) - * [Google Install Referrer](#qs-install-referrer) - * [Huawei Referrer API](#qs-huawei-referrer-api) - * [Post-build process](#qs-post-build-process) - * [iOS post-build process](#qs-post-build-ios) - * [Android post-build process](#qs-post-build-android) - * [SDK signature](#qs-sdk-signature) - -### Deeplinking - - * [Deeplinking overview](#dl) - * [Standard deeplinking](#dl-standard) - * [Deeplink handling in Android apps](#dl-app-android) - * [Deeplink handling in iOS apps](#dl-app-ios) - * [Deferred deeplinking](#dl-deferred) - -### Event tracking - - * [Track event](#et-tracking) - * [Track revenue](#et-revenue) - * [Deduplicate revenue](#et-revenue-deduplication) - -### Custom parameters - - * [Custom parameters overview](#cp) - * [Event parameters](#cp-event-parameters) - * [Event callback parameters](#cp-event-callback-parameters) - * [Event partner parameters](#cp-event-partner-parameters) - * [Event callback identifier](#cp-event-callback-id) - * [Session parameters](#cp-session-parameters) - * [Session callback parameters](#cp-session-callback-parameters) - * [Session partner parameters](#cp-session-partner-parameters) - * [Delay start](#cp-delay-start) - -### Additional features - - * [AppTrackingTransparency framework](#ad-att-framework) - * [App-tracking authorisation wrapper](#ad-ata-wrapper) - * [Get current authorisation status](#ad-ata-getter) - * [Check for ATT status change](#ad-att-status-change) - * [SKAdNetwork framework](#ad-skadn-framework) - * [Update SKAdNetwork conversion value](#ad-skadn-update-conversion-value) - * [Conversion value updated callback](#ad-skadn-cv-updated-callback) - * [Push token (uninstall tracking)](#ad-push-token) - * [Attribution callback](#ad-attribution-callback) - * [Ad revenue tracking](#ad-ad-revenue) - * [Subscription tracking](#ad-subscriptions) - * [Session and event callbacks](#ad-session-event-callbacks) - * [User attribution](#ad-user-attribution) - * [Device IDs](#ad-device-ids) - * [iOS advertising identifier](#ad-idfa) - * [Google Play Services advertising identifier](#ad-gps-adid) - * [Amazon advertising identifier](#ad-amazon-adid) - * [Adjust device identifier](#ad-adid) - * [Set external device ID](#set-external-device-id) - * [Preinstalled apps](#ad-preinstalled-apps) - * [Offline mode](#ad-offline-mode) - * [Disable tracking](#ad-disable-tracking) - * [Event buffering](#ad-event-buffering) - * [Background tracking](#ad-background-tracking) - * [GDPR right to be forgotten](#ad-gdpr-forget-me) - * [Third-party sharing](#ad-third-party-sharing) - * [Disable third-party sharing](#ad-disable-third-party-sharing) - * [Enable third-party sharing](#ad-enable-third-party-sharing) - * [Measurement consent](#ad-measurement-consent) - * [Data residency](#ad-data-residency) - * [COPPA compliance](#ad-coppa-compliance) - * [Play Store Kids Apps](#ad-play-store-kids-apps) - -### Testing and troubleshooting - * [Debug information in iOS](#tt-debug-ios) - -### License - * [License agreement](#license) - - -## Quick start - -### Getting started - -To integrate the Adjust SDK into your Unity project, follow these steps. - -### Get the SDK - -You can download the latest version from our [releases page][releases]. - -### Add the SDK to your project - -Open your project in the Unity Editor, go to `Assets → Import Package → Custom Package` and select the downloaded Unity package file. - -### Integrate the SDK into your app - -Add the prefab from `Assets/Adjust/Adjust.prefab` to the first scene. - -You can edit the Adjust script parameters in the prefab `Inspector menu` to set up varios options. - - - -**Note:** You can chose to initialize Adjust SDK in two different ways: - -- Initialize it based on prefab settings you have set in inspector (for this to happen, you need to have `START SDK MANUALLY` option **not checked**). -- Initialize it from your app's code (for this to happen, you need to have `START SDK MANUALLY` option **checked**). - -If you decide to proceed with initialization based on prefab settings in inspector, Adjust SDK will be initialized as soon as `Awake` method of the scene you have added prefab to has been invoked. - -Regardless of which way you pick, in order to initialize SDK, you will need to specify app token and environment. Follow [these steps](https://help.adjust.com/en/dashboard/apps/app-settings#view-your-app-token) to find it in the dashboard. Depending on whether you are building your app for testing or for production, change the `Environment` setting to either 'Sandbox' or 'Production'. - -**Important:** Set the value to `Sandbox` if you or someone else is testing your app. Make sure to set the `Environment` to `Production` before you publish the app. Set it back to `Sandbox` if you start testing again. Also, have in mind that by default Adjust dashboard is showing production traffic of your app, so in case you want to see traffic you generated while testing in sandbox mode, make sure to switch to sandbox traffic view within dashboard. - -We use the environment setting to distinguish between real traffic and artificial traffic from test devices. Please make sure to keep your environment setting updated. - -In order to initialize SDK manually, make sure to do the following: - -```cs -AdjustConfig config = new AdjustConfig("{YourAppToken}", AdjustEnvironment.Sandbox); -Adjust.start(config); -``` - -### Adjust logging - -You can increase or decrease the granularity of the logs you see by changing the value of `Log Level` to one of the following: - -- `Verbose` - enable all logs -- `Debug` - disable verbose logs -- `Info` - disable debug logs (default) -- `Warn` - disable info logs -- `Error` - disable warning logs -- `Assert` - disable error logs -- `Suppress` - disable all logs - -If you want to disable all of your log output when initializing the Adjust SDK manually, set the log level to suppress and use a constructor for the `AdjustConfig` object. This opens a boolean parameter where you can enter whether the suppress log level should be supported or not: - -```cs -AdjustConfig config = new AdjustConfig("{YourAppToken}", AdjustEnvironment.Sandbox, true); -config.setLogLevel(AdjustLogLevel.Suppress); -Adjust.start(config); -``` - -If your target is Windows-based and you want to see the compiled logs from our library in `Release` mode, redirect the log output to your app while testing it in `Debug` mode. - -Call the method `setLogDelegate` in the `AdjustConfig` instance before starting the SDK. - -```cs -// ... -adjustConfig.setLogDelegate(msg => Debug.Log(msg)); -// ... -Adjust.start(adjustConfig); -``` - -### Google Play Services - -Since August 1st 2014, apps in the Google Play Store must use the [Google Advertising ID](https://developer.android.com/google/play-services/id.html) to uniquely identify devices. To allow the Adjust SDK to use the Google Advertising ID, make sure to add latest version of [`play-services-ads-identifier`](https://mvnrepository.com/artifact/com.google.android.gms/play-services-ads-identifier?repo=google) AAR into the `Assets/Plugins/Android` folder of your Unity project. - -If you are using `Google External Dependency Manager` plugin, you can also add this dependecy by stating it inside of your `Dependencies.xml` file: - -```xml - - - -``` - -#### Testing for the Google advertising ID - -To check whether the Adjust SDK is receiving the Google advertising ID, start your app by configuring the SDK to run in `sandbox` mode and set the log level to `verbose`. After that, track a session or an event in the app and check the list of parameters recorded in the verbose logs. If you see the `gps_adid` parameter, our SDK has successfully read the Google advertising ID. - -If you encounter any issues getting the Google advertising ID, please open an issue in our Github repository or contact support@adjust.com. - -### Proguard settings - -If you are using Proguard, add these lines to your Proguard file: - -``` --keep class com.adjust.sdk.** { *; } --keep class com.google.android.gms.common.ConnectionResult { - int SUCCESS; -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { - com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context); -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { - java.lang.String getId(); - boolean isLimitAdTrackingEnabled(); -} --keep public class com.android.installreferrer.** { *; } -``` - -### Google Install Referrer - -In order to attribute the install of an Android app, Adjust needs information about the Google install referrer. You can set up your app to get this by using the **Google Play Referrer API** or by catching the **Google Play Store intent** with a broadcast receiver. - -Google introduced the Google Play Referrer API in order to provide a more reliable and secure way than the Google Play Store intent to obtain install referrer information and to help attribution providers fight click injections. The Google Play Store intent will exist in parallel with the API temporarily, but is set to be deprecated in the future. We encourage you to support this. - -The Adjust post-build process makes sure that SDK will be able to capture the Google Play Store intent; you need take a few additional steps to add support for the new Google Play Referrer API. - -To add support for the Google Play Referrer API, download the latest [install referrer library](https://mvnrepository.com/artifact/com.android.installreferrer/installreferrer) AAR from Maven repository and place it into your `Plugins/Android` folder. - -If you are using `Google External Dependency Manager` plugin, you can also add this dependecy by stating it inside of your `Dependencies.xml` file: - -```xml - - - -``` - -#### Huawei Referrer API - -As of v4.21.1, the Adjust SDK supports install tracking on Huawei devices with Huawei App Gallery version 10.4 and higher. No additional integration steps are needed to start using the Huawei Referrer API. - -### Post-build process - -To complete the app build process, the Adjust Unity package performs custom post-build actions to ensure the Adjust SDK can work properly inside the app. - -As of Adjust SDK v4.30.0, you can customize this process directly from inspector settings of the Adjust prefab. - -![][prefab-post-build-settings] - -Log output messages describing the post build process are written to the Unity IDE console output window. - -#### iOS post-build process - -When it comes to iOS post-build process, you have the ability to control which native iOS frameworks you would like to see linked with your app. Each one of these frameworks offers certain functionality which Adjust SDK will take the advantage of, in case corresponding framework is linked with your app. Here is the list of frameworks you can select and short explanation why would you want to have them linked: - -- `AdServices.framework`: needed for Apple Search Ads tracking (new API, available as of iOS 14.3) -- `AdSupport.framework`: needed for reading IDFA -- `AppTrackingTransparency.framework`: needed to ask for user's consent to be tracked and obtain status of that consent -- `StoreKit.framework`: needed for communication with SKAdNetwork framework - -You can enter `User Tracking Description` message which will be displayed when you present tracking consent dialog to your user. More more information about this in [App-tracking authorisation wrapper](#ad-ata-wrapper) chapter. - -You can also specify scheme based links as well as universal link domains associated with your iOS app. More information about this in [Deeplinking overview](#dl) chapter. - -There are couple of things which iOS post-build process does by default and which you don't have control of. Those things are: - -- Adding the other linker flag `-ObjC` (needed to recognize Adjust Objective-C categories during build time) -- Enabling `Objective-C exceptions` - -#### Android post-build process - -The Android post-build process makes changes to the `AndroidManifest.xml` file located in `Assets/Plugins/Android/`. It also checks for the presence of the `AndroidManifest.xml` file in the Android plugins folder. If the file is not there, it creates a copy from our compatible manifest file `AdjustAndroidManifest.xml`. If there you already have your own `AndroidManifest.xml` file (which should most probably be the case), you have the ability to select what actions will take place during the Android post-build process. - -You can control which permissions you would like the post-build process to add to your `AndroidManifest.xml` file. Each one of these permission enables certain functionality which Adjust SDK will take the advantage of, in case corresponding permission is added to your app. Here is the list of permissions you can select and short explanation why would you want to have them linked: - -- `android.permission.INTERNET`: Needed for Internet connection (must be added). -- `android.permission.ACCESS_NETWORK_STATE`: Needed for reading type of network device is connected to. -- `com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE`: Needed for the new Google install referrer API to work. -- `com.google.android.gms.permission.AD_ID`: If you are targeting Android 12 and above (API level 31), you need to add this permission to read the Google's advertising ID. For more information, see [Google's `AdvertisingIdClient.Info` documentation](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid). - -You can also specify scheme based links associated with your Android app. More information about this in [Deeplinking overview](#dl) chapter. - -One thing which is automatically being done as part of Android post-build process is that it adds the Adjust broadcast receiver (needed for getting install referrer information via Google Play Store intent). If you are using your own broadcast receiver to handle the `INSTALL_REFERRER` intent, you don't need to add the Adjust broadcast receiver to your manifest file. Remove it, but add the call to the Adjust broadcast receiver inside your own receiver, as described in the [Android guide](https://github.com/adjust/android_sdk/blob/master/doc/english/referrer.md). - -### SDK signature - -When you set up the SDK Signature, each SDK communication package is "signed". This lets Adjust’s servers easily detect and reject any install activity that is not legitimate. - -There are just a few steps involved in setting up the SDK Signature. Please contact your Technical Account Manager or support@adjust.com to get started. - -## Deeplinking - -### Deeplinking Overview - -**We support deeplinking on iOS and Android platforms.** - -If you are using Adjust tracker URLs with deeplinking enabled, it is possible to receive information about the deeplink URL and its content. Users may interact with the URL regardless of whether they have your app installed on their device (standard deeplinking) or not (deferred deeplinking). - -### Standard deeplinking - -Standard deeplinking is scenario in which click on a specific link opens your app which is already installed on user's device. - -As of Adjust SDK v4.30.0, [limited support](#why-limited-support) for deeplinking setup is bundled into iOS and Android post-build processes so that you don't need to jump to native Xcode and Android Studio projects and add that support manually. - -**Important:** In case you already had deeplinking set up in your app to support Adjust reattribution via deeplinks, you don't necessarily need to perform steps described in implementation chapters below for iOS and Android platforms. In case you had deeplinking support added to your apps and would like to switch to more convenient approach which Adjust SDK v4.30.0 (or later version) is offering, then please make sure to: - -- **For iOS platform:** Remove calls to `[Adjust appWillOpenUrl:url];` method inside of your app's `AppDelegate` callbacks methods. This part will be automatically done if enabled in inspector menu of Adjust SDK v4.30.0 or later. -- **For Android platform:** Remove calls to `Adjust.appWillOpenUrl(url);` method inside of your app's default `Activity` class methods only if you are using `UNITY_2019_2_OR_NEWER` version. This part will be automatically done if enabled in inspector menu of Adjust SDK v4.30.0 or later. If you are using lower Unity version, then make sure to leave native deeplinking support in your Android app project. - -For more information, check how to enable deeplinking for [iOS](#dl-app-ios) and [Android](#dl-app-android) apps. - -### Deeplink handling in iOS apps - -In order to set up deeplinking support for iOS platform, make sure to perform the following steps: - -- **For scheme based links:** In the inspector, fill in `iOS URL Identifier` text field (this should usually be your iOS bundle ID) and inside of the `iOS URL Schemes` section, add all the schemes which you want your iOS app to handle. **Note:** Pay attention to tooltip which says that when you are entering schemes in the list, you should write them without `://` part at the end. -- **For universal links:** In the inspector, make sure to add each associated domain which your app handles into the `iOS Universal Links Domains` list. **Note:** Pay attention to tooltip which says that when you are entering universal links associated domains, you should write them without `applinks:` part in front of the domain (also without `https://`). - -What iOS post-build process will perform under the hood will be swizzling of some of your app's default `AppDelegate` methods in order to intercept the link which has opened the app and then forward the call further up the hierarchy to your app's default `AppDelegate` callback method implementation. This implementation intercepts the links only to let Adjust SDK know about them and SDK will perform everything which is needed to potentially reattribute your users via deeplinking. SDK does not offer any way of forwarding of deeplinks into Unity layer to be picked up in some custom callback method. If you would like to see information about deeplink captured inside of the Unity layer in your app, make sure to check [Application.deepLinkActivated](https://docs.unity3d.com/ScriptReference/Application-deepLinkActivated.html) method offered by Unity. Be aware that this method is available only as of `UNITY_2019_2_OR_NEWER`. If you would want to obtain information about iOS deeplink in earlier versions of Unity, you would need to implement this mechanism on your own. - -### Deeplink handling in Android apps - -In order to set up deeplinking support for Android platform, make sure to add all the schemes you would like your app to handle into the `Android URI Schemes` list. **Note:** Pay attention to tooltip which says that when you are entering URI schemes in the list, you should write them with `://` part at the end. - -Unlike iOS counter part, Android post-build process will not perform any injection of custom Unity `Activity` class in order to intercept deeplinks which have opened your Android app. Instead, Adjust SDK internally relies on above mentioned [Application.deepLinkActivated](https://docs.unity3d.com/ScriptReference/Application-deepLinkActivated.html) method to get information about deeplink directly from Unity API. SDK will automatically perform everything which is needed to potentially reattribute your users via deeplinking. And, like already mentioned above - feel free to implement this same method in order to obtain deeplink which has opened your Android app. - -Above mentioned Android deeplinking support implementation is why it was said that support for deeplinking was limited - on Android platform this mechanism will work only on `UNITY_2019_2_OR_NEWER` versions of Unity. If you are using older version, you will need to add support for deeplinking on your own inside of your Android Studio app project. Information on how that should be done can be found in [official Android SDK README](https://github.com/adjust/android_sdk#standard-deep-linking-scenario). - -### Deferred deeplinking - -In order to get content information about the deferred deeplink, set a callback method on the `AdjustConfig` object. This will receive one `string` parameter where the content of the URL is delivered. Set this method on the config object by calling the method `setDeferredDeeplinkDelegate`: - -```cs -// ... -private void DeferredDeeplinkCallback(string deeplinkURL) { - Debug.Log("Deeplink URL: " + deeplinkURL); - // ... -} - -AdjustConfig adjustConfig = new AdjustConfig("{YourAppToken}", AdjustEnvironment.Sandbox); -adjustConfig.setDeferredDeeplinkDelegate(DeferredDeeplinkCallback); -Adjust.start(adjustConfig); -``` - -With deferred deeplinking, there is an additional setting you can set on the `AdjustConfig` object. Once the Adjust SDK gets the deferred deeplink information, you can choose whether our SDK should open the URL or not. You can set this option by calling the `setLaunchDeferredDeeplink` method on the config object: - -```cs -// ... -private void DeferredDeeplinkCallback(string deeplinkURL) { - Debug.Log ("Deeplink URL: " + deeplinkURL); - // ... -} - -AdjustConfig adjustConfig = new AdjustConfig("{YourAppToken}", AdjustEnvironment.Sandbox); -adjustConfig.setLaunchDeferredDeeplink(true); -adjustConfig.setDeferredDeeplinkDelegate(DeferredDeeplinkCallback); -Adjust.start(adjustConfig); -``` - -If nothing is set, **the Adjust SDK will always try to launch the URL by default**. - -## Event tracking - -### Track an event - -You can use Adjust to track any event in your app. If you want to track every tap on a button, [create a new event token](https://help.adjust.com/en/tracking/in-app-events/basic-event-setup#generate-event-tokens-in-the-adjust-dashboard) in your dashboard. Let's say that the event token is `abc123`. In your button's click handler method, add the following lines to track the click: - -```cs -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -Adjust.trackEvent(adjustEvent); -``` - -### Track revenue - -If your users generate revenue by engaging with advertisements or making in-app purchases, you can track this with events. For example: if one add tap is worth one Euro cent, you can track the revenue event like this: - -```cs -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setRevenue(0.01, "EUR"); -Adjust.trackEvent(adjustEvent); -``` - -When you set a currency token, Adjust will automatically convert the incoming revenues using the openexchange API into a reporting revenue of your choice. [Read more about currency conversion here](http://help.adjust.com/tracking/revenue-events/currency-conversion). - -If you want to track in-app purchases, please make sure to call `trackEvent` only if the purchase is finished and the item has been purchased. This is important in order to avoid tracking revenue your users did not actually generate. - -### Revenue deduplication - -Add an optional transaction ID to avoid tracking duplicated revenues. The SDK remembers the last ten transaction IDs and skips revenue events with duplicate transaction IDs. This is especially useful for tracking in-app purchases. - -```cs -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setRevenue(0.01, "EUR"); -adjustEvent.setTransactionId("transactionId"); -Adjust.trackEvent(adjustEvent); -``` - -## Custom parameters - -### Custom parameters overview - -In addition to the data points the Adjust SDK collects by default, you can use the Adjust SDK to track and add as many custom values as you need (user IDs, product IDs, etc.) to the event or session. Custom parameters are only available as raw data and will **not** appear in your Adjust dashboard. - -Use [callback parameters](https://help.adjust.com/en/manage-data/export-raw-data/callbacks/best-practices-callbacks) for the values you collect for your own internal use, and partner parameters for those you share with external partners. If a value (e.g. product ID) is tracked both for internal use and external partner use, we recommend using both callback and partner parameters. - -### Event parameters - -### Event callback parameters - -If you register a callback URL for events in your [dashboard], we will send a GET request to that URL whenever the event is tracked. You can also put key-value pairs in an object and pass it to the `trackEvent` method. We will then append these parameters to your callback URL. - -For example, if you've registered the URL `http://www.example.com/callback`, then you would track an event like this: - -```cs -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.addCallbackParameter("key", "value"); -adjustEvent.addCallbackParameter("foo", "bar"); -Adjust.trackEvent(adjustEvent); -``` - -In this case we would track the event and send a request to: - -``` -http://www.example.com/callback?key=value&foo=bar -``` - -Adjust supports a variety of placeholders, for example `{idfa}` for iOS or `{gps_adid}` for Android, which can be used as parameter values. Using this example, in the resulting callback we would replace the placeholder with the IDFA/ Google Play Services ID of the current device. Read more about [real-time callbacks](https://help.adjust.com/en/manage-data/export-raw-data/callbacks) and see our full list of [placeholders](https://partners.adjust.com/placeholders/). - -**Note:** We don't store any of your custom parameters. We only append them to your callbacks. If you haven't registered a callback for an event, we will not read these parameters. - -### Event partner parameters - -Once your parameters are activated in the dashboard, you can send them to your network partners. Read more about [module partners](https://docs.adjust.com/en/special-partners/) and their extended integration. - -This works the same way as callback parameters; add them by calling the `addPartnerParameter` method on your `AdjustEvent` instance. - -```cs -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.addPartnerParameter("key", "value"); -adjustEvent.addPartnerParameter("foo", "bar"); -Adjust.trackEvent(adjustEvent); -``` - -You can read more about special partners and these integrations in our [guide to special partners][special-partners]. - -### Event callback identifier - -You can add custom string identifiers to each event you want to track. We report this identifier in your event callbacks, letting you know which event was successfully tracked. Set the identifier by calling the `setCallbackId` method on your `AdjustEvent` instance: - -```cs -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setCallbackId("Your-Custom-Id"); -Adjust.trackEvent(adjustEvent); -``` - -### Session parameters - -Session parameters are saved locally and sent with every Adjust SDK **event and session**. Whenever you add these parameters, we save them (so you don't need to add them again). Adding the same parameter twice will have no effect. - -It's possible to send session parameters before the Adjust SDK has launched. Using the [SDK delay](#cp-delay-start), you can therefore retrieve additional values (for instance, an authentication token from the app's server), so that all information can be sent at once with the SDK's initialization. - -### Session callback parameters - -You can save event callback parameters to be sent with every Adjust SDK session. - -The session callback parameters' interface is similar to the one for event callback parameters. Instead of adding the key and its value to an event, add them via a call to the `addSessionCallbackParameter` method of the `Adjust` instance: - -```cs -Adjust.addSessionCallbackParameter("foo", "bar"); -``` - -Session callback parameters merge with event callback parameters, sending all of the information as one, but event callback parameters take precedence over session callback parameters. If you add an event callback parameter with the same key as a session callback parameter, we will show the event value. - -You can remove a specific session callback parameter by passing the desired key to the `removeSessionCallbackParameter` method of the `Adjust` instance. - -```cs -Adjust.removeSessionCallbackParameter("foo"); -``` - -To remove all keys and their corresponding values from the session callback parameters, you can reset them with the `resetSessionCallbackParameters` method of the `Adjust` instance. - -```cs -Adjust.resetSessionCallbackParameters(); -``` - -### Session partner parameters - -In the same way that [session callback parameters](#cp-session-callback-parameters) are sent with every event or session that triggers our SDK, there are also session partner parameters. - -These are transmitted to network partners for all of the integrations activated in your [dashboard]. - -The session partner parameters interface is similar to the event partner parameters interface, however instead of adding the key and its value to an event, add it by calling the `addSessionPartnerParameter` method of the `Adjust` instance. - -```cs -Adjust.addSessionPartnerParameter("foo", "bar"); -``` - -Session partner parameters merge with event partner parameters. However, event partner parameters take precedence over session partner parameters. If you add an event partner parameter with the same key as a session partner parameter, we will show the event value. - -To remove a specific session partner parameter, pass the desired key to the `removeSessionPartnerParameter` method of the `Adjust` instance. - -```cs -Adjust.removeSessionPartnerParameter("foo"); -``` - -To remove all keys and their corresponding values from the session partner parameters, reset it with the `resetSessionPartnerParameters` method of the `Adjust` instance. - -```cs -Adjust.resetSessionPartnerParameters(); -``` - -### Delay start - -Delaying the start of the Adjust SDK gives your app time to receive any session parameters (such as unique identifiers) you may want to send on install. - -Set the initial delay time in seconds with the method `setDelayStart` in the `AdjustConfig` instance: - -```cs -adjustConfig.setDelayStart(5.5); -``` - -In this example, the Adjust SDK is prevented from sending the initial install session and any new event for 5.5 seconds. After 5.5 seconds (or if you call `Adjust.sendFirstPackages()` during that time), every session parameter is added to the delayed install session and events, and the Adjust SDK will work as usual. - -You can delay the start time of the Adjust SDK for a maximum of 10 seconds. - -## Additional features - -Once you integrate the Adjust SDK into your project, you can take advantage of the following features: - -### AppTrackingTransparency framework - -**Note**: This feature exists only in iOS platform. - -For each package sent, the Adjust backend receives one of the following four (4) states of consent for access to app-related data that can be used for tracking the user or the device: - -- Authorized -- Denied -- Not Determined -- Restricted - -After a device receives an authorization request to approve access to app-related data, which is used for user device tracking, the returned status will either be Authorized or Denied. - -Before a device receives an authorization request for access to app-related data, which is used for tracking the user or device, the returned status will be Not Determined. - -If authorization to use app tracking data is restricted, the returned status will be Restricted. - -The SDK has a built-in mechanism to receive an updated status after a user responds to the pop-up dialog, in case you don't want to customize your displayed dialog pop-up. To conveniently and efficiently communicate the new state of consent to the backend, Adjust SDK offers a wrapper around the app tracking authorization method described in the following chapter, App-tracking authorization wrapper. - -### App-tracking authorisation wrapper - -**Note**: This feature exists only in iOS platform. - -Adjust SDK offers the possibility to use it for requesting user authorization in accessing their app-related data. Adjust SDK has a wrapper built on top of the [requestTrackingAuthorizationWithCompletionHandler:](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorizationwith?language=objc) method, where you can as well define the callback method to get information about a user's choice. In order for this method to work, you need to specify a text which is going to be displayed as part of the tracking request dialog to your user. This setting is located inside of your iOS app `Info.plist` file under `NSUserTrackingUsageDescription` key. In case you don't want to add specify this on your own in your Xcode project, you can check Adjust prefab settings in inspector and specify this text under `User Tracking Description`. If specified there, Adjust iOS post-build process will make sure to add this setting into your app's `Info.plist` file. - -Also, with the use of this wrapper, as soon as a user responds to the pop-up dialog, it's then communicated back using your callback method. The SDK will also inform the backend of the user's choice. The `NSUInteger` value will be delivered via your callback method with the following meaning: - -- 0: `ATTrackingManagerAuthorizationStatusNotDetermined` -- 1: `ATTrackingManagerAuthorizationStatusRestricted` -- 2: `ATTrackingManagerAuthorizationStatusDenied` -- 3: `ATTrackingManagerAuthorizationStatusAuthorized` - -To use this wrapper, you can call it as such: - -```cs -Adjust.requestTrackingAuthorizationWithCompletionHandler((status) => -{ - switch (status) - { - case 0: - // ATTrackingManagerAuthorizationStatusNotDetermined case - break; - case 1: - // ATTrackingManagerAuthorizationStatusRestricted case - break; - case 2: - // ATTrackingManagerAuthorizationStatusDenied case - break; - case 3: - // ATTrackingManagerAuthorizationStatusAuthorized case - break; - } -}); -``` - -### Get current authorisation status - -**Note**: This feature exists only in iOS platform. - -To get the current app tracking authorization status you can call `getAppTrackingAuthorizationStatus` method of `Adjust` class that will return one of the following possibilities: - -* `0`: The user hasn't been asked yet -* `1`: The user device is restricted -* `2`: The user denied access to IDFA -* `3`: The user authorized access to IDFA -* `-1`: The status is not available - -### Check for ATT status change - -In cases where you are not using [Adjust app-tracking authorization wrapper](#ad-ata-wrapper), Adjust SDK will not be able to know immediately upon answering the dialog what is the new value of app-tracking status. In situations like this, if you would want Adjust SDK to read the new app-tracking status value and communicate it to our backend, make sure to make a call to this method: - -```cs -Adjust.checkForNewAttStatus(); -``` - -### SKAdNetwork framework - -**Note**: This feature exists only in iOS platform. - -If you have implemented the Adjust iOS SDK v4.23.0 or above and your app is running on iOS 14 and above, the communication with SKAdNetwork will be set on by default, although you can choose to turn it off. When set on, Adjust automatically registers for SKAdNetwork attribution when the SDK is initialized. If events are set up in the Adjust dashboard to receive conversion values, the Adjust backend sends the conversion value data to the SDK. The SDK then sets the conversion value. After Adjust receives the SKAdNetwork callback data, it is then displayed in the dashboard. - -In case you don't want the Adjust SDK to automatically communicate with SKAdNetwork, you can disable that by calling the following method on configuration object: - -```cs -adjustConfig.deactivateSKAdNetworkHandling(); -``` - -### Update SKAdNetwork conversion value - -**Note**: This feature exists only in iOS platform. - -You can use Adjust SDK wrapper method `updateConversionValue` to update SKAdNetwork conversion value for your user: - -```cs -Adjust.updateConversionValue(6); -``` - -### Conversion value updated callback - -You can register callback to get notified each time when Adjust SDK updates conversion value for the user. - -```cs -using com.adjust.sdk; - -public class ExampleGUI : MonoBehaviour { - void OnGUI() { - if (GUI.Button(new Rect(0, 0, Screen.width, Screen.height), "callback")) { - AdjustConfig adjustConfig = new AdjustConfig("{Your App Token}", AdjustEnvironment.Sandbox); - adjustConfig.setLogLevel(AdjustLogLevel.Verbose); - adjustConfig.setConversionValueUpdatedDelegate(ConversionValueUpdatedCallback); - - Adjust.start(adjustConfig); - } - } - - private void ConversionValueUpdatedCallback(int conversionValue) - { - Debug.Log("Conversion value update reported!"); - Debug.Log("Conversion value: " + conversionValue); - } -} -``` - -### Push token (uninstall tracking) - -Push tokens are used for Audience Builder and client callbacks; they are also required for uninstall and reinstall tracking. - -To send us a push notification token, call the `setDeviceToken` method on the `Adjust` instance when you obtain your app's push notification token (or whenever its value changes): - -```cs -Adjust.setDeviceToken("YourPushNotificationToken"); -``` - -### Attribution callback - -You can set up a callback to be notified about attribution changes. We consider a variety of different sources for attribution, so we provide this information asynchronously. Make sure to consider [applicable attribution data policies][attribution_data] before sharing any of your data with third-parties. - -Follow these steps to add the optional callback in your application: - -1. Create a method with the signature of the delegate `Action`. - -2. After creating the `AdjustConfig` object, call the `adjustConfig.setAttributionChangedDelegate` with the previously created method. You can also use a lambda with the same signature. - -3. If instead of using the `Adjust.prefab` the `Adjust.cs` script was added to another `GameObject`, be sure to pass the name of the `GameObject` as the second parameter of `AdjustConfig.setAttributionChangedDelegate`. - -Because the callback is configured using the `AdjustConfig` instance, call `adjustConfig.setAttributionChangedDelegate` before calling `Adjust.start`. - -```cs -using com.adjust.sdk; - -public class ExampleGUI : MonoBehaviour { - void OnGUI() { - if (GUI.Button(new Rect(0, 0, Screen.width, Screen.height), "callback")) { - AdjustConfig adjustConfig = new AdjustConfig("{Your App Token}", AdjustEnvironment.Sandbox); - adjustConfig.setLogLevel(AdjustLogLevel.Verbose); - adjustConfig.setAttributionChangedDelegate(this.attributionChangedDelegate); - Adjust.start(adjustConfig); - } - } - - public void attributionChangedDelegate(AdjustAttribution attribution) { - Debug.Log("Attribution changed"); - // ... - } -} -``` - -The callback function will be called when the SDK receives final attribution data. Within the callback function you have access to the `attribution` parameter. Here is a quick summary of its properties: - -- `string trackerToken` the tracker token of the current attribution -- `string trackerName` the tracker name of the current attribution -- `string network` the network grouping level of the current attribution -- `string campaign` the campaign grouping level of the current attribution -- `string adgroup` the ad group grouping level of the current attribution -- `string creative` the creative grouping level of the current attribution -- `string clickLabel` the click label of the current attribution -- `string adid` the Adjust device identifier -- `string costType` the cost type string -- `double? costAmount` the cost amount -- `string costCurrency` the cost currency string -- `string fbInstallReferrer` the Facebook install referrer information - -**Note**: The cost data - `costType`, `costAmount` & `costCurrency` are only available when configured in `AdjustConfig` by calling `setNeedsCost` method. If not configured or configured, but not being part of the attribution, these fields will have value `null`. This feature is available in SDK v4.24.0 and above. - -### Ad revenue tracking - -**Note**: This ad revenue tracking API is available only in the native SDK v4.29.0 and above. - -You can track ad revenue information with Adjust SDK by invoking the following method: - -```objc -// initialise with AppLovin MAX source -AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue("source"); -// set revenue and currency -adjustAdRevenue.setRevenue(1.00, "USD"); -// optional parameters -adjustAdRevenue.setAdImpressionsCount(10); -adjustAdRevenue.setAdRevenueNetwork("network"); -adjustAdRevenue.setAdRevenueUnit("unit"); -adjustAdRevenue.setAdRevenuePlacement("placement"); -// callback & partner parameters -adjustAdRevenue.addCallbackParameter("key", "value"); -adjustAdRevenue.addPartnerParameter("key", "value"); -// track ad revenue -Adjust.trackAdRevenue(adjustAdRevenue); -``` - -Currently we support the below `source` parameter values: - -- `AdjustConfig.AdjustAdRevenueSourceAppLovinMAX` - representing AppLovin MAX platform. -- `AdjustConfig.AdjustAdRevenueSourceMopub` - representing MoPub platform. -- `AdjustConfig.AdjustAdRevenueSourceAdMob` - representing AdMob platform. -- `AdjustConfig.AdjustAdRevenueSourceIronSource` - representing IronSource platform. -- `AdjustConfig.AdjustAdRevenueSourceUnity` - representing Unity platform. -- `AdjustConfig.AdjustAdRevenueSourceHeliumChartboost` - representing Helium Chartboost platform. - -**Note**: Additional documentation which explains detailed integration with every of the supported sources will be provided outside of this README. Also, in order to use this feature, additional setup is needed for your app in Adjust dashboard, so make sure to get in touch with our support team to make sure that everything is set up correctly before you start to use this feature. - -### Subscription tracking - -**Note**: This feature is only available in the SDK v4.22.0 and above. - -You can track App Store and Play Store subscriptions and verify their validity with the Adjust SDK. After a subscription has been successfully purchased, make the following call to the Adjust SDK: - -**For App Store subscription:** - -```cs -AdjustAppStoreSubscription subscription = new AdjustAppStoreSubscription( - price, - currency, - transactionId, - receipt); -subscription.setTransactionDate(transactionDate); -subscription.setSalesRegion(salesRegion); - -Adjust.trackAppStoreSubscription(subscription); -``` - -**For Play Store subscription:** - -```cs -AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription( - price, - currency, - sku, - orderId, - signature, - purchaseToken); -subscription.setPurchaseTime(purchaseTime); - -Adjust.trackPlayStoreSubscription(subscription); -``` - -Subscription tracking parameters for App Store subscription: - -- [price](https://developer.apple.com/documentation/storekit/skproduct/1506094-price?language=objc) -- currency (you need to pass [currencyCode](https://developer.apple.com/documentation/foundation/nslocale/1642836-currencycode?language=objc) of the [priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc) object) -- [transactionId](https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411288-transactionidentifier?language=objc) -- receipt(you need to pass properly formatted JSON `receipt` field of your purchased object returned from Unity IAP API) -- [transactionDate](https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411273-transactiondate?language=objc) -- salesRegion (you need to pass [countryCode](https://developer.apple.com/documentation/foundation/nslocale/1643060-countrycode?language=objc) of the [priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc) object) - -Subscription tracking parameters for Play Store subscription: - -- [price](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpriceamountmicros) -- [currency](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpricecurrencycode) -- [sku](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getsku) -- [orderId](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getorderid) -- [signature](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getsignature) -- [purchaseToken](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getpurchasetoken) -- [purchaseTime](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getpurchasetime) - -**Note:** Subscription tracking API offered by Adjust SDK expects all parameters to be passed as `string` values. Parameters described above are the ones which API exects you to pass to subscription object prior to tracking subscription. There are various libraries which are handling in app purchases in Unity and each one of them should return information described above in some form upon successfully completed subscription purchase. You should locate where these parameters are placed in response you are getting from library you are using for in app purchases, extract those values and pass them to Adjust API as string values. - -Just like with event tracking, you can attach callback and partner parameters to the subscription object as well: - -**For App Store subscription:** - -```cs -AdjustAppStoreSubscription subscription = new AdjustAppStoreSubscription( - price, - currency, - transactionId, - receipt); -subscription.setTransactionDate(transactionDate); -subscription.setSalesRegion(salesRegion); - -// add callback parameters -subscription.addCallbackParameter("key", "value"); -subscription.addCallbackParameter("foo", "bar"); - -// add partner parameters -subscription.addPartnerParameter("key", "value"); -subscription.addPartnerParameter("foo", "bar"); - -Adjust.trackAppStoreSubscription(subscription); -``` - -**For Play Store subscription:** - -```cs -AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription( - price, - currency, - sku, - orderId, - signature, - purchaseToken); -subscription.setPurchaseTime(purchaseTime); - -// add callback parameters -subscription.addCallbackParameter("key", "value"); -subscription.addCallbackParameter("foo", "bar"); - -// add partner parameters -subscription.addPartnerParameter("key", "value"); -subscription.addPartnerParameter("foo", "bar"); - -Adjust.trackPlayStoreSubscription(subscription); -``` - -### Session and event callbacks - -You can set up callbacks to notify you of successful and failed events and/or sessions. - -Follow these steps to add the callback function for successfully tracked events: - -```cs -// ... -AdjustConfig adjustConfig = new AdjustConfig("{Your App Token}", AdjustEnvironment.Sandbox); -adjustConfig.setLogLevel(AdjustLogLevel.Verbose); -adjustConfig.setEventSuccessDelegate(EventSuccessCallback); -Adjust.start(adjustConfig); - -// ... -public void EventSuccessCallback(AdjustEventSuccess eventSuccessData) { - // ... -} -``` - -Add the following callback function for failed tracked events: - -```cs -// ... -AdjustConfig adjustConfig = new AdjustConfig("{Your App Token}", AdjustEnvironment.Sandbox); -adjustConfig.setLogLevel(AdjustLogLevel.Verbose); -adjustConfig.setEventFailureDelegate(EventFailureCallback); -Adjust.start(adjustConfig); - -// ... -public void EventFailureCallback(AdjustEventFailure eventFailureData) { - // ... -} -``` - -For successfully tracked sessions: - -```cs -// ... -AdjustConfig adjustConfig = new AdjustConfig("{Your App Token}", AdjustEnvironment.Sandbox); -adjustConfig.setLogLevel(AdjustLogLevel.Verbose); -adjustConfig.setSessionSuccessDelegate(SessionSuccessCallback); -Adjust.start(adjustConfig); - -// ... -public void SessionSuccessCallback (AdjustSessionSuccess sessionSuccessData) { - // ... -} -``` - -For failed tracked sessions: - -```cs -// ... -AdjustConfig adjustConfig = new AdjustConfig("{Your App Token}", AdjustEnvironment.Sandbox); -adjustConfig.setLogLevel(AdjustLogLevel.Verbose); -adjustConfig.setSessionFailureDelegate(SessionFailureCallback); -Adjust.start(adjustConfig); - -// ... -public void SessionFailureCallback (AdjustSessionFailure sessionFailureData) { - // ... -} -``` - -Callback functions will be called after the SDK tries to send a package to the server. Within the callback you have access to a response data object specifically for the callback. Here is a quick summary of the session response data properties: - -- `string Message` the message from the server or the error logged by the SDK -- `string Timestamp` timestamp from the server -- `string Adid` a unique device identifier provided by Adjust -- `Dictionary JsonResponse` the JSON object with the response from the server - -Both event response data objects contain: - -- `string EventToken` the event token, if the package tracked was an event -- `string CallbackId` the custom defined callback ID set on an event object - -Both event and session failed objects also contain: - -- `bool WillRetry` indicates there will be an attempt to resend the package at a later time - -### User attribution - -This callback, like an attribution callback, is triggered whenever the attribution information changes. Access your user's current attribution information whenever you need it by calling the following method of the `Adjust` instance: - -```cs -AdjustAttribution attribution = Adjust.getAttribution(); -``` - -**Note**: Current attribution information is available after our backend tracks the app install and triggers the attribution callback. It is not possible to access a user's attribution value before the SDK has been initialized and the attribution callback has been triggered. - -### Device IDs - -The Adjust SDK lets you receive device identifiers. - -### iOS Advertising Identifier - -To obtain the IDFA, call the function `getIdfa` of the `Adjust` instance: - -```cs -string idfa = Adjust.getIdfa(); -``` - -### Google Play Services advertising identifier - -The Google Play Services Advertising Identifier (Google advertising ID) is a unique identifier for a device. Users can opt out of sharing their Google advertising ID by toggling the "Opt out of Ads Personalization" setting on their device. When a user has enabled this setting, the Adjust SDK returns a string of zeros when trying to read the Google advertising ID. - -> **Important**: If you are targeting Android 12 and above (API level 31), you need to add the [`com.google.android.gms.AD_ID` permission](#gps-adid-permission) to your app. If you do not add this permission, you will not be able to read the Google advertising ID even if the user has not opted out of sharing their ID. - -The Google advertising ID can only be read in a background thread. If you call the method `getGoogleAdId` of the `Adjust` instance with an `Action` delegate, it will work in any situation: - -```cs -Adjust.getGoogleAdId((string googleAdId) => { - // ... -}); -``` - -You will now have access to the Google advertising ID as the variable `googleAdId`. - -### Amazon advertising identifier - -If you need to get the Amazon advertising ID, call the `getAmazonAdId` method on `Adjust` instance: - -```cs -string amazonAdId = Adjust.getAmazonAdId(); -``` - -### Adjust device identifier - -Our backend generates a unique Adjust device identifier (known as an `adid`) for every device that has your app installed. In order to get this identifier, call this method on `Adjust` instance: - -```cs -String adid = Adjust.getAdid(); -``` - -Information about the adid is only available after our backend tracks the app install. It is not possible to access the adid value before the SDK has been initialized and the installation of your app has been successfully tracked. - -### Set external device ID - -> **Note** If you want to use external device IDs, please contact your Adjust representative. They will talk you through the best approach for your use case. - -An external device identifier is a custom value that you can assign to a device or user. They can help you to recognize users across sessions and platforms. They can also help you to deduplicate installs by user so that a user isn't counted as multiple new installs. - -You can also use an external device ID as a custom identifier for a device. This can be useful if you use these identifiers elsewhere and want to keep continuity. - -Check out our [external device identifiers article](https://help.adjust.com/en/article/external-device-identifiers) for more information. - -> **Note** This setting requires Adjust SDK v4.20.0 or later. - -To set an external device ID, assign the identifier to the `externalDeviceId` property of your config instance. Do this before you initialize the Adjust SDK. - -```cs -AdjustConfig.setExternalDeviceId("{Your-External-Device-Id}") -``` - -> **Important** You need to make sure this ID is **unique to the user or device** depending on your use-case. Using the same ID across different users or devices could lead to duplicated data. Talk to your Adjust representative for more information. - -If you want to use the external device ID in your business analytics, you can pass it as a session callback parameter. See the section on [session callback parameters](#cp-session-parameters) for more information. - -You can import existing external device IDs into Adjust. This ensures that the backend matches future data to your existing device records. If you want to do this, please contact your Adjust representative. - -### Preinstalled apps - -You can use the Adjust SDK to recognize users whose devices had your app preinstalled during manufacturing. Adjust offers two solutions: one which uses the system payload, and one which uses a default tracker. - -In general, we recommend using the system payload solution. However, there are certain use cases which may require the tracker. First check the available [implementation methods](https://help.adjust.com/en/article/pre-install-tracking#Implementation_methods) and your preinstall partner’s preferred method. If you are unsure which solution to implement, reach out to integration@adjust.com - -#### Use the system payload - -- The Content Provider, System Properties, or File System method is supported from SDK v4.23.0 and above. - -- The System Installer Receiver method is supported from SDK v4.27.0 and above. - -Enable the Adjust SDK to recognise preinstalled apps by calling `setPreinstallTrackingEnabled` with the parameter `true` after creating the config object: - - -```cs -adjustConfig.setPreinstallTrackingEnabled(true); -``` - -Depending upon your implmentation method, you may need to make a change to your `AndroidManifest.xml` file. Find the required code change using the table below. - - - - - - - - - - - - - - -
- Method - - AndroidManifest.xml change -
Content ProviderAdd permission:
- -``` - -``` -
System Installer ReceiverDeclare receiver:
- -``` - - - - - -``` -
- -#### Use a default tracker - -- Create a new tracker in your [dashboard]. -- Open your app delegate and set the default tracker of your config: - - ```cs - adjustConfig.setDefaultTracker("{TrackerToken}"); - ``` - -- Replace `{TrackerToken}` with the tracker token you created in step one. Please note that the dashboard displays a tracker URL (including `http://app.adjust.com/`). In your source code, you should specify only the six or seven-character token and not the entire URL. - -- Build and run your app. You should see a line like the following in your LogCat: - - ``` - Default tracker: 'abc123' - ``` - -### Offline mode - -Offline mode suspends transmission to our servers while retaining tracked data to be sent at a later point. While the Adjust SDK is in offline mode, all information is saved in a file. Please be careful not to trigger too many events in offline mode. - -Activate offline mode by calling `setOfflineMode` with the parameter `true`. - -```cs -Adjust.setOfflineMode(true); -``` - -Deactivate offline mode by calling `setOfflineMode` with `false`. When you put the Adjust SDK back into online mode, all saved information is sent to our servers with the correct time information. - -This setting is not remembered between sessions, meaning that the SDK is in online mode whenever it starts, even if the app was terminated in offline mode. - -### Disable tracking - -You can disable Adjust SDK tracking by invoking the method `setEnabled` with the enabled parameter as `false`. This setting is remembered between sessions, but it can only be activated after the first session. - -```cs -Adjust.setEnabled(false); -``` - -You can check if the Adjust SDK is currently active with the method `isEnabled`. It is always possible to activate the Adjust SDK by invoking `setEnabled` with the `enabled` parameter set to `true`. - -### Event buffering - -If your app makes heavy use of event tracking, you might want to delay some network requests in order to send them in one batch every minute. You can enable event buffering with your `AdjustConfig` instance: - -```cs -AdjustConfig adjustConfig = new AdjustConfig("{YourAppToken}", AdjustEnvironment.Sandbox); -adjustConfig.setEventBufferingEnabled(true); -Adjust.start(adjustConfig); -``` - -If nothing is set, event buffering is disabled by default. - -### Background tracking - -The default behaviour of the Adjust SDK is to pause sending network requests while the app is in the background. You can change this in your `AdjustConfig` instance: - -```cs -AdjustConfig adjustConfig = new AdjustConfig("{YourAppToken}", AdjustEnvironment.Sandbox); -adjustConfig.setSendInBackground(true); -Adjust.start(adjustConfig); -``` - -### GDPR right to be forgotten - -In accordance with article 17 of the EU's General Data Protection Regulation (GDPR), you can notify Adjust when a user has exercised their right to be forgotten. Calling the following method will instruct the Adjust SDK to communicate the user's choice to be forgotten to the Adjust backend: - -```cs -Adjust.gdprForgetMe(); -``` - -Upon receiving this information, Adjust will erase the user's data and the Adjust SDK will stop tracking the user. No requests from this device will be sent to Adjust in the future. - -Please note that even when testing, this decision is permanent. It is not reversible. - -## Third-party sharing for specific users - -You can notify Adjust when a user disables, enables, and re-enables data sharing with third-party partners. - -### Disable third-party sharing for specific users - -Call the following method to instruct the Adjust SDK to communicate the user's choice to disable data sharing to the Adjust backend: - -```cs -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(false); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` - -Upon receiving this information, Adjust will block the sharing of that specific user's data to partners and the Adjust SDK will continue to work as usual. - -### Enable or re-enable third-party sharing for specific users - -Call the following method to instruct the Adjust SDK to communicate the user's choice to share data or change data sharing, to the Adjust backend: - -```cs -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(true); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` - -Upon receiving this information, Adjust changes sharing the specific user's data to partners. The Adjust SDK will continue to work as expected. - -Call the following method to instruct the Adjust SDK to send the granular options to the Adjust backend: - -```cs -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(null); -adjustThirdPartySharing.addGranularOption("PartnerA", "foo", "bar"); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` - -### Consent measurement for specific users - -You can notify Adjust when a user exercises their right to change data sharing with partners for marketing purposes, but they allow data sharing for statistical purposes. - -Call the following method to instruct the Adjust SDK to communicate the user's choice to change data sharing, to the Adjust backend: - -```cs -Adjust.trackMeasurementConsent(true); -``` - -Upon receiving this information, Adjust changes sharing the specific user's data to partners. The Adjust SDK will continue to work as expected. - -### Data residency - -In order to enable data residency feature, make sure to make a call to `setUrlStrategy` method of the `AdjustConfig` instance with one of the following constants: - -```objc -adjustConfig.setUrlStrategy(AdjustConfig.AdjustDataResidencyEU); // for EU data residency region -adjustConfig.setUrlStrategy(AdjustConfig.AdjustDataResidencyTR); // for Turkey data residency region -adjustConfig.setUrlStrategy(AdjustConfig.AdjustDataResidencyUS); // for US data residency region -``` - -### COPPA compliance - -By default Adjust SDK doesn't mark app as COPPA compliant. In order to mark your app as COPPA compliant, make sure to call `setCoppaCompliantEnabled` method of `AdjustConfig` instance with boolean parameter `true`: - -```cs -AdjustConfig adjustConfig = new AdjustConfig("{YourAppToken}", AdjustEnvironment.Sandbox); -adjustConfig.setCoppaCompliantEnabled(true); -Adjust.start(adjustConfig); -``` - -**Note:** By enabling this feature, third-party sharing will be automatically disabled for the users. If later during the app lifetime you decide not to mark app as COPPA compliant anymore, third-party sharing **will not be automatically re-enabled**. Instead, next to not marking your app as COPPA compliant anymore, you will need to explicitly re-enable third-party sharing in case you want to do that. - -### Play Store Kids Apps - -By default Adjust SDK doesn't mark Android app as Play Store Kids App. In order to mark your app as the app which is targetting kids in Play Store, make sure to call `setPlayStoreKidsAppEnabled` method of `AdjustConfig` instance with boolean parameter `true`: - -```cs -AdjustConfig adjustConfig = new AdjustConfig("{YourAppToken}", AdjustEnvironment.Sandbox); -adjustConfig.setPlayStoreKidsAppEnabled(true); -Adjust.start(adjustConfig); -``` - -## Testing and troubleshooting - -### Debug information in iOS - -Even with the post build script it is possible that the project is not ready to run out of the box. - -If needed, disable dSYM File. In the `Project Navigator`, select the `Unity-iPhone` project. Click the `Build Settings` tab and search for `debug information`. There should be an `Debug Information Format` or `DEBUG_INFORMATION_FORMAT` option. Change it from `DWARF with dSYM File` to `DWARF`. - - -[dashboard]: http://dash.adjust.com -[adjust.com]: http://adjust.com - -[en-readme]: README.md -[zh-readme]: doc/chinese/README.md -[ja-readme]: doc/japanese/README.md -[ko-readme]: doc/korean/README.md - -[sdk2sdk-mopub]: doc/english/sdk-to-sdk/mopub.md - -[ios]: https://github.com/adjust/ios_sdk -[android]: https://github.com/adjust/android_sdk -[releases]: https://github.com/adjust/adjust_unity_sdk/releases -[google_ad_id]: https://developer.android.com/google/play-services/id.html -[ios-deeplinking]: https://github.com/adjust/ios_sdk/#deeplinking-reattribution -[attribution_data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[special-partners]: https://docs.adjust.com/en/special-partners -[unity-purchase-sdk]: https://github.com/adjust/unity_purchase_sdk -[android-deeplinking]: https://github.com/adjust/android_sdk#deep-linking -[google_play_services]: http://developer.android.com/google/play-services/setup.html -[android_sdk_download]: https://developer.android.com/sdk/index.html#Other -[install-referrer-aar]: https://maven.google.com/com/android/installreferrer/installreferrer/2.2/installreferrer-2.2.aar -[android-custom-receiver]: https://github.com/adjust/android_sdk/blob/master/doc/english/referrer.md - -[menu_android]: https://raw.github.com/adjust/adjust_sdk/master/Resources/unity/v4/menu_android.png -[adjust_editor]: https://raw.github.com/adjust/adjust_sdk/master/Resources/unity/v4/adjust_editor.png -[import_package]: https://raw.github.com/adjust/adjust_sdk/master/Resources/unity/v4/import_package.png -[android_sdk_location]: https://raw.github.com/adjust/adjust_sdk/master/Resources/unity/v4/android_sdk_download.png -[android_sdk_location_new]: https://raw.github.com/adjust/adjust_sdk/master/Resources/unity/v4/android_sdk_download_new.png - -[prefab-sdk-settings]: https://raw.github.com/adjust/sdks/master/Resources/unity/prefab-sdk-settings.png -[prefab-post-build-settings]: https://raw.github.com/adjust/sdks/master/Resources/unity/prefab-post-build-settings.png +This is the [Adjust](https://adjust.com)™ SDK for iOS. Documentation is available on our [developer docs](https://dev.adjust.com/en/sdk/unity/?version=v5). ## License -### License - -The Adjust SDK is licensed under the MIT License. - -Copyright (c) 2012-Present Adjust GmbH, http://www.adjust.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +Distributed under the [`MIT license`](MIT-LICENSE).