Example #1
0
        public static void setLogLevel(LogLevel logLevel)
        {
                        #if !UNITY_EDITOR
            int log_level_int = -1;
            switch (logLevel)
            {
            case LogLevel.None:
                log_level_int = 0;
                break;

            case LogLevel.Error:
                log_level_int = 1;
                break;

            case LogLevel.Verbose:
                log_level_int = 2;
                break;
            }
                                #if UNITY_IOS
            AdaptyiOS.setLogLevel(log_level_int);
                                #elif UNITY_ANDROID
            AdaptyAndroid.setLogLevel(log_level_int);
                                #endif
                        #endif
        }
Example #2
0
        public static void executeCallback()
        {
            Callback callback = null;

                        #if UNITY_IOS
            callback = AdaptyiOS.getCallback();
                        #elif UNITY_ANDROID
            callback = AdaptyAndroid.getCallback();
                        #endif
            if (callback != null && callback.objectName != null && callback.method != null && callback.message != null)
            {
                GameObject gameObject = UnityEngine.GameObject.Find(callback.objectName);
                if (gameObject != null)
                {
                    MonoBehaviour script = gameObject.GetComponent <MonoBehaviour>();
                    if (script != null)
                    {
                        System.Reflection.MethodInfo method = script.GetType().GetMethod(callback.method);
                        if (method != null)
                        {
                            method.Invoke(script, messageToParameters(callback.method, callback.message));
                        }
                    }
                }
            }
        }
Example #3
0
        public static void updateAttribution(Dictionary <string, string> attribution, AttributionNetwork source, string networkUserId, MonoBehaviour gameObject)
        {
                        #if !UNITY_EDITOR
            int sourceInt = -1;
            switch (source)
            {
            case AttributionNetwork.Appsflyer:
                sourceInt = 0;
                break;

            case AttributionNetwork.Adjust:
                sourceInt = 1;
                break;

            case AttributionNetwork.Branch:
                sourceInt = 2;
                break;

            case AttributionNetwork.Custom:
                sourceInt = 3;
                break;
            }
            string attributionJson = Json.Serialize(attribution);
                                #if UNITY_IOS
            AdaptyiOS.updateAttribution(attributionJson, sourceInt, networkUserId, gameObject ? gameObject.name : null);
                                #elif UNITY_ANDROID
            AdaptyAndroid.updateAttribution(attributionJson, sourceInt, networkUserId, gameObject ? gameObject.name : null);
                                #endif
                        #endif
        }
Example #4
0
 public static void getPurchaserInfo(MonoBehaviour gameObject)
 {
                 #if UNITY_IOS && !UNITY_EDITOR
     AdaptyiOS.getPurchaserInfo(gameObject ? gameObject.name : null);
                 #elif UNITY_ANDROID && !UNITY_EDITOR
     AdaptyAndroid.getPurchaserInfo(gameObject ? gameObject.name : null);
                 #endif
 }
Example #5
0
 public static void restorePurchases(MonoBehaviour gameObject)
 {
                 #if UNITY_IOS && !UNITY_EDITOR
     AdaptyiOS.restorePurchases(gameObject ? gameObject.name : null);
                 #elif UNITY_ANDROID && !UNITY_EDITOR
     AdaptyAndroid.restorePurchases(gameObject ? gameObject.name : null);
                 #endif
 }
Example #6
0
 public static void logout(MonoBehaviour gameObject)
 {
                 #if UNITY_IOS && !UNITY_EDITOR
     AdaptyiOS.logout(gameObject ? gameObject.name : null);
                 #elif UNITY_ANDROID && !UNITY_EDITOR
     AdaptyAndroid.logout(gameObject ? gameObject.name : null);
                 #endif
 }
Example #7
0
 public static void identify(string customerUserId, MonoBehaviour gameObject)
 {
                 #if UNITY_IOS && !UNITY_EDITOR
     AdaptyiOS.identify(customerUserId, gameObject ? gameObject.name : null);
                 #elif UNITY_ANDROID && !UNITY_EDITOR
     AdaptyAndroid.identify(customerUserId, gameObject ? gameObject.name : null);
                 #endif
 }
Example #8
0
 public static void activate(string key, bool observeMode)
 {
                 #if UNITY_IOS && !UNITY_EDITOR
     AdaptyiOS.activate(key, observeMode);
                 #elif UNITY_ANDROID && !UNITY_EDITOR
     AdaptyAndroid.activate(key);
                 #endif
 }
Example #9
0
 public static void setOnPromoReceivedListener(MonoBehaviour gameObject)
 {
                 #if UNITY_IOS && !UNITY_EDITOR
     AdaptyiOS.setOnPromoReceivedListener(gameObject ? gameObject.name : null);
                 #elif UNITY_ANDROID && !UNITY_EDITOR
     AdaptyAndroid.setOnPromoReceivedListener(gameObject ? gameObject.name : null);
                 #endif
 }
Example #10
0
 public static void makePurchase(ProductModel product, string offerId, MonoBehaviour gameObject)
 {
                 #if !UNITY_EDITOR
     string productJson = Json.Serialize(productToDictionary(product));
                         #if UNITY_IOS
     AdaptyiOS.makePurchase(productJson, offerId, gameObject ? gameObject.name : null);
                         #elif UNITY_ANDROID
     AdaptyAndroid.makePurchase(productJson, gameObject ? gameObject.name : null);
                         #endif
                 #endif
 }
Example #11
0
 public static void updateProfile(ProfileParameterBuilder profileParams, MonoBehaviour gameObject)
 {
                 #if !UNITY_EDITOR
     string paramsJson = Json.Serialize(profileParams.getDictionary());
                         #if UNITY_IOS
     AdaptyiOS.updateProfile(paramsJson, gameObject ? gameObject.name : null);
                         #elif UNITY_ANDROID
     AdaptyAndroid.updateProfile(paramsJson, gameObject ? gameObject.name : null);
                         #endif
                 #endif
 }
Example #12
0
 public static void validateAppleReceipt(string receipt, MonoBehaviour gameObject)
 {
                 #if UNITY_IOS && !UNITY_EDITOR
     AdaptyiOS.validateReceipt(receipt, gameObject ? gameObject.name : null);
                 #endif
 }