skip to Main Content

Firebase Function deployment fail

This firebase function which triggers firebase messaging fails due to unknown error import * as functions from "firebase-functions"; import * as admin from "firebase-admin"; const messaging = admin.messaging(); export const sendChatNotification = functions.firestore.document('chats/{chatId}/messages/{messageId}').onCreate(async (snapshot) => { const message = {…

VIEW QUESTION

I'm using firebase messaging in my flutter app but when I run my project it show Stringtoken=FirebaseInstanceId.getInstance().getToken(senderId, "*");

I'm using firebase messaging in my flutter app but when I run my project it show String token = FirebaseInstanceId.getInstance().getToken(senderId, "*"); when I run my application it shows this error in the console: C:UserscerbiAppDataLocalPubCachehostedpub.dartlang.orgfirebase_messaging-9.1.4androidsrcmainjavaioflutterpluginsfirebasemessagingFlutterFirebaseMessagingPlugin.java:166: error: cannot find symbol String token…

VIEW QUESTION

Firebase messaging onMessageOpenedApp

I am sending notification with firebase, when click on notification I want to redirect to a page in webview, how can I do that? FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessagemessage) { Navigator.push( context, MaterialPageRoute( builder: (context) => , )); });

VIEW QUESTION

Flutter firebase messaging doesn't get notifications from firebase functions

Firebase functions: const functions = require("firebase-functions"); const admin = require('firebase-admin'); admin.initializeApp(); exports.chatNotifications = functions.firestore.document("chat/{docId}").onCreate( (snapshot, context) => { admin.messaging().sendToTopic( "chat", { notification: {title: "New message", body: "A new message has been sent"}, data: {click_action: "FLUTTER_NOTIFICATION_CLICK"}, } ); } ); Flutter:…

VIEW QUESTION
Back To Top
Search