예제 #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
        }