I have the notifications working in android without any issue, but in iOS I can't figure out what seems to be the problem.
- I have created the APN file and upload into Firebase iOS Configuration
- Both Team ID & App ID are correct - double checked
- The "Push Notifications" is both active in the Apple Developer & Xcode
- When the App starts a request by iOS is made to allow notifications
I'm using firebase_messaging plugin and in my main.dart
I put:
@override
void initState() {
super.initState();
if (Platform.isIOS)
this.fbaseMessaging.requestNotificationPermissions(
IosNotificationSettings(sound: true, badge: true, alert: true),
);
}
And when the user logs in I grab the token:
fbaseMessaging.getToken().then((token) {
// Updates the user account
});
I have tested in Xcode Simulator, in a iOS device in TestFlight as well as in a released version and I never receive any notification and I have no clue how to debug where is the problem.
Followed several tutorials like:
- https://medium.com/flutterpub/enabling-firebase-cloud-messaging-push-notifications-with-flutter-39b08f2ed723
- https://www.youtube.com/watch?time_continue=450&v=PzjxZsz3Tjk