Exemplo n.º 1
0
        public static NotificationButtonData FromAndroid(AndroidJavaObject androidJavaObject)
        {
            NotificationButtonData button = new NotificationButtonData();

            try {
                string json = PusheAndroidUtils.Extension("notification").CallStatic <string>("notificationButtonToJson", androidJavaObject);
                button = JsonUtility.FromJson <NotificationButtonData>(json);
            } catch (Exception e) {
                PusheUnity.Log("Failed to parse notification " + e);
            }
            return(button);
        }
Exemplo n.º 2
0
        public static InAppMessage FromAndroid(AndroidJavaObject androidObject)
        {
            var inapp = new InAppMessage();

            try {
                var inappJson = PusheAndroidUtils.Extension("inappmessaging").CallStatic <string>("inAppToJson", androidObject);
                inapp = JsonUtility.FromJson <InAppMessage>(inappJson);
            } catch (Exception e) {
                PusheUnity.Log("Failed to parse inapp message.\n" + e);
            }
            return(inapp);
        }
Exemplo n.º 3
0
        public void onCustomContentNotification(AndroidJavaObject customContent)
        {
            var data = PusheAndroidUtils.Extension("notification").CallStatic <string>("mapToString", customContent);

            _listener.OnCustomContentReceived(data);
        }
Exemplo n.º 4
0
 public static void SendEcommerceData(string name, double price, string category = null, long quantity = -1)
 {
     PusheAndroidUtils.Extension("analytics").CallStatic("sendEcommerce", name, price, category, quantity);
 }
Exemplo n.º 5
0
 public static string GetSubscribedTags()
 {
     return(PusheAndroidUtils.Extension().CallStatic <string>("getSubscribedTagsJson"));
 }
Exemplo n.º 6
0
 public static string[] GetSubscribedTopics()
 {
     return(PusheAndroidUtils.Extension().CallStatic <string>("getSubscribedTopicsCsv").Split(','));
 }