public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo) { ParsePush.HandlePush(userInfo); NSDictionary aps = userInfo.ObjectForKey(new NSString("aps")) as NSDictionary; string alert = ""; if (aps.ContainsKey(new NSString("alert"))) { alert = (aps [new NSString("alert")] as NSString).ToString(); } alert = alert.Replace("Nuovo evento creato: ", ""); var detail = new UIEventDetail(true); detail.key = alert; detail.Title = "Eventi"; this.navigationController.PushViewController(detail, true); application.ApplicationIconBadgeNumber = 0; application.CancelAllLocalNotifications(); //.ca }
public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action <UIBackgroundFetchResult> completionHandler) { if (application.ApplicationState == UIApplicationState.Active) { // Application in Foregroud, popup message if (userInfo.ContainsKey(NSObject.FromObject("aps"))) { var aps = userInfo["aps"] as NSMutableDictionary; if (aps != null) { if (aps.ContainsKey(NSObject.FromObject("alert"))) { var alert = (aps["alert"] ?? NSObject.FromObject("")).ToString(); new UIAlertView("Artportalen", alert, null, "Ok", null).Show(); } } } } ParsePush.HandlePush(userInfo); completionHandler(UIBackgroundFetchResult.NoData); }
public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo) { // We need this to fire userInfo into ParsePushNotificationReceived. ParsePush.HandlePush(userInfo); }
public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo) { ParsePush.HandlePush(userInfo); }