Example #1
0
        private void RequestIDFAAndOpen(bool isOldUser)
        {
            idfv = SystemInfo.deviceUniqueIdentifier;
#if UNITY_EDITOR
            idfa = "UNITY_EDITOR_IDFA";
            StartCoroutine(OpenRequest(isOldUser));
#elif UNITY_IOS
            idfa = ElephantIOS.IDFA();
            Debug.Log("Native IDFA -> " + idfa);
            StartCoroutine(OpenRequest(isOldUser));
#else
            Application.RequestAdvertisingIdentifierAsync(
                (string advertisingId, bool trackingEnabled, string error) =>
            {
                if (!trackingEnabled)
                {
                    advertisingId = "";
                }

                idfa = advertisingId;

                Debug.Log("IDFA -> " + idfa);

                StartCoroutine(OpenRequest(isOldUser));
            }
                );
#endif
        }
Example #2
0
        private void RequestIDFAAndOpen(bool isOldUser)
        {
            idfv = SystemInfo.deviceUniqueIdentifier;
#if UNITY_EDITOR
            idfa = "UNITY_EDITOR_IDFA";
            StartCoroutine(OpenRequest(isOldUser));
#elif UNITY_IOS
            idfa = ElephantIOS.IDFA();
            Debug.Log("Native IDFA -> " + idfa);
            StartCoroutine(OpenRequest(isOldUser));
#else
            idfa = ElephantAndroid.FetchAdId();
            Debug.Log("Native IDFA -> " + idfa);
            StartCoroutine(OpenRequest(isOldUser));
#endif
        }