Skip to content
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

No method to receive Firebase Message / Notification #623

Open
rupakTj opened this issue Sep 6, 2024 · 4 comments
Open

No method to receive Firebase Message / Notification #623

rupakTj opened this issue Sep 6, 2024 · 4 comments

Comments

@rupakTj
Copy link

rupakTj commented Sep 6, 2024

Firebase Messaging does not provide any method to receive the incoming message / notification.

Do not have any method like override fun onMessageReceived(message: RemoteMessage) provided by FirebaseMessagingService

Is there any other way to receive the messages/notifications.

@mr-kew
Copy link
Contributor

mr-kew commented Sep 9, 2024

I use platform specific code for that. See #467

@rupakTj
Copy link
Author

rupakTj commented Sep 12, 2024

Yes, I have used the same [https://search.maven.org/artifact/dev.gitlive/firebase-messaging/2.1.0/pom](Firebase Messaging library), but this lib only contains methods for fetching token, subscribe/unsubscribe topics.

But there is method to receive message. Am i missing anything?.

@mr-kew
Copy link
Contributor

mr-kew commented Sep 12, 2024

I am now not sure if I understood the question correctly.

What i meant is that you can obtain the native firebase messaging inside you iosMain (for example) by doing:

val messaging = Firebase.messaging.ios

// You can then proceed to handle the notifications as you would do in swift.

messaging.delegate = this

But this library (even in its native form) is not meant to receive notifications directly. You are just meant to register your app to receive notifications from Firebase. The receiving & displaying itself is handled by the respective os (that means in iosApp).

@rupakTj
Copy link
Author

rupakTj commented Sep 21, 2024

thanks @mr-kew for the guidance. Yes in the native layer it can be done,

but it would have been great for one stop solution if this library can provide the message receive part as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants