Posts

Showing posts with the label flutter

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 ...

How to fix FirebaseApp with name [DEFAULT] doesn't exist issue with flutter

Image
How to fix FirebaseApp with name [DEFAULT] doesn't exist issue with flutter This is a very common issue when we try to google authenticate our app with flutter. Please check the following are done in your app. Updated the android build.gradle file Updated the android\app build.gradle file Added dependency to pubspec.yaml Placed the google-services.json file Check Updated the android build.gradle file Add the following line to the android/build.gradle file please add the following line to that file. classpath 'com.google.gms:google-services:4.3.2' // Google Services plugin Check Updated the android\app build.gradle file Add following line to the following location apply plugin : 'com.google.gms.google-services' Check Added dependency to pubspec.yaml firebase_auth : ^0.14.0+5 google_sign_in : ^4.0.7 Placed the google-services.json file make sure you have added google-services.json from the firebase...