Example #1
0
        /// <summary>
        /// Set the user phone number.
        /// </summary>
        /// <param name="phoneNumber">phoneNumber string</param>
        public static void setPhoneNumber(string phoneNumber)
        {
#if UNITY_IOS && !UNITY_EDITOR
            AppsFlyeriOS.setPhoneNumber(phoneNumber);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.setPhoneNumber(phoneNumber);
#else
#endif
        }
Example #2
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.setHost(hostName, hostPrefixName);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.setHost(hostPrefixName, hostName);
#else
#endif
        }
Example #3
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.setUserEmails(cryptMethod, emails.Length, emails);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.setUserEmails(cryptMethod, emails);
#else
#endif
        }
Example #4
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.anonymizeUser(shouldAnonymizeUser);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.anonymizeUser(shouldAnonymizeUser);
#else
#endif
        }
Example #5
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.setIsDebug(shouldEnable);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.setIsDebug(shouldEnable);
#else
#endif
        }
Example #6
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.setCurrencyCode(currencyCode);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.setCurrencyCode(currencyCode);
#else
#endif
        }
Example #7
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.recordLocation(latitude, longitude);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.recordLocation(latitude, longitude);
#else
#endif
        }
Example #8
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.setResolveDeepLinkURLs(urls);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.setResolveDeepLinkURLs(urls);
#else
#endif
        }
Example #9
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.setOneLinkCustomDomains(domains);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.setOneLinkCustomDomain(domains);
#else
#endif
        }
Example #10
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.setAdditionalData(customData);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.setAdditionalData(customData);
#else
#endif
        }
Example #11
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.setAppInviteOneLinkID(oneLinkId);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.setAppInviteOneLinkID(oneLinkId);
#else
#endif
        }
Example #12
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.setCustomerUserID(id);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.setCustomerUserId(id);
#else
#endif
        }
Example #13
0
        /// <summary>
        /// Used by advertisers to exclude all networks/integrated partners from getting data.
        /// </summary>
        public static void setSharingFilterForAllPartners()
        {
#if UNITY_IOS && !UNITY_EDITOR
            AppsFlyeriOS.setSharingFilterForAllPartners();
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.setSharingFilterForAllPartners();
#else
#endif
        }
Example #14
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.setMinTimeBetweenSessions(seconds);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.setMinTimeBetweenSessions(seconds);
#else
#endif
        }
Example #15
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.stopSDK(isSDKStopped);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.stopSDK(isSDKStopped);
#else
#endif
        }
Example #16
0
        /// <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 && !UNITY_EDITOR
            return(AppsFlyeriOS.getAppsFlyerId());
#elif UNITY_ANDROID && !UNITY_EDITOR
            return(AppsFlyerAndroid.getAppsFlyerId());
#else
            return("");
#endif
        }
Example #17
0
        // <summary>
        /// Was the stopSDK(boolean) API set to true.
        /// </summary>
        /// <returns>boolean isSDKStopped.</returns>
        public static bool isSDKStopped()
        {
#if UNITY_IOS && !UNITY_EDITOR
            return(AppsFlyeriOS.isSDKStopped());
#elif UNITY_ANDROID && !UNITY_EDITOR
            return(AppsFlyerAndroid.isSDKStopped());
#else
            return(false);
#endif
        }
Example #18
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.startSDK(onRequestResponse != null, CallBackObjectName);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.startSDK(onRequestResponse != null, CallBackObjectName);
#elif UNITY_WSA_10_0 && !UNITY_EDITOR
            AppsFlyerWindows.Start();
#endif
        }
Example #19
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.sendEvent(eventName, eventValues, onInAppResponse != null, CallBackObjectName);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.sendEvent(eventName, eventValues, onInAppResponse != null, CallBackObjectName);
#elif UNITY_WSA_10_0 && !UNITY_EDITOR
            AppsFlyerWindows.LogEvent(eventName, eventValues);
#else
#endif
        }
Example #20
0
        /// <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 && !UNITY_EDITOR
            AppsFlyeriOS.getConversionData(objectName);
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.getConversionData(objectName);
#elif UNITY_WSA_10_0 && !UNITY_EDITOR
            AppsFlyerWindows.GetConversionData("");
#else
#endif
        }
Example #21
0
        /// <summary>
        /// Initialize the AppsFlyer SDK with your devKey and appID.
        /// The dev key is required on all platforms, and the appID is required for iOS.
        /// If you app is for Android only pass null for the appID.
        /// </summary>
        /// <param name="devKey"> AppsFlyer's Dev-Key, which is accessible from your AppsFlyer account under 'App Settings' in the dashboard.</param>
        /// <param name="appID">Your app's Apple ID.</param>
        /// <param name="gameObject">pass the script of the game object being used.</param>
        /// <example>
        /// <code>
        /// AppsFlyer.initSDK("K2***********99", 41*****44, this);
        /// </code>
        /// </example>
        public static void initSDK(string devKey, string appID, MonoBehaviour gameObject)
        {
#if UNITY_IOS && !UNITY_EDITOR
            AppsFlyeriOS.setAppsFlyerDevKey(devKey);
            AppsFlyeriOS.setAppleAppID(appID);
            if (gameObject != null)
            {
                AppsFlyeriOS.getConversionData(gameObject.name);
            }
#elif UNITY_ANDROID && !UNITY_EDITOR
            AppsFlyerAndroid.initSDK(devKey, gameObject);
#else
#endif
        }