Ejemplo n.º 1
0
        public static void start(AdTraceConfig adtraceConfig)
        {
            if (IsEditor())
            {
                return;
            }

            if (adtraceConfig == null)
            {
                Debug.Log("AdTrace: Missing config to start.");
                return;
            }

            #if UNITY_IOS
            AdTrace.eventSuccessDelegate       = adtraceConfig.getEventSuccessDelegate();
            AdTrace.eventFailureDelegate       = adtraceConfig.getEventFailureDelegate();
            AdTrace.sessionSuccessDelegate     = adtraceConfig.getSessionSuccessDelegate();
            AdTrace.sessionFailureDelegate     = adtraceConfig.getSessionFailureDelegate();
            AdTrace.deferredDeeplinkDelegate   = adtraceConfig.getDeferredDeeplinkDelegate();
            AdTrace.attributionChangedDelegate = adtraceConfig.getAttributionChangedDelegate();
            AdTraceiOS.Start(adtraceConfig);
            #elif UNITY_ANDROID
            AdTraceAndroid.Start(adtraceConfig);
            #else
            Debug.Log(errorMsgPlatform);
            #endif
        }
Ejemplo n.º 2
0
 public static void gdprForgetMe()
 {
     #if UNITY_IOS
     AdTraceiOS.GdprForgetMe();
     #elif UNITY_ANDROID
     AdTraceAndroid.GdprForgetMe();
     #else
     Debug.Log(errorMsgPlatform);
     #endif
 }
Ejemplo n.º 3
0
        public static void addSessionCallbackParameter(string key, string value)
        {
            if (IsEditor())
            {
                return;
            }

            #if UNITY_IOS
            AdTraceiOS.AddSessionCallbackParameter(key, value);
            #elif UNITY_ANDROID
            AdTraceAndroid.AddSessionCallbackParameter(key, value);
            #else
            Debug.Log(errorMsgPlatform);
            #endif
        }
Ejemplo n.º 4
0
        public static void sendFirstPackages()
        {
            if (IsEditor())
            {
                return;
            }

            #if UNITY_IOS
            AdTraceiOS.SendFirstPackages();
            #elif UNITY_ANDROID
            AdTraceAndroid.SendFirstPackages();
            #else
            Debug.Log(errorMsgPlatform);
            #endif
        }
Ejemplo n.º 5
0
        public static void appWillOpenUrl(string url)
        {
            if (IsEditor())
            {
                return;
            }

            #if UNITY_IOS
            AdTraceiOS.AppWillOpenUrl(url);
            #elif UNITY_ANDROID
            AdTraceAndroid.AppWillOpenUrl(url);
            #else
            Debug.Log(errorMsgPlatform);
            #endif
        }
Ejemplo n.º 6
0
        public static void setDeviceToken(string deviceToken)
        {
            if (IsEditor())
            {
                return;
            }

            #if UNITY_IOS
            AdTraceiOS.SetDeviceToken(deviceToken);
            #elif UNITY_ANDROID
            AdTraceAndroid.SetDeviceToken(deviceToken);
            #else
            Debug.Log(errorMsgPlatform);
            #endif
        }
Ejemplo n.º 7
0
        public static void setOfflineMode(bool enabled)
        {
            if (IsEditor())
            {
                return;
            }

            #if UNITY_IOS
            AdTraceiOS.SetOfflineMode(enabled);
            #elif UNITY_ANDROID
            AdTraceAndroid.SetOfflineMode(enabled);
            #else
            Debug.Log(errorMsgPlatform);
            #endif
        }
Ejemplo n.º 8
0
        public static void removeSessionPartnerParameter(string key)
        {
            if (IsEditor())
            {
                return;
            }

            #if UNITY_IOS
            AdTraceiOS.RemoveSessionPartnerParameter(key);
            #elif UNITY_ANDROID
            AdTraceAndroid.RemoveSessionPartnerParameter(key);
            #else
            Debug.Log(errorMsgPlatform);
            #endif
        }
Ejemplo n.º 9
0
        public static void resetSessionCallbackParameters()
        {
            if (IsEditor())
            {
                return;
            }

            #if UNITY_IOS
            AdTraceiOS.ResetSessionCallbackParameters();
            #elif UNITY_ANDROID
            AdTraceAndroid.ResetSessionCallbackParameters();
            #else
            Debug.Log(errorMsgPlatform);
            #endif
        }
Ejemplo n.º 10
0
        public static void SetTestOptions(Dictionary <string, string> testOptions)
        {
            if (IsEditor())
            {
                return;
            }

            #if UNITY_IOS
            AdTraceiOS.SetTestOptions(testOptions);
            #elif UNITY_ANDROID
            AdTraceAndroid.SetTestOptions(testOptions);
            #else
            Debug.Log("Cannot run integration tests. None of the supported platforms selected.");
            #endif
        }
Ejemplo n.º 11
0
        public static void setReferrer(string referrer)
        {
            if (IsEditor())
            {
                return;
            }

            #if UNITY_IOS
            Debug.Log("AdTrace: Install referrer is not available on iOS platform.");
            #elif UNITY_ANDROID
            AdTraceAndroid.SetReferrer(referrer);
            #else
            Debug.Log(errorMsgPlatform);
            #endif
        }
Ejemplo n.º 12
0
        public static string getSdkVersion()
        {
            if (IsEditor())
            {
                return(string.Empty);
            }

            #if UNITY_IOS
            return(AdTraceiOS.GetSdkVersion());
            #elif UNITY_ANDROID
            return(AdTraceAndroid.GetSdkVersion());
            #else
            Debug.Log(errorMsgPlatform);
            return(string.Empty);
            #endif
        }
Ejemplo n.º 13
0
        public static AdTraceAttribution getAttribution()
        {
            if (IsEditor())
            {
                return(null);
            }

            #if UNITY_IOS
            return(AdTraceiOS.GetAttribution());
            #elif UNITY_ANDROID
            return(AdTraceAndroid.GetAttribution());
            #else
            Debug.Log(errorMsgPlatform);
            return(null);
            #endif
        }
Ejemplo n.º 14
0
        public static bool isEnabled()
        {
            if (IsEditor())
            {
                return(false);
            }

            #if UNITY_IOS
            return(AdTraceiOS.IsEnabled());
            #elif UNITY_ANDROID
            return(AdTraceAndroid.IsEnabled());
            #else
            Debug.Log(errorMsgPlatform);
            return(false);
            #endif
        }
Ejemplo n.º 15
0
        public static void getGoogleAdId(Action <string> onDeviceIdsRead)
        {
            if (IsEditor())
            {
                return;
            }

            #if UNITY_IOS
            Debug.Log("AdTrace: Google Play Advertising ID is not available on iOS platform.");
            onDeviceIdsRead(string.Empty);
            #elif UNITY_ANDROID
            AdTraceAndroid.GetGoogleAdId(onDeviceIdsRead);
            onDeviceIdsRead(string.Empty);
            #else
            Debug.Log(errorMsgPlatform);
            #endif
        }
Ejemplo n.º 16
0
        public static string getAmazonAdId()
        {
            if (IsEditor())
            {
                return(string.Empty);
            }

            #if UNITY_IOS
            Debug.Log("AdTrace: Amazon Advertising ID is not available on iOS platform.");
            return(string.Empty);
            #elif UNITY_ANDROID
            return(AdTraceAndroid.GetAmazonAdId());

            return(string.Empty);
            #else
            Debug.Log(errorMsgPlatform);
            return(string.Empty);
            #endif
        }
Ejemplo n.º 17
0
        public static void trackEvent(AdTraceEvent adtraceEvent)
        {
            if (IsEditor())
            {
                return;
            }

            if (adtraceEvent == null)
            {
                Debug.Log("AdTrace: Missing event to track.");
                return;
            }
            #if UNITY_IOS
            AdTraceiOS.TrackEvent(adtraceEvent);
            #elif UNITY_ANDROID
            AdTraceAndroid.TrackEvent(adtraceEvent);
            #else
            Debug.Log(errorMsgPlatform);
            #endif
        }
Ejemplo n.º 18
0
        void OnApplicationPause(bool pauseStatus)
        {
            if (IsEditor())
            {
                return;
            }

            #if UNITY_IOS
            // No action, iOS SDK is subscribed to iOS lifecycle notifications.
            #elif UNITY_ANDROID
            if (pauseStatus)
            {
                AdTraceAndroid.OnPause();
            }
            else
            {
                AdTraceAndroid.OnResume();
            }
            #else
            Debug.Log(errorMsgPlatform);
            #endif
        }