firebase-cloud-messaging

Don't invoke push notification when app is being used (running in foreground)

こ雲淡風輕ζ 提交于 2019-12-24 23:23:44
问题 In my android app, I receive push notifications via Firebase Cloud Messaging. The notifications work completely fine, the only problem is that I don't want to receive notifications when the app is running. When the user is using the ap, I am already displaying the notification internally so the push notification is redundant and annoying. Below is the code on how I invoke push notification: @Override public void onMessageReceived(RemoteMessage remoteMessage) { NotificationCompat.Builder

cannot get nativescript-plugin-firebase demo-push app to work

对着背影说爱祢 提交于 2019-12-24 20:53:45
问题 Can anyone help me install the nativescript-plugin-firebase Push-demo application. I could not manage to install and make it work. So please is there a guidance step by step for beginners? This is the demo link: https://github.com/EddyVerbruggen/nativescript-plugin-firebase/tree/master/demo-push @Eddy Verbruggen: Your help will be appraciated Regards 来源: https://stackoverflow.com/questions/52890502/cannot-get-nativescript-plugin-firebase-demo-push-app-to-work

ionic iOS FCM works in development mode but does not work in production

若如初见. 提交于 2019-12-24 19:28:51
问题 I'm using: Xcode10 Legacy build Phonegap-plugin-push 1.10.5 I followed https://github.com/aggarwalankush/push-notification-server (notification server) and https://github.com/aggarwalankush/ionic-push-base (ionic app) I have set up FCM using https://medium.com/@ankushaggarwal/gcm-setup-for-android-push-notifications-656cfdd8adbd. I have also set up the .p12 certificate for both production and development and have targeted the production certificate in my notification server. Once my app was

Send push message using Firebase Cloud Messaging (What is my Server Key?)

99封情书 提交于 2019-12-24 19:14:57
问题 What exactly is Server Key? I used (on a pitcure above) server key, and legacy server key but neither of them work. Does anybody have clue what is wrong? For token -> I used FCM token I got from firebase messaging like this: firestoreMessaging.getToken() 来源: https://stackoverflow.com/questions/56723045/send-push-message-using-firebase-cloud-messaging-what-is-my-server-key

Firebase Cloud Messaging: Accessing UI elements in onMessageReceived()

泄露秘密 提交于 2019-12-24 19:06:05
问题 In my android app, I use firebase cloud messaging to send some data to app. When the app receives a message through onMessageReceived() , I check whether a MainActivity is currently visible ( MainActivity has a static reference to the currently visible MainActivity ), and if the activity is visible, I make some modifications to the activity. Since onMessageReceived() is not called in the main thread, I use a Handler to execute the code in the main thread. @Override public void

How to get FCM notification data when app is not in task or killed?

时光总嘲笑我的痴心妄想 提交于 2019-12-24 18:45:48
问题 I need to get data from FCM notifications in android and store them locally, but the problem is I am only able to do that when app is in foreground and then onMessageRecieved is called or when user taps on notification. I want to get notification's data when user gets notification and app is not running, not even in background or foreground. Please suggest something. Thank you in advance. 回答1: You can use BroadcastReceiver public class FirebaseDataReceiver extends BroadcastReceiver { private

firebase subscribeToTopic OnCompleteListener is not getting called

北城余情 提交于 2019-12-24 18:33:50
问题 I am working on an android project in which user will subscribe to a Firebase topic. I have written code like below. FirebaseMessaging.getInstance().subscribeToTopic("update") .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (!task.isSuccessful()) { Log.d("SUBSCRIPTION","FAILURE"); }else{ Log.d("SUBSCRIPTION","SUCCESS"); } } }); But the problem is the onComplete method in the code is not at all called. It is not even

Invalid sender Id while getting device token

余生颓废 提交于 2019-12-24 18:22:19
问题 I am doing Firebase cloud messaging setup in my Android App. I am not doing it first time.I have done it many times. But this time I am getting a strange error "Invalid Sender ID" while trying to get device token.I have never used any Sender Id in My Project ever except Project number which is by default present in google-services.json file.Please help me out of this .I am using this method to generate token.I have added google-services.json file in my Project FirebaseInstanceId.getInstance()

Incoming rich push notifications won't show the image. Swift 4

此生再无相见时 提交于 2019-12-24 13:02:23
问题 I'm trying to implement rich push notifications but I don't get the image at passed url to get displayed. When I open the notification I can only see title, subtitle and body. I'm following the tutorial at https://www.pluralsight.com/guides/creating-ios-rich-push-notifications as I found it suggested in other posts but I'm stuck at showing the image. I also read in one post that I shouldn't run the app but the NotificationExtension but when I do the app crashes when receiving the notification

Incoming rich push notifications won't show the image. Swift 4

≡放荡痞女 提交于 2019-12-24 12:55:08
问题 I'm trying to implement rich push notifications but I don't get the image at passed url to get displayed. When I open the notification I can only see title, subtitle and body. I'm following the tutorial at https://www.pluralsight.com/guides/creating-ios-rich-push-notifications as I found it suggested in other posts but I'm stuck at showing the image. I also read in one post that I shouldn't run the app but the NotificationExtension but when I do the app crashes when receiving the notification