question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS OnNotificationOpened

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
edmckeecommented, Feb 28, 2018

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

0reactions
rdelrosariocommented, Mar 18, 2018

Will close this for now because can’t reproduce, if still happening for you feel free to reopen it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

onNotification() and onNotificationOpened() callbacks not ...
Issue On iOS, after installing the app and launching it for the first time, I receive notifications when my app is in background...
Read more >
`onNotificationOpened` not being called when app is killed ...
The app opens up fine, but that the payload in the notification isn't loaded because the method handleNotification isn't called. ReactNative ...
Read more >
[OneSignal Plugin] OneSignalOnNotificationOpened is not ...
But on iOS notification just launches (brings foreground) the app but not executing OnNotificationOpened action associated on OneSignalPlugin\OneSignal.
Read more >
Xamarin Forms Firebase Notifications and receiving in ...
I have an app that is using Firebase for notifications (using CrossGeeks / FirebasePushNotificationPlugin). I have it working so that a ...
Read more >
Notifications | React Native Firebase
Notifications are an important tool used on the majority of Android & iOS applications, used to improve user experience, used to engage users...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found