Closed
Description
Bug report
Describe the bug
Notifications are not getting received on iOS reliably. Sometimes users receive the notifications, sometimes they don't. For the notifications with images, images never load.
I'm using:
firebase_messaging: ^7.0.0
I've double checked the Code. This same code works well on Android:
//Register Firebase messaging
_registerFCM() {
//Register Firebase messaging
_fcm.getToken().then((token) {
strFCMToken = token;
print("Firebase Token: " + strFCMToken);
});
if (Platform.isIOS) {
iosSubscription = _fcm.onIosSettingsRegistered.listen((data) {
// save the token OR subscribe to a topic here
});
_fcm.requestNotificationPermissions(const IosNotificationSettings(sound: true, badge: true, alert: true));
}
_fcm.configure(
onMessage: (Map<String, dynamic> message) async {
print("onMessage: $message");
showInAppNotificationDialog(message);
},
onLaunch: (Map<String, dynamic> message) async {
print("onLaunch: $message");
showInAppNotificationDialog(message);
},
onResume: (Map<String, dynamic> message) async {
print("onResume: $message");
final token = Preference.getString(PreferenceKey.TOKEN_KEY);
if (token != null) {
navigatorKey.currentState.popUntil((Route<dynamic> route) => route is PageRoute);
navigatorKey.currentState.pushReplacementNamed("/home");
showInAppNotificationDialog(message);
}
},
);
}
We are also sure the notification permissions on iOS are requested for the users, and the same are accepted by all the non-receiving users.
Here are the screenshots of the campaign that failed the delivery:
Flutter doctor
Run flutter doctor
and paste the output below:
Click To Expand
PASTE OUTPUT INSIDE HERE
Flutter dependencies
Run flutter pub deps -- --style=compact
and paste the output below:
Click To Expand
╔════════════════════════════════════════════════════════════════════════════╗
║ A new version of Flutter is available! ║
║ ║
║ To update to the latest version, run "flutter upgrade". ║
╚════════════════════════════════════════════════════════════════════════════╝
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.3, on Mac OS X 10.14.6 18G103, locale en-SG)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.46.1)
[✓] Connected device (2 available)
• No issues found!