azure-notificationhubs-xamarin icon indicating copy to clipboard operation
azure-notificationhubs-xamarin copied to clipboard

[BUG] iOS push notifications not received to physical device from Azure

Open ghost opened this issue 4 years ago • 7 comments

Describe the bug Originally posted on stackoverflow, was recommended by a Microsoft support engineer to post here: https://stackoverflow.com/questions/64768446/ios-push-notification-not-received-to-physical-device-from-azure

I follow this Microsoft guide rigorously but push notifications don't come through to the physical device: https://docs.microsoft.com/en-us/azure/notification-hubs/xamarin-notification-hubs-ios-push-notification-apns-get-started

Exception or Stack Trace RegisteredForRemoteNotifications is called successfully, but ReceivedRemoteNotification is never called when I send a Test Send from Azure. No obvious errors or exceptions come through. However, inside the .iOS project, within the method RegisteredForRemoteNotifications, I have noticed that when I hover over my SBNotificationHub instance, under the class handle it gives an error: "Unable to cast object of type 'Mono.Debugger.Soft.PointerValue' to type 'Mono.Debugger.Soft.PrimitiveValue'." Not sure if this has anything to do with my problem.

To Reproduce Steps to reproduce the behavior: On a PC with visual studio 2019 (Connected to a Mac over local network) and connect an iPhone to the Mac via lightning cable. Make sure device is connected to WIFI/phone network, create a new Xamarin project for android and iOS. Use only the code from this Microsoft guide:

https://docs.microsoft.com/en-us/azure/notification-hubs/xamarin-notification-hubs-ios-push-notification-apns-get-started.

Send a Test Send from Azure.

Expected behavior A push notifcation should come through to the physical iPhone,

Setup (please complete the following information):

  • OS: Windows 10 PC, connected to a Mac over local network.
  • IDE : Visual Studio 2019 v16.8.0
  • Xamarin.Azure.NotificationHubs.iOS v3.1.0
  • iPhone 6s v14.1 (Connected via lightning cable)

ghost avatar Nov 11 '20 09:11 ghost

I forgot to add, the iPhone does pop up with a permission request for push notifications, which I accept.

ghost avatar Nov 11 '20 09:11 ghost

I'm experiencing the same behaviour with a different framework. Underlying class handle also gives: Unable to cast object of type 'Mono.Debugger.Soft.PointerValue' to type 'Mono.Debugger.Soft.PrimitiveValue'.

pavloss avatar Nov 16 '20 08:11 pavloss

I'm experiencing the exact same as shown above, following exactly the same Microsoft docs article and verbatim code. The counterpart Xamarin.Android knowledge article and Azure Notification Hub Tests work perfectly.

c0demak3r avatar Nov 22 '20 15:11 c0demak3r

Is there any news about this?

nativenolde avatar Dec 14 '20 12:12 nativenolde

Any recent news?

matscr avatar Jan 06 '21 12:01 matscr

@DopaFiend @matscr and others, we are updating the documentation to use the latest APIs that should be merged soon https://github.com/MicrosoftDocs/azure-docs/pull/68800

We are aware of the bug in the legacy APIs due to threading issues and are advising people to use the new APIs

mpodwysocki avatar Jan 13 '21 16:01 mpodwysocki

Could someone assist me with this? I am still not receiving any notification message that hits DidReceivePushNotification. I see success messages in Azure when sending. I followed the latest documentation fully. I am using the following:

Windows 10 PC, connected to a Mac over local network.
Visual Studio 2019 v16.8.6
Xamarin.Azure.NotificationHubs.iOS v3.1.1
iphone 7 v14.4 (Connected via lightning cable)
Xcode 12.4

shaytate avatar Mar 08 '21 15:03 shaytate