public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action <UIBackgroundFetchResult> completionHandler) { if (application.ApplicationState == UIApplicationState.Inactive) { var data = PushNotificationHandler.GetParameters(userInfo); App.OnNotificationOpened(null, new FirebasePushNotificationResponseEventArgs(data)); completionHandler(UIBackgroundFetchResult.NewData); return; } FirebasePushNotificationManager.DidReceiveMessage(userInfo); completionHandler(UIBackgroundFetchResult.NewData); }
/// <summary> /// Method to subscribe push using Windows Azure /// </summary> public async void SuscribePush() { if (string.IsNullOrWhiteSpace(ApId) || string.IsNullOrEmpty(ApId)) { ApId = Convert.ToString(Guid.NewGuid()); Regex rgx = new Regex("[^a-zA-Z0-9]"); ApId = rgx.Replace(ApId, ""); } string[] UniqueID = { "ApId" }; UniqueID[0] = ApId; _pushNotificationHandler = new PushNotificationHandler(); await _pushNotificationHandler.SubscribeToPushes(UniqueID); }