firebase-cloud-messaging

Firebase cloud messaging onMessage not triggered in React app even after message is sent

拈花ヽ惹草 提交于 2020-02-24 14:59:06
问题 I am testing out the Firebase Cloud Messaging function in my React app which was bootstrapped with create-react-app. Note that I have already intialized firebase (including admin SDK on server-side) properly and my client side is deployed on https. What I did so far was to: Initialize firebase messaging in firebase.js, and also request for notification permission and listen out for onMessage event const messaging = firebase.messaging(); messaging .requestPermission() .then(() => { console.log

Google FCM Server: 200 but no notification sent to phone

a 夏天 提交于 2020-02-21 18:25:13
问题 I am working via Postman to send a FCM push notification to my phone that already has the app installed. I have push notifications enabled, the app is on the background, and I have a valid (confirmed) Firebase push token. I'm POSTing to https://fcm.googleapis.com/fcm/send with the headers (Authorization: key=APP_SERVER_KEY, Content-Type: application/json), and my body looks like: { "notification": { "title": "Portugal vs. Denmark", "text": "5 to 1" }, "to": MY_PUSH_TOKEN } I'm getting the

Firebase messaging/mismatched-credential

空扰寡人 提交于 2020-02-20 07:26:36
问题 I'm trying to send notifications to a specific device with Firebase but am getting the following error: {"r": {"results":[{"error":{"code":"messaging/mismatched-credential","message":"The credential used to authenticate this SDK does not have permission to send messages to the device corresponding to the provided registration token. Make sure the credential and registration token both belong to the same Firebase project."}}],"canonicalRegistrationTokenCount":0,"failureCount":1,"successCount"

Firebase scheduled notification in android

会有一股神秘感。 提交于 2020-02-14 13:23:47
问题 I'm developing an android app using firebase, this app should push notifications twice a day by hours user should set in app settings. I saw a similar question was asked at least 2 years ago, but no answer, maybe now there is an option to do it. Is there anyway I can achieve this using Firebase ? If no, how can I achieve it ? 回答1: You can schedule sending notifications from the Firebase console. But that is limited to notifications you manually enter. There is no way to schedule "twice a day"

Firebase scheduled notification in android

社会主义新天地 提交于 2020-02-14 13:23:26
问题 I'm developing an android app using firebase, this app should push notifications twice a day by hours user should set in app settings. I saw a similar question was asked at least 2 years ago, but no answer, maybe now there is an option to do it. Is there anyway I can achieve this using Firebase ? If no, how can I achieve it ? 回答1: You can schedule sending notifications from the Firebase console. But that is limited to notifications you manually enter. There is no way to schedule "twice a day"

How to get data from firebase-message while android app is in background

喜夏-厌秋 提交于 2020-02-07 07:23:09
问题 I'm sending firebase-messages using the firebase-console. The messages shall contain additional data like shown below with the purpose to open a specific url within a webview in my app: I set up my manifest and firebase class to get the messages. Within my firebase class i try to get the data: @Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); Intent intent = new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY

FCM returning MismatchSenderId

╄→гoц情女王★ 提交于 2020-02-05 20:35:13
问题 I think I have completed every step necessary to convert my messaging app from GCM to FCM but it is not working. FCM is currently returing MismatchSenderId. I have the following services defined in my AndroidManifest.xml . <service android:name=".MyFcmListenerService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> <service android:name=".MyFirebaseInstanceIDService"> <intent-filter> <action android:name="com.google.firebase.INSTANCE

FCM returning MismatchSenderId

前提是你 提交于 2020-02-05 20:32:07
问题 I think I have completed every step necessary to convert my messaging app from GCM to FCM but it is not working. FCM is currently returing MismatchSenderId. I have the following services defined in my AndroidManifest.xml . <service android:name=".MyFcmListenerService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> <service android:name=".MyFirebaseInstanceIDService"> <intent-filter> <action android:name="com.google.firebase.INSTANCE

How to set notification channel when sending messages via rest api?

痞子三分冷 提交于 2020-02-03 08:44:05
问题 I've been implementing Notification Channels in my android app to support recent android versions. You can set the notification channel id when sending messages from the firebase web console, but I was not able to find out how to set the channel id when sending messages via fcm rest api. Notification channels are not mentioned in the reference (https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages), but I am pretty sure there must be a way to set the channel id. 回答1: The

Firebase - Swift 4: Message sent but not received

我只是一个虾纸丫 提交于 2020-02-02 14:38:48
问题 Ran pod update on the terminal to update my firebase. However i don't receive FCM's This is my app delegate code: import UIKit import Firebase import FirebaseFirestore import StoreKit import UserNotifications @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate, MessagingDelegate { var window: UIWindow? override init() { super.init() FirebaseApp.configure() // not really needed unless you really need it FIRDatabase.database()