I'm trying to implement notifications on a specific screen, however, Flutterflow requests notification permission right after logging in. I have tried manually deactivating the permission from FF but when obtaining the FCM Token it gives me the following error: Unhandled Exception: [firebase_messaging/apns-token-not-set] APNS token has not been set yet. Please ensure the APNS token is available by calling getAPNSToken().
Is there a way to do this without having to touch native code or without having to modify the main.dart, taking the following post as a reference: Premature Request for Notification Permissions
Handling notification permissions manually on a specific screen
Custom Code
I have tried to get the FCM token from custom action using the following code:
final fcmToken = await FirebaseMessaging.instance.getToken();
But it always gives me an error:
Unhandled Exception: [firebase_messaging/apns-token-not-set] APNS token has not been set yet. Please ensure the APNS token is available by calling `getAPNSToken()`.
Yes
2
1 reply