Posts

Showing posts from May, 2020

Firebase Cloud Messaging with Flutter - easy steps

Image
Hi, today I'm writing this article because of some difficulties which I have faced in integrating cloud functions into my Flutter mobile app. Here what I'm going to do is trigger a notification from firebase cloud function and push notification in the flutter app. I hope you have done the basic setup in the flutter app as firebase_messaging documentation says as below. No need to repeat the same thing so I'm going to dive directly to the changes you needed. https://pub.dev/packages/firebase_messaging After setting up the flutter environment as the documentation says you have to set a topic to subscribe for that notification. Here inline 50 in main.dart file, I have subscribed to a topic called 'News' which is the topic which I need to push messages in the cloud function. Then in your cloud functions, you have to send the message like following. First, create a separate function which can send push notifications. Here also you need to set the same