I am using Xamarin Forms and am currently trying to get push notifications to work with the iOS project. I have followed this Xamarin guide to add notifications to my iOS app but the RegisteredForRemoteNotifications method is never called.
I have also created both push notification certificates and enabled background notifications. Even FailedToRegisterForRemoteNotifications is never called.
What can I do?
PS: I'm using an iPhone 5s with iOS 10 so I also read this post on the User Notifications Framework.
You cannot register the device if it is a simulated device.
Points for noticing the big note at the top of the Xamarin guide, a lot of people sometimes gloss over them.
It would have been nice to see some of your own code sample, but that's neither here nor there.
So as you said you plan on using iOS 10 devices, here is the code we use that works from 10.3 backwards.This code is in our FinishedLaunching() method inside the AppDelegate class.
The key really is the following lines:
OR
I was having the same issue. The fault was, the mobile phone didn't have an active internet connection!
So, after publishing in the AppStore it starts working...