firebase-cloud-messaging

FCM token not generating in Samsung devices in release version of app

一世执手 提交于 2021-02-08 07:19:14
问题 I am using FCM for sending notifications in my app. The first version of my app is in the testing phase and there is an error in Samsung devices because FCM token is not getting generated in these devices. Here is my code which generates the token: FirebaseInstanceId.getInstance().instanceId.addOnCompleteListener(OnCompleteListener { task -> if (!task.isSuccessful) { return@OnCompleteListener } // Get new Instance ID token val token = task.result?.token val ref = FirebaseDatabase.getInstance(

FCM token not generating in Samsung devices in release version of app

做~自己de王妃 提交于 2021-02-08 07:19:02
问题 I am using FCM for sending notifications in my app. The first version of my app is in the testing phase and there is an error in Samsung devices because FCM token is not getting generated in these devices. Here is my code which generates the token: FirebaseInstanceId.getInstance().instanceId.addOnCompleteListener(OnCompleteListener { task -> if (!task.isSuccessful) { return@OnCompleteListener } // Get new Instance ID token val token = task.result?.token val ref = FirebaseDatabase.getInstance(

Firebase Cloud Messaging function sendToDevice not working

走远了吗. 提交于 2021-02-08 05:24:42
问题 I'm using the following code to send a notification from one device to another using FCM. Everything works fine until before return admin.messaging().sendToDevice(...) . The 'Token ID: ' log displays token ID of the receiver, but when I set the variable token_id to the sendToDevice function, the notification is not called, therefore the notification is not sent. Can someone tell me what's wrong? 'use strict' const functions = require('firebase-functions'); const admin = require('firebase

start activity automatically after receiving fcm notification?

自古美人都是妖i 提交于 2021-02-07 21:50:03
问题 I want to start a specific activity automatically after receiving fcm push notification.it works fine with on clicking but I want to start it automatically after the notification is received.Here is my code My FirebaseMessagingService method where I am triggering the code public class MyFirebaseMessagingService extends FirebaseMessagingService { private static final String TAG = MyFirebaseMessagingService.class.getSimpleName(); private NotificationUtils notificationUtils; @Override public

start activity automatically after receiving fcm notification?

坚强是说给别人听的谎言 提交于 2021-02-07 21:49:19
问题 I want to start a specific activity automatically after receiving fcm push notification.it works fine with on clicking but I want to start it automatically after the notification is received.Here is my code My FirebaseMessagingService method where I am triggering the code public class MyFirebaseMessagingService extends FirebaseMessagingService { private static final String TAG = MyFirebaseMessagingService.class.getSimpleName(); private NotificationUtils notificationUtils; @Override public

Flutter - Firebase Messaging Snackbar not showing

半腔热情 提交于 2021-02-07 21:47:15
问题 This is the problem: notification is received by the app both with app in foreground or background (or terminated) but the snackbar for notification when the app is used doesn't work. I'm new in flutter so maybe I did some huge mistake. I am showing my code below. If you want more information just ask and thanks for the help! // Import Package import 'dart:io'; import 'package:app_gap_go/pages/admin/modifySingleMeeting.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import

How to send message to multiple android devices using FCM in Node js?

烈酒焚心 提交于 2021-02-07 19:49:37
问题 I tried sending message to single device i.e. to single Registration id and it worked fine but when tried to add multiple Registration Ids it gives 'InvalidServerResponse' error. e.g. Works for regTokens = 'regId1'; But doesn't work for regTokens = ['regId1','regId2']; var FCM = require('fcm-node'); // Add API Key var fcm = new FCM('<server-key>'); exports.sendMessage = function (regTokens, messageToSend, callback) { var message = { //this may vary according to the message type (single

flutter: fcm ios push notifications doesn't work in release mode

浪尽此生 提交于 2021-02-07 13:00:55
问题 I have bound my flutter-iOS app to firebase and i'm also using firebase-messaging and cloud functions for sending notifications via subscribing to topics, i'm using the APNs push notifications key of apple developer account. when i use the option runner>flutter run main.dart in release mode to build my app on my phone, fcm notifications doesn't work anymore, while it works in development mode, anyone can help me fix this? this is my index.json code: const functions = require('firebase

flutter: fcm ios push notifications doesn't work in release mode

雨燕双飞 提交于 2021-02-07 12:57:59
问题 I have bound my flutter-iOS app to firebase and i'm also using firebase-messaging and cloud functions for sending notifications via subscribing to topics, i'm using the APNs push notifications key of apple developer account. when i use the option runner>flutter run main.dart in release mode to build my app on my phone, fcm notifications doesn't work anymore, while it works in development mode, anyone can help me fix this? this is my index.json code: const functions = require('firebase

FCM Notification onclick does not open desired activity

試著忘記壹切 提交于 2021-02-07 10:39:13
问题 i have tried almost every solution posted here and combination of every flag but it is not working. Following are use cases in which i am having problems. 1) When i am in application FCM notification opens my desired activity. Data is passed to onNewIntent in main activity. It works fine when application is foreground. 2) When in background mode(presssing home button) after clicking on notification it launches new instance of my application even though i have specified android:launchMode=