コード例 #1
0
        public void onNotificationButtonClick(AndroidJavaObject notification, AndroidJavaObject button)
        {
            var data          = NotificationData.FromAndroid(notification);
            var clickedButton = NotificationButtonData.FromAndroid(button);

            _listener.OnButtonClick(clickedButton, data);
        }
コード例 #2
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);
        }