firebase-cloud-messaging

Why does firebase push_token return Blacklisted?

血红的双手。 提交于 2019-12-20 09:55:21
问题 I am implementing Firebase messaging in my app. While I am testing the app sends the refreshed_token to my database, but in live production environment (Play store) it returns 'BLACKLISTED' as push_token. Does someone know why this happen? Or what I can do to fix this problem. Can't find others with the same problem. I use the code from the Firebase documentation. @Override public void onTokenRefresh() { super.onTokenRefresh(); String refreshedToken = FirebaseInstanceId.getInstance().getToken

When does a FCM token expire?

余生长醉 提交于 2019-12-20 09:49:37
问题 When do FCM tokens expire? Is it at 6 months? 回答1: It doesn't expire though. It renews itself if one of the following happens. According to https://firebase.google.com/docs/cloud-messaging/android/client: -The app deletes Instance ID -The app is restored on a new device -The user uninstalls/reinstall the app -The user clears app data. Monitor token generation The onTokenRefreshcallback fires whenever a new token is generated, so calling getToken in its context ensures that you are accessing a

Java Server — send Push with POST to google Firebase Cloud

梦想的初衷 提交于 2019-12-20 07:14:39
问题 After I tested the push notifications are working with Postman I'd like to send a push request to FCM when I am sending a message in my app. The function called is going to my Java server and call a function like : @POST @Consumes(MediaType.APPLICATION_JSON) public Response sendMsg(Message m) throws ExceptionFacade { ... } So each time I call this function I'd like to send a POST request to https://fcm.googleapis.com/fcm/send with a json. I want to know if there is already a code ready for a

Firebase token management in servers

守給你的承諾、 提交于 2019-12-20 07:13:19
问题 I still new with firebase and android notifications. I want to be able to send notifications to a single user based on some rules. What I've been reading so far is that a token can be generated with: FirebaseInstanceId.getInstance().getToken() Then, the token will need to be refreshed at some point when it expires. How to I set expiry for these tokens, if at all possible? If there are a thousand users having their tokens refreshed around the same time then I will need to do a thousand writes

C# Send notification to device group with unique custom data FCM

风流意气都作罢 提交于 2019-12-20 05:39:29
问题 I am aware that I can supply registration_ids to the JSON request to send to multiple devices in the form of string arrays. However, I have a unique token that I want to send to each of those registration_ids . How can I achieve that without simply looping the send request for the number of devices I wish to send to: registration_ids: [1,2,3,4,5] data: { //if id==1, include the necessary token I wish to include. } 回答1: Unfortunately, if you are attempting to send something unique to each user

FIrebase Cloud Messaging, cannot resolve dependency com.google.firebase:firebase-core:9.0.2

若如初见. 提交于 2019-12-20 05:12:08
问题 I was trying to write an application using Firebase Cloud Messaging as per the guidelines given here, but I'm struck in adding the dependency for implementing FCM (com.google.firebase:firebase-core:9.0.2). Every time I try to add it via project structure, it won't list the dependency in the search results. When I try to add it in app level gradle, it gives me an error that the dependency cannot be resolved. I don't know where I'm going wrong but please help me out with this. 回答1: Download

FCM receive message Issue

谁说胖子不能爱 提交于 2019-12-20 04:25:24
问题 I'm integrating FCM to my project. But I'm getting below error in Log while notification received. (Error text color is blue) W/FirebaseMessaging: Received message with unknown type: text My code is like this: public void onMessageReceived(RemoteMessage remoteMessage) { Log.d("Notification", "Success"); sendNotification(remoteMessage); } In this code, the first line is not executing and it is not debugging also. 回答1: Finally I got the solution In php side I'm sending "message_type":"text"

Firebase Notifications - Invalid reg token, please check token format in Android

青春壹個敷衍的年華 提交于 2019-12-20 03:19:11
问题 ![enter image description here][1] If I send push message by selecting a package from Firebase console, the push goes to all devices, but during sending to individual device, it displays the error: Invalid reg token,please check token format Error Snapshot: [ ][1] 回答1: UserID in console is not the registration token for Firebase messaging. By Firebase docs: on initial startup of your app, the FCM SDK generates a registration token for the client app instance. If you want to target single

How to send a POST request to Firebase Cloud Messaging API in Vapor

感情迁移 提交于 2019-12-20 02:44:10
问题 I am trying to make a POST request to a Firebase Notifications API using Vapor 1.5 and Firebase Legacy Protocol, but I get failure response. response is JSON(node: Node.Node.object(["multicast_id": Node.Node.number(5936281277445399934), "failure": Node.Node.number(0), "canonical_ids": Node.Node.number(0), "results": Node.Node.array([Node.Node.object(["message_id": Node.Node.string("0:1527074314969790%c7ade8b9f9fd7ecd")])]), "success": Node.Node.number(1)])) EDIT Making the request through

Getting errors trying to add Firebase project from Android Studio

时光毁灭记忆、已成空白 提交于 2019-12-20 02:39:18
问题 I want to add Firebase to my project via Android Studio by going to Tools > Firebase > authentication > Email and Password Authentication > Connect to Firebase. A dialog pops up, I choose create new Firebase Project and I get the following error, even though I have a fully working internet connection: Firebase: Connect to Firebase failed. Please check your internet connection and try again. If errors persist, you can connect manually at https://console.firebase.google.com Project creation was