public static void RegisterOnReceivedCallback()
        {
#if UNITY_IOS && !UNITY_EDITOR
            onNotificationReceived = new NotificationReceivedCallback(NotificationReceived);
            _SetNotificationReceivedDelegate(onNotificationReceived);
#endif
        }
Esempio n. 2
0
        public static void RegisterOnReceivedRemoteNotificationCallback()
        {
#if UNITY_IOS && !UNITY_EDITOR
            s_OnRemoteNotificationReceived = new NotificationReceivedCallback(RemoteNotificationReceived);
            _SetRemoteNotificationReceivedDelegate(s_OnRemoteNotificationReceived);
#endif
        }
        private static void Initialize()
        {
            try
            {
                var notificationReceivedCallback = new NotificationReceivedCallback();
                NotificationReceivedCallback.NotificationReceived += OnNotificationReceived;

                _notificationManager =
                    new AndroidJavaClass("com.igorgalimski.unitylocalnotification.NotificationManager");
                _notificationManager.CallStatic("InitializeInternal", notificationReceivedCallback, OPEN_APP_ACTIVITY);

                ReceivedNotifications = GetReceivedNotifications();

                ForegroundReceivedNotifications = new List <Notification>();
                ClearReceivedNotifications();
            }
            catch (Exception exception)
            {
                Debug.LogError("Initialize error: " + exception.Message);
            }
        }
Esempio n. 4
0
 private static extern void _SetRemoteNotificationReceivedDelegate(NotificationReceivedCallback callback);