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; }
public void ShowNotificationAlert (CKNotification notification) { if (NotificationBar.Notification == null) { NotificationBar.Notification = notification; BringSubviewToFront (NotificationBar); NotificationBar.Show (); } }
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; }
public void ShowNotificationAlert(CKNotification notification) { if (NotificationBar.Notification == null) { NotificationBar.Notification = notification; BringSubviewToFront(NotificationBar); NotificationBar.Show(); } }
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); }
void Close () { Animate (0.4, () => { label.Hidden = true; button.Hidden = true; heightConstraint.Constant = 0; notification = null; }); }
public void AddNotification(CKNotification notification) { Results.Items.Add(new CKNotificationWrapper(notification)); Results.Added.Add(Results.Items.Count - 1); }