iOS OnNotificationOpened
See original GitHub issueI upgraded to the version 1.3 in order to control the registering of notifications.
This code was working before in iOS, and is working in Android, but now isn’t working in iOS.
All notifications that are opened come in as OnNotificationReceived.
This is my App.xaml.cs
` CrossPushNotification.Current.OnNotificationReceived += (s, p) =>
{
System.Diagnostics.Debug.WriteLine(“Received”);
NotificationProvider.OnNotificationReceived(JObject.FromObject(p.Data));
};
CrossPushNotification.Current.OnNotificationOpened += (s, p) =>
{
System.Diagnostics.Debug.WriteLine("Opened");
NotificationProvider.OnNotificationOpened(JObject.FromObject(p.Data), p.Identifier);
};`
This is my AppDelegate.cs ’ LoadApplication(new App()); PushNotificationManager.Initialize(options, false); ’ ` public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken) { PushNotificationManager.DidRegisterRemoteNotifications(deviceToken); }
public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)
{
PushNotificationManager.RemoteNotificationRegistrationFailed(error);
}
// To receive notifications in foregroung on iOS 9 and below.
// To receive notifications in background in any iOS version
public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler)
{
PushNotificationManager.DidReceiveMessage(userInfo);
}`
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (8 by maintainers)
Top GitHub Comments
Well, I thought this made sense but i’m calling CrossPushNotification.Current.RegisterForPushNotifications() in the new version and I am receiving notifications, but they don’t go to the OnNotificationOpened. Is there something in the Initialize(options,true) besides the user permissions that might impact the OnNotificationOpened not being called? I’ll still try out the autoregister
Will close this for now because can’t reproduce, if still happening for you feel free to reopen it.