Example #1
0
        public override void DidReceivePushNotification(MSNotificationHub notificationHub, MSNotificationHubMessage message)
        {
            homeViewController.ProcessNotification(message.Title, message.Body);

            Console.WriteLine("Notification Title: " + message.Title);
            Console.WriteLine("Notification Body: " + message.Body);
        }
Example #2
0
        void ProcessNotification(NSDictionary userInfo)
        {
            if (userInfo == null)
            {
                return;
            }

            Console.WriteLine("Received Notification");

            var apsKey = new NSString("aps");

            if (userInfo.ContainsKey(apsKey))
            {
                var alertKey = new NSString("alert");

                var aps = (NSDictionary)userInfo.ObjectForKey(apsKey);

                if (aps.ContainsKey(alertKey))
                {
                    var alert = (NSString)aps.ObjectForKey(alertKey);

                    homeViewController.ProcessNotification(alert);

                    Console.WriteLine("Notification: " + alert);
                }
            }
        }
Example #3
0
        public void DidReceivePushNotification(MSNotificationHub notificationHub, MSNotificationHubMessage message, CompletionHandler completionHandler)
        {
            homeViewController.ProcessNotification(message.Title, message.Body);

            Console.WriteLine("Notification Title: " + message.Title);
            Console.WriteLine("Notification Body: " + message.Body);

            completionHandler(UIBackgroundFetchResult.NoData);
        }