Reputation: 41
How to get APNs number for IOS device in flutter for push notification? FirebaseMessaging provides a device token. It's work for Android, but for IOS I need APNs token for push notification. Please give me suggestions.
Upvotes: 3
Views: 10521
Reputation: 1198
You can get APNs Token from FirebaseMessaging
...
just check the platform if it's iOS/macOS then put this condition
var iosToken=await FirebaseMessaging.instance.getAPNSToken();
in the case of android/Web its gonna return null
Upvotes: 8
Reputation: 1
Try this plugin flutter_apns, it is based on the FirebaseMessaging, but for IOS, you can get token from APNs and do not depend on FCM.
Upvotes: 0