/// <summary> /// Set the user emails and encrypt them. /// cryptMethod Encryption method: /// EmailCryptType.EmailCryptTypeMD5 /// EmailCryptType.EmailCryptTypeSHA1 /// EmailCryptType.EmailCryptTypeSHA256 /// EmailCryptType.EmailCryptTypeNone /// </summary> /// <param name="cryptMethod">Encryption method.</param> /// <param name="emails">User emails.</param> public static void setUserEmails(EmailCryptType cryptMethod, params string[] emails) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setUserEmails(cryptMethod, emails.Length, emails); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.setUserEmails(cryptMethod, emails); #else #endif }
/// <summary> /// Enables Debug logs for the AppsFlyer SDK. /// Should only be set to true in development / debug. /// </summary> /// <param name="shouldEnable">shouldEnable boolean.</param> public static void setIsDebug(bool shouldEnable) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setIsDebug(shouldEnable); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.setIsDebug(shouldEnable); #else #endif }
/// <summary> /// Setting user local currency code for in-app purchases. /// The currency code should be a 3 character ISO 4217 code. (default is USD). /// You can set the currency code for all events by calling the following method. /// </summary> /// <param name="currencyCode">3 character ISO 4217 code.</param> public static void setCurrencyCode(string currencyCode) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setCurrencyCode(currencyCode); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.setCurrencyCode(currencyCode); #else #endif }
/// <summary> /// Manually record the location of the user. /// </summary> /// <param name="latitude">latitude as double.</param> /// <param name="longitude">longitude as double.</param> public static void recordLocation(double latitude, double longitude) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.recordLocation(latitude, longitude); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.recordLocation(latitude, longitude); #else #endif }
/// <summary> /// Advertisers can use this method to set vanity onelink domains. /// </summary> /// <param name="domains">Array of domains.</param> public static void setOneLinkCustomDomain(params string[] domains) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setOneLinkCustomDomains(domains); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.setOneLinkCustomDomain(domains); #else #endif }
/// <summary> /// Advertisers can wrap AppsFlyer OneLink within another Universal Link. /// This Universal Link will invoke the app but any deep linking data will not propagate to AppsFlyer. /// </summary> /// <param name="urls">Array of urls.</param> public static void setResolveDeepLinkURLs(params string[] urls) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setResolveDeepLinkURLs(urls); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.setResolveDeepLinkURLs(urls); #else #endif }
/// <summary> /// Set additional data to be sent to AppsFlyer. /// </summary> /// <param name="customData">additional data Dictionary.</param> public static void setAdditionalData(Dictionary <string, string> customData) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setAdditionalData(customData); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.setAdditionalData(customData); #else #endif }
/// <summary> /// Anonymize user Data. /// Use this API during the SDK Initialization to explicitly anonymize a user's installs, events and sessions. /// Default is false. /// </summary> /// <param name = "shouldAnonymizeUser" >shouldAnonymizeUser boolean.</param> public static void anonymizeUser(bool shouldAnonymizeUser) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.anonymizeUser(shouldAnonymizeUser); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.anonymizeUser(shouldAnonymizeUser); #else #endif }
/// <summary> /// Setting your own customer ID enables you to cross-reference your own unique ID with AppsFlyer’s unique ID and the other devices’ IDs. /// This ID is available in AppsFlyer CSV reports along with Postback APIs for cross-referencing with your internal IDs. /// </summary> /// <param name="id">Customer ID for client.</param> public static void setCustomerUserId(string id) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setCustomerUserID(id); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.setCustomerUserId(id); #else #endif }
/// <summary> /// Once this API is invoked, our SDK no longer communicates with our servers and stops functioning. /// In some extreme cases you might want to shut down all SDK activity due to legal and privacy compliance. /// This can be achieved with the stopSDK API. /// </summary> /// <param name="isSDKStopped"> should sdk be stopped.</param> public static void stopSDK(bool isSDKStopped) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.stopSDK(isSDKStopped); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.stopSDK(isSDKStopped); #else #endif }
/// <summary> /// Set the user phone number. /// </summary> /// <param name="phoneNumber">phoneNumber string</param> public static void setPhoneNumber(string phoneNumber) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setPhoneNumber(phoneNumber); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.setPhoneNumber(phoneNumber); #else #endif }
/// <summary> /// The LinkGenerator class builds the invite URL according to various setter methods which allow passing on additional information on the click. /// See - https://support.appsflyer.com/hc/en-us/articles/115004480866-User-invite-attribution- /// </summary> /// <param name="parameters">parameters Dictionary.</param> public static void generateUserInviteLink(Dictionary <string, string> parameters, MonoBehaviour gameObject) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.generateUserInviteLink(parameters, gameObject); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.generateUserInviteLink(parameters, gameObject); #else #endif }
/// <summary> /// Send an In-App Event. /// In-App Events provide insight on what is happening in your app. /// </summary> /// <param name="eventName">Event Name as String.</param> /// <param name="eventValues">Event Values as Dictionary.</param> public static void sendEvent(string eventName, Dictionary <string, string> eventValues) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.sendEvent(eventName, eventValues, onInAppResponse != null, CallBackObjectName); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.sendEvent(eventName, eventValues, onInAppResponse != null, CallBackObjectName); #else #endif }
/// <summary> /// Once this API is invoked, our SDK will start. /// Once the API is called a sessions will be immediately sent, and all background forground transitions will send a session. /// </summary> public static void startSDK() { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.startSDK(onRequestResponse != null, CallBackObjectName); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.startSDK(onRequestResponse != null, CallBackObjectName); #else #endif }
/// <summary> /// To attribute an impression use the following API call. /// Make sure to use the promoted App ID as it appears within the AppsFlyer dashboard. /// </summary> /// <param name="appID">promoted App ID.</param> /// <param name="campaign">cross promotion campaign.</param> /// <param name="parameters">parameters Dictionary.</param> public static void recordCrossPromoteImpression(string appID, string campaign, Dictionary <string, string> parameters) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.recordCrossPromoteImpression(appID, campaign, parameters); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.recordCrossPromoteImpression(appID, campaign, parameters); #else #endif }
/// <summary> /// Register a Conversion Data Listener. /// Allows the developer to access the user attribution data in real-time for every new install, directly from the SDK level. /// By doing this you can serve users with personalized content or send them to specific activities within the app, /// which can greatly enhance their engagement with your app. /// </summary> /// <example> /// <code> /// AppsFlyer.getConversionData(this.name); /// </code> /// </example> public static void getConversionData(string objectName) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.getConversionData(objectName); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.getConversionData(objectName); #else #endif }
/// <summary> /// Use the following API to attribute the click and launch the app store's app page. /// </summary> /// <param name="appID">promoted App ID</param> /// <param name="campaign">cross promotion campaign</param> /// <param name="userParams">additional user params</param> /// <example> /// <code> /// Dictionary<string, string> parameters = new Dictionary<string, string>(); /// parameters.Add("af_sub1", "val"); /// parameters.Add("custom_param", "val2"); /// AppsFlyer.attributeAndOpenStore("123456789", "test campaign", parameters, this); /// </code> /// </example> public static void attributeAndOpenStore(string appID, string campaign, Dictionary <string, string> userParams, MonoBehaviour gameObject) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.attributeAndOpenStore(appID, campaign, userParams, gameObject); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.attributeAndOpenStore(appID, campaign, userParams); #else #endif }
/// <summary> /// Used by advertisers to exclude all networks/integrated partners from getting data. /// </summary> public static void setSharingFilterForAllPartners() { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setSharingFilterForAllPartners(); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.setSharingFilterForAllPartners(); #else #endif }
/// <summary> /// Used by advertisers to set some (one or more) networks/integrated partners to exclude from getting data. /// </summary> /// <param name="partners">partners to exclude from getting data</param> public static void setSharingFilter(params string[] partners) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setSharingFilter(partners); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.setSharingFilter(partners); #else #endif }
/// <summary> /// Set the OneLink ID that should be used for User-Invite-API. /// The link that is generated for the user invite will use this OneLink as the base link. /// </summary> /// <param name="oneLinkId">OneLink ID obtained from the AppsFlyer Dashboard.</param> public static void setAppInviteOneLinkID(string oneLinkId) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setAppInviteOneLinkID(oneLinkId); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.setAppInviteOneLinkID(oneLinkId); #else #endif }
/// <summary> /// Set a custom host. /// </summary> /// <param name="hostPrefixName">Host prefix.</param> /// <param name="hostName">Host name.</param> public static void setHost(string hostPrefixName, string hostName) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setHost(hostName, hostPrefixName); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.setHost(hostPrefixName, hostName); #else #endif }
/// <summary> /// Set a custom value for the minimum required time between sessions. /// By default, at least 5 seconds must lapse between 2 app launches to count as separate 2 sessions. /// </summary> /// <param name="seconds">minimum time between 2 separate sessions in seconds.</param> public static void setMinTimeBetweenSessions(int seconds) { #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setMinTimeBetweenSessions(seconds); #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.setMinTimeBetweenSessions(seconds); #else #endif }
// <summary> /// Was the stopSDK(boolean) API set to true. /// </summary> /// <returns>boolean isSDKStopped.</returns> public static bool isSDKStopped() { #if UNITY_IOS && USE_APPSFLYER return(AppsFlyeriOS.isSDKStopped()); #elif UNITY_ANDROID && USE_APPSFLYER return(AppsFlyerAndroid.isSDKStopped()); #else return(false); #endif }
/// <summary> /// Get AppsFlyer's unique device ID which is created for every new install of an app. /// </summary> /// <returns>AppsFlyer's unique device ID.</returns> public static string getAppsFlyerId() { #if UNITY_IOS && USE_APPSFLYER return(AppsFlyeriOS.getAppsFlyerId()); #elif UNITY_ANDROID && USE_APPSFLYER return(AppsFlyerAndroid.getAppsFlyerId()); #else return(""); #endif }
public void Update() { #if UNITY_IOS && TRACKING_APPSFLYER if (!tokenSent) { // tokenSent needs to be defined somewhere (bool tokenSent = false) byte[] token = UnityEngine.iOS.NotificationServices.deviceToken; if (token != null) { AppsFlyeriOS.registerUninstall(token); tokenSent = true; } } #endif }
void InitAppsFlyerSDK() { #if UNITY_IOS && !UNITY_EDITOR if (useATT) { AppsFlyeriOS.waitForATTUserAuthorizationWithTimeoutInterval(attDuration); } if (disableSKAd) { AppsFlyeriOS.disableSKAdNetwork(true); } #endif // These fields are set from the editor so do not modify! //******************************// AppsFlyer.setIsDebug(true); AppsFlyer.initSDK(devKey, appId, this); //******************************// if (useUDL) { AppsFlyer.OnDeepLinkReceived += OnDeepLink; } if (!String.IsNullOrEmpty(userInviteOneLinkId)) { AppsFlyer.setAppInviteOneLinkID(userInviteOneLinkId); } if (!String.IsNullOrEmpty(cuid)) { AppsFlyer.setCustomerUserId(cuid); } onSDKStarted(); if (DelaySdkStartTime > 0) { StartCoroutine(DelaySdkStartUp()); } else { AppsFlyer.startSDK(); } }
public static void initSDK(GameObject gameObject) { EB.Debug.Log("initSDK=====>"); if (gameObject != null) { CallBackObjectName = gameObject.name; } #if UNITY_IOS && USE_APPSFLYER AppsFlyeriOS.setAppsFlyerDevKey("VCQcpVNrwamwnymY3oeH3Y"); AppsFlyeriOS.setAppleAppID("1546322314"); if (gameObject != null) { AppsFlyeriOS.getConversionData(gameObject.name); } #elif UNITY_ANDROID && USE_APPSFLYER AppsFlyerAndroid.initSDK("VCQcpVNrwamwnymY3oeH3Y", gameObject); AppsFlyerSDK.AppsFlyerAndroid.setCollectAndroidID(true); AppsFlyerSDK.AppsFlyerAndroid.setCollectIMEI(true); #endif }