예제 #1
0
        public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)
        {
            var notification = CKNotification.FromRemoteNotificationDictionary(userInfo);

            var state = application.ApplicationState;

            var viewController = Window?.RootViewController as UINavigationController;

            if (viewController != null)
            {
                var tableViewController = viewController.ViewControllers [0] as MainMenuTableViewController;
                if (tableViewController != null)
                {
                    var index = tableViewController.CodeSampleGroups.Length - 1;
                    if (index > 0)
                    {
                        var notificationSample = tableViewController.CodeSampleGroups [index].CodeSamples [0] as MarkNotificationsReadSample;
                        notificationSample.Cache.AddNotification(notification);
                        tableViewController.TableView.ReloadRows(new NSIndexPath [] { NSIndexPath.FromRowSection(index, 0) }, UITableViewRowAnimation.Automatic);
                    }
                }

                if (state == UIApplicationState.Active)
                {
                    var navigationBar = viewController.NavigationBar as NavigationBar;
                    if (navigationBar != null)
                    {
                        navigationBar.ShowNotificationAlert(notification);
                    }
                }
            }
        }
		public CKNotificationWrapper (CKNotification notification)
		{
			if (notification == null)
				throw new ArgumentNullException ();

			this.notification = notification;
		}
예제 #3
0
		public void ShowNotificationAlert (CKNotification notification)
		{
			if (NotificationBar.Notification == null) {
				NotificationBar.Notification = notification;
				BringSubviewToFront (NotificationBar);
				NotificationBar.Show ();
			}
		}
예제 #4
0
 void Close()
 {
     Animate(0.4, () => {
         label.Hidden              = true;
         button.Hidden             = true;
         heightConstraint.Constant = 0;
         notification              = null;
     });
 }
        public CKNotificationWrapper(CKNotification notification)
        {
            if (notification == null)
            {
                throw new ArgumentNullException();
            }

            this.notification = notification;
        }
예제 #6
0
 public void ShowNotificationAlert(CKNotification notification)
 {
     if (NotificationBar.Notification == null)
     {
         NotificationBar.Notification = notification;
         BringSubviewToFront(NotificationBar);
         NotificationBar.Show();
     }
 }
예제 #7
0
    private void OnQueryNotification(CKNotification notification)
    {
        Debug.Log(string.Format("Recieved notification: {0} {1}", notification.NotificationID, notification.NotificationType));

        if (notification is CKQueryNotification queryNotification)
        {
            Debug.Log("Notification Reason: " + queryNotification.QueryNotificationReason);
            Debug.Log("RecordID: " + queryNotification.RecordID.RecordName);
        }
    }
		public void AddNotification (CKNotification notification)
		{
			Results.Items.Add (new CKNotificationWrapper (notification));
			Results.Added.Add (Results.Items.Count - 1);
		}
예제 #9
0
		void Close ()
		{
			Animate (0.4, () => {
				label.Hidden = true;
				button.Hidden = true;
				heightConstraint.Constant = 0;
				notification = null;
			});
		}
예제 #10
0
 public void AddNotification(CKNotification notification)
 {
     Results.Items.Add(new CKNotificationWrapper(notification));
     Results.Added.Add(Results.Items.Count - 1);
 }