firebase-cloud-messaging

App malfunctioning when firebase notification pops up

ぐ巨炮叔叔 提交于 2019-12-31 05:45:07
问题 I am trying to send notifications to devices when they receive messages from their friends. But if they are about to receive the pop up, the app automatically goes to the homepage before the message even shows. I just don't get it. The messages are both data and notification types. I just can't tell where the error is from. Please help. Below is my code. JS code. exports.sendNotification8 = functions.database.ref('/Users/{user_id}/Notifications/{notifications_id}') .onWrite((change,context) =

How to generate firebase registration token

守給你的承諾、 提交于 2019-12-31 04:45:10
问题 I am trying to generate firebase registration token with new method but unable to generate this is my code below: MyFirebaseInstanceIdService.java public class MyFirebaseInstanceIdService extends FirebaseMessagingService { @Override public void onNewToken(String s) { super.onNewToken(s); FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener(new OnSuccessListener<InstanceIdResult>() { @Override public void onSuccess(InstanceIdResult instanceIdResult) { String token =

Time it takes for a project (Firebase and Cloud) to be completely deleted with its SHA1 key credentials?

点点圈 提交于 2019-12-31 04:11:15
问题 I deleted my project from Firebase console and from Google cloud console. After deleting the projects, when I am trying to connect Firebase in my Android app, I am getting this error Firebase No clients were able to be added to your Firebase project for the following reasons: An app with this package name and SHA1 is already connected to a Google project. If you have used a Google API previously, please select that project in the Connect to an existing project list. Client Package Name: com

how to display message of push notification from firebase cloud messaging on textview android

烈酒焚心 提交于 2019-12-31 03:51:11
问题 I have implemented firebase cloud messaging in my app. I have been receiving messages sent from server in my device as a push notification but I have not been able to display that message in the textview of the app. How do i do so ? Here is the code to handle onMessageReceived.. @Override public void onMessageReceived(RemoteMessage message) { String image = message.getNotification().getIcon(); title = message.getNotification().getTitle(); text = message.getNotification().getBody(); String

Firebase FCM get tokens for old iOS APNS tokens

喜夏-厌秋 提交于 2019-12-31 02:23:33
问题 With the change of GCM to FCM through Google, we are looking to bring our push notifications for iOS into FCM as well. Without providing an update, which would register each user to the Firebase push service, is it possible to subscribe all current users tokens to the firebase service, therefore generating FCM keys for them? 回答1: Yes, you can use the batchImport method of the InstanceID API to import a list of APNs tokens which will return a mapping of InstanceID tokens that you can then use

Firebase Google Cloud messaging from device to device

两盒软妹~` 提交于 2019-12-31 01:00:45
问题 I couldn't understand how can i send message from iOS device to another iOS device, and trying to understand the difference between Firebase Notifications and Google Cloud Messaging. Firebase Notifications say's from the server you can send a message to devices. Google Cloud Messaging: it sends messages from server to devices(downstream) or device to server(upstream) !! Example of upstream: [[FIRMessaging message]sendMessage:(nonnull NSDictionary *)message to:(nonnull NSString *)receiver

Android FCM failed to post notification on channel “my_channel_01”

非 Y 不嫁゛ 提交于 2019-12-30 11:03:39
问题 I am sending push notification message from Firebase console to my app running on emulator. The MyFirebaseMessagingService class looks like this: public class MyFirebaseMessagingService extends FirebaseMessagingService { private static final String TAG = MyFirebaseMessagingService.class.getSimpleName(); @Override public void onMessageReceived(RemoteMessage remoteMessage) { Log.d(TAG, "From: " + remoteMessage.getFrom()); if(remoteMessage.getData().size() > 0) { Log.d(TAG, "Message data payload

Android FCM failed to post notification on channel “my_channel_01”

拈花ヽ惹草 提交于 2019-12-30 11:03:22
问题 I am sending push notification message from Firebase console to my app running on emulator. The MyFirebaseMessagingService class looks like this: public class MyFirebaseMessagingService extends FirebaseMessagingService { private static final String TAG = MyFirebaseMessagingService.class.getSimpleName(); @Override public void onMessageReceived(RemoteMessage remoteMessage) { Log.d(TAG, "From: " + remoteMessage.getFrom()); if(remoteMessage.getData().size() > 0) { Log.d(TAG, "Message data payload

Using Data in Rich Push notification on iOS with FCM

六月ゝ 毕业季﹏ 提交于 2019-12-30 10:01:59
问题 My question might be bad, but I can't find any answer anywhere, I'm lost... So I want to display a rich notification with a nice image in iOS 10+. For this I'm using FCM and an UNNotificationServiceExtension which, if I understood correctly, should get the Data payload, find the image URL and load it before modifying the UNNotificationContent. The issue I have is that I can't get a hold of this "data". What I'm sending to FCM is the following : { "to": "device_token", "content_available":

Using Data in Rich Push notification on iOS with FCM

此生再无相见时 提交于 2019-12-30 10:01:08
问题 My question might be bad, but I can't find any answer anywhere, I'm lost... So I want to display a rich notification with a nice image in iOS 10+. For this I'm using FCM and an UNNotificationServiceExtension which, if I understood correctly, should get the Data payload, find the image URL and load it before modifying the UNNotificationContent. The issue I have is that I can't get a hold of this "data". What I'm sending to FCM is the following : { "to": "device_token", "content_available":