1

I'm sending a push notification to an iOS device via Notification Hubs. The notification is received successfully. Once the user clicks the notification, the splash screen is displayed then the app closes. I've check the crash logs and there isn't any errors.

If we review the console logs, the last message was 'Received incoming message on top xx at priority 10'.

There's an warning earlier in the logs stating 'No data found at /var/mobile/Library/UserNotification/com.xxxx.xxx/PendingNotifications.plist.

If I send a notification directly from the Azure portal (same device and payload), the notification is received and the app opens as expected.

Thoughts?

Matt Ashurst
  • 306
  • 1
  • 7
  • 1
    You should be sure have done with processing incoming notification. https://learn.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/push-notifications/azure#processing-incoming-push-notifications And if app not running ,should not alerting directly . – Junior Jiang May 09 '19 at 01:51

1 Answers1

0

When you open the app by clicking the notification, didFinishLaunchingWithOptions/ or DidReceiveRemoteNotificationis called. you should add some log prints to see where it gets stuck.

Please take a look at this thread for debugging push notification.

Note: If an application isn't running when a push notification arrives, the application will be launched but the DidReceiveRemoteNotification method won't process the notification. Instead, get the notification payload and respond appropriately from the WillFinishLaunching or FinishedLaunching overrides.

Further reference please visit:

https://learn.microsoft.com/en-us/xamarin/ios/platform/user-notifications/deprecated/remote-notifications-in-ios

Hope it helps.

Mohit Verma
  • 5,140
  • 2
  • 12
  • 27