firebase-cloud-messaging

Firebase Cloud Messaging and C# server side code

纵然是瞬间 提交于 2020-01-13 11:44:34
问题 I am using FCM in my Android and iOS app. The client side code is working correctly because from the Firebase console I can send notifications to both platforms with out any problem. With my C# code I can send notifications successfully to android devices but the notifications never appear on iPhone unless directly coming from the Firebase notification console. I don't know what gives. C# server-side code try { var applicationID = "application_id"; var senderId = "sender_id"; string deviceId

Android Firebase Push notification not working when application is killed

蓝咒 提交于 2020-01-13 06:28:10
问题 I have created android application to receive push notification from server but it is not working. When app is in foreground, it works perfectly. But when we force close app from system tray it does not work. Below is my json code which I send to FCM. {"to":"\/topics\/global","data":{"title":"Title","body":"Body"}} Below is my android function public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); Log.d("Msg", "Message received ["+remoteMessage+"]

FCM onMessageReceived Returns blank message and title when the app is running

时光总嘲笑我的痴心妄想 提交于 2020-01-13 02:14:46
问题 As you wrote in the title , when the application is closed it's working well and the onMessageReceived gets the message body and the title but if the app is in the foreground mode (running mode) the notifications can be sent but without message and title ! What to do please ? The Code : @Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); String title = remoteMessage.getData().get("title"); String message = remoteMessage.getData().get(

Implement a read receipt feature in Firebase group messaging app

為{幸葍}努か 提交于 2020-01-11 19:52:28
问题 I'd like to implement a 'Seen' feature in my Firebase group messaging app. Can you kindly advise the best and most efficient approach to take (working code will be appreciated)? For example, the app would show " Seen by 6 " or " Seen by 15 " on a group message. Here's my project: https://github.com/firebase/friendlychat/tree/master/android Here's the MainActivity: https://github.com/firebase/friendlychat/blob/master/android/app/src/main/java/com/google/firebase/codelab/friendlychat

Xamarin Forms Android not receiving Push notifications when closed

为君一笑 提交于 2020-01-11 11:19:09
问题 I am following this walkthrough for creating push notifications into a Xamarin forms app https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-android-push-notification-google-fcm-get-started I have successfully integrated with NotificationHub and can receive test messages on the device when app is in focus or in background I cannot, however, manage to make the app wake in order to receive messages, which is the main reason for having notifications There are a great many

Handle onMessageReceived() and onTokenRefresh() even if the app is not running

微笑、不失礼 提交于 2020-01-11 09:21:55
问题 I have an app with 2 services : MessagingService extends FirebaseMessagingService and InstanceIDService extends FirebaseInstanceIdService There are declared in the AndroidManifest.xml file. The problem is that when my app's process is forced close itself, the services are also killed. I'd like them not to be killed. I've heard about the START_STICKY flag for the Service class, but I can't override the onStartCommand() method in these services so as to return this flag... 回答1: To answer to the

Not receiving any notification from FCM Firebase cloud messaging when application is swiped from recent application list in OnePlus 3 [duplicate]

爷,独闯天下 提交于 2020-01-10 03:04:30
问题 This question already has answers here : Android app not receiving Firebase Notification when app is stopped from multi-task tray (6 answers) Closed 2 years ago . I'm using OnePlus 3 (7.1.1) There is one problem of not receiving notification when application is swiped from recent task (becomes dead) and then after if I push a notification from Firebase console, it won't receive any notification. Any solution? Same bugs are on with vivo, oppo, huwai, xiomi, redimi, MI And the same code works

Not receiving any notification from FCM Firebase cloud messaging when application is swiped from recent application list in OnePlus 3 [duplicate]

泄露秘密 提交于 2020-01-10 03:04:11
问题 This question already has answers here : Android app not receiving Firebase Notification when app is stopped from multi-task tray (6 answers) Closed 2 years ago . I'm using OnePlus 3 (7.1.1) There is one problem of not receiving notification when application is swiped from recent task (becomes dead) and then after if I push a notification from Firebase console, it won't receive any notification. Any solution? Same bugs are on with vivo, oppo, huwai, xiomi, redimi, MI And the same code works

Switching between different firebase projects (runtime) in one single APK file

倾然丶 夕夏残阳落幕 提交于 2020-01-10 02:11:08
问题 We are integrating firebase messaging in our android application for push notifications. We are going to use SNS from server side to send push message to firebase. Below is our use case: We have three servers: QA, STG and PRODUCTION We created say three projects in firebase console: say appQA, appSTG and appProd But we want to generate only 1 single APK which can receive firebase push notification from any of the above three fire base projects depending on the server to which our user logs-in

Android - Firebase Notification not opening targeted activity when app is in background but working properly in foreground

亡梦爱人 提交于 2020-01-07 04:48:27
问题 I have tried some solution from the stackoverflow . But not working properly in my case. Below is my MyFirebaseMessagingService class which extends FirebaseMessagingService public class MyFirebaseMessagingService extends FirebaseMessagingService { String url , title , body ; Map<String,String> data = new HashMap<>(); @Override public void onMessageReceived(RemoteMessage remoteMessage) { title = remoteMessage.getNotification().getTitle(); body = remoteMessage.getNotification().getBody(); if