firebase-notifications

Firebase onTokenRefresh() is not called

不羁的心 提交于 2019-11-26 08:15:13
问题 In my MainActivity in my log, I can see the token using FirebaseInstanceId.getInstance().getToken() and it display the generated token. But it seems like in my MyFirebaseInstanceIDService where it is extends to FirebaseInstanceIdService , the onTokenRefresh() is not called, where in this function it was said that the token is initially generated here. I needed to call sendRegistrationToServer() that\'s why I\'m trying to know why it doesn\'t go in the onTokenRefresh() . Here is my code public

How do you send a Firebase Notification to all devices via CURL?

南楼画角 提交于 2019-11-26 06:19:43
问题 I\'m attempting to send out a notification to all app users (on Android), essentially duplicating what happens when a notification is sent via the Firebase admin console. Here is the CURL command I begin with: curl --insecure --header \"Authorization: key=AIzaSyBidmyauthkeyisfineL-6NcJxj-1JUvEM\" --header \"Content-Type:application/json\" -d \"{\\\"notification\\\":{\\\"title\\\":\\\"note-Title\\\",\\\"body\\\":\\\"note-Body\\\"}}\" https://fcm.googleapis.com/fcm/send Here\'s that JSON parsed

FCM Schedule delivery date or time of push notification

六月ゝ 毕业季﹏ 提交于 2019-11-26 03:40:47
问题 I have working with FCM console to send push notification and it has an option to schedule the delivery date. But in the references, this API is not documented as an option. I need to know if its possible to push a notification with predefined delivery date through a POST request. 回答1: If you're looking for a public API of FCM for a scheduled push or a payload parameter where you can set the push date, unfortunately, there's nothing like it as of the moment. You must implement your own App

Firebase FCM notifications click_action payload

試著忘記壹切 提交于 2019-11-26 03:07:21
问题 I am trying to open a particular activity when the user clicks the notification when the app is in the background. From the Docs, I have got that click_action has to be added in the payload and an intent filter in the App to handle it. But, how to add click_action in the Firebase Notifications via Firebase Console? I am open to any other Work Around too. Thanks in Advance. 回答1: If your app is in background, Firebase will not trigger onMessageReceived(). Why.....? I have no idea. In this

Open app on firebase notification received (FCM)

一个人想着一个人 提交于 2019-11-26 02:08:10
问题 I want to open application automatically when notification is received, is this possible with Firebase and new FCM notifications? I know I can set click_action but that\'s only for customizing which activity will start on notification click, I need something that will start automatically when notification is received. I tried the quick start messaging firebase sample and there is a onMessageReceived() method but it only works if the app is in foreground. Is there something that will execute

What is FCM token in Firebase?

坚强是说给别人听的谎言 提交于 2019-11-26 01:16:38
问题 In the new Firebase, under Notification, they have mentioned that developer can send notification to a particular device. For that, in console it asks for an FCM token. What is it exactly and how can I get that token? 回答1: What is it exactly? An FCM Token, or much commonly known as a registrationToken like in google-cloud-messaging. As described in the GCM FCM docs: An ID issued by the GCM connection servers to the client app that allows it to receive messages. Note that registration tokens

Android app not receiving Firebase Notification when app is stopped from multi-task tray

跟風遠走 提交于 2019-11-25 21:46:08
问题 I have read a similar question on SO, however, I was not able to get the correct answer from it. I have a system wherein we send notification to around 500 devices. Unfortunately, many of these devices are not receiving the notification. I have found that OPPO F1 series phones are particularly not getting the notification. I have observed that this occurs if the app is stopped from multi-task tray. How do I resolve this? Update: I have observed that when I close the app from task-tray, my app