getAPNSToken() returns null on real ios device
I am trying to implement push notifications in my flutter app using FCM but calling getAPNSToken() is returning null whenever I test on a real device. It works in the simulator (can’t receive a notification but I can get the APNs token and the device registration token). I have enabled background fetch and remote notifications and added the Push Notifications capability in xcode and have uploaded my APN key to firebase. Here is my code for requesting notification permission and getting the APN token and device token:
Convert APNS token to FCM device registration token using Firebase Admin SDK
Now that the legacy Firebase APIs are being deprecated, it appears this might include the Instance ID Server APIs.