-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[firebase_messaging] App remains functional but no notifications are received until app is force killed and restarted #3052
Comments
The FCM diagnostics view available at I can't copy the logs out of the text control for some reason but I see lines for
But this message did not appear in my Flutter app, either in * The FCM logs do show an error when a message is received for a force-killed app. |
The extra logs I added to I am using a
my ReceivePort message handlerIn my remote message class, instantiated from final ReceivePort bgMsgPort = ReceivePort();
// ...
IsolateNameServer.registerPortWithName(bgMsgPort.sendPort, bgMsgIsolateName);
bgMsgPort.listen(onBgIsolateMessage); // logs the message received and displays a LocalNotification And the callback passed as Future<dynamic> onBackgroundMessage(Map<String, dynamic> message) async {
final port = IsolateNameServer.lookupPortByName(bgMsgIsolateName);
if (port == null) {
print('No port found in lookup on IsolateNameServer!');
return Future.value(true);
}
port.send(message);
} In a successful background message display, I can see in the logs the message arriving at the background handler, passing through the a successful background message
On a failure I get no response from my app and no logs (since only the main isolate can log with FLog). But the extra logging I added to the plugin service reveal the problem:
The main isolate is gone, and its |
Describe the bug
I have a functioning Flutter
firebase_messaging
app using FCMdata
messages andflutter_local_notifications
to render high priority notifications. Both foreground and background messages are functioning and result in a notification shown to the user. However, on some user devices, the app eventually stops receiving notifications, even if the user opens and interacts with the (still functioning) app. The device that exhibits the behavior most is a Bullitt Group Cat S61.FLog
to log received FCM messages in their handlers so each message is visible in the logs. These missed messages do not show anything in the logs which leads me to believe the messages are not arriving to the app at all.I understand that an app that has been killed is unable to receive broadcasts and aggressive OEM battery optimization can kill apps prematurely. That isn't the case here where the app is exempted from battery & background processing limits. Additionally, once in this state the app does not appear to receive FCMs in the foreground or after recent use.
To Reproduce
Repro steps are hard to describe. My tester reports getting dozens of messages successfully over 24 hours or so until they stop and none are received until the app is force killed and restarted. The point at which the messages stop does not seem to match up with app usage time. Of course this state does not occur running from the debugger.
Expected behavior
I expect each FCM message to trigger either of the
onMessage
oronBackgroundMessage
callbacks.Additional Questions
How can I determine if this is an issue with my app or with the operating system / some OEM "feature"?
Is there a way to confirm that the FCM push is delivered to the phone (outside of my app logs, which do not show it)?
Is there a way to log from the firebase_messaging plugin to determine if the
FlutterFirebaseMessagingService
is being called correctly?Flutter doctor
The text was updated successfully, but these errors were encountered: