示例#1
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 (gameObject != null)
            {
                CallBackObjectName = gameObject.name;
            }

#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);
#elif UNITY_WSA_10_0 && !UNITY_EDITOR
            AppsFlyerWindows.InitSDK(devKey, appID, gameObject);
            if (gameObject != null)
            {
                AppsFlyerWindows.GetConversionData(gameObject.name);
            }
#else
#endif
        }
示例#2
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
        }