Skip to content
Back

Flutter messaging

  • 0
  • Self Hosted
  • Flutter
Eweren
12 Mar, 2024, 13:26

Hi there, I am playing around with push notifications for my flutter application. I'm struggling to figure out how to setup android push notifications because of the native kotlin part. The guide says I should edit the MainActivity to save the fcmToken into the sharedPreferences and create a FirebaseMessagingService to handle updates of the fcmToken that will then be saved to the signed-in Appwrite account. But doesn't that mean that I have to manage the andoid appwrite sdk and the flutter sdk seperately in one project and call native kotlin code from my flutter project when e.g. the user signs in? Maybe I got something wrong here. Is there a flutter sdk function to get the current fcmToken so that I can handle this part in flutter?

Thank you for helping! šŸ¤—

TL;DR
Developers are looking for help setting up push notifications for their Flutter application. They are struggling with integrating the native Kotlin part for Android push notifications. They wonder if they need to manage the Android SDK and Flutter SDK separately and call native code from their Flutter project. Is there a Flutter SDK function to get the current FCM token instead of using native Kotlin code? Solution: Yes, there is a Flutter plugin called `firebase_messaging` that can be used to handle push notifications directly in Flutter without needing to write native Kotlin code.
Eweren
12 Mar, 2024, 13:30
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more