-
Notifications
You must be signed in to change notification settings - Fork 3
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
Push notification not working on iOS #5
Comments
any something new on this issue and ?? 👀 |
I don't think that iOS notifications are implemented at all judging by this line here:
It appears that on the iOS platform side, only FCM token updates are listened to, and transmitted to Flutter. I don't think that this plugin has much use on iOS anyways
This plugin (as stated in the name), provides Firebase Messages in a shared isolate (as opposed to a separate isolate), thus allowing you to access application's context and state. iOS implementation of Firebase Messages already runs in a shared isolate, thus having no need for a separate plugin. While cumbersome, you can support both Android and iOS with the following snippet: if (Platform.isIOS) {
FirebaseMessaging.onBackgroundMessage(
(final RemoteMessage message) async {
_handlePushMessage(message.data);
},
);
FirebaseMessaging.onMessage.listen(
(final RemoteMessage message) async {
_handlePushMessage(message.data);
},
);
}
if (Platform.isAndroid) {
final FcmSharedIsolate firebase = FcmSharedIsolate();
firebase.setListeners(
onMessage: (message) {
final Map<dynamic, dynamic> messageData = message['data'] ?? message;
_handlePushMessage(messageData);
},
);
}
Future<void> _handlePushMessage(Map<dynamic, dynamic> messageData) {
// Handle the push
} |
In GitLab by @paulhuanggitlab on Jun 8, 2023, 08:28
Description
Recently, I have been working on enabling push notifications in FluffyChat.
It works fine on Android, but I'm facing issues with iOS. After investigating,
I found that in the
Pods/FirebaseMessaging/FirebaseMessaging
module, theappDidReceiveMessage
method is receiving the notifications correctly. However, the data is not being sent to the method channel inFcmSharedIsolatePlugin
.Any steps I missing or can somebody explain how it work? Appreciate.
Service,Platform & Version
The text was updated successfully, but these errors were encountered: