firebase-notifications

Unable to insert record into SQLite Database from Firebase Message Service when app is in background or closed state

三世轮回 提交于 2019-12-01 21:53:32
I am trying out Firebase Notifications. I was able to get the Notification to work properly using this documentation. The message was received and I was able to send a notification to the Notification Bar from within the MyFirebaseMessagingService service class. This happens even when the app is in background or closed. What I need is to collect the data sent in the notification and insert it into an SQLite database. The code I wrote works fine if the app is in foreground, but it does not work if it is closed or in background. Here is what I wrote for the insert. DbHelper dbh=new DbHelper(this

How to know “topic” name from Firebase notification on iOS

懵懂的女人 提交于 2019-12-01 17:00:57
I'm trying to use Firebase in my iOS application. I successfully integrated it and receiving notifications from all 3 Targets (user segment, topic and single device). My question is how to know a particular notification is received from which topic? I'm following this documentation and this github page EDIT: I'm testing on iOS11.2 (XCode9.2) & my response (userInfo) is: { aps = { alert = test; sound = default; }; "gcm.message_id" = "0:1513282329413512%38894e8e28894e8e"; "gcm.n.e" = 1; "gcm.notification.sound2" = default; "google.c.a.c_id" = 1542306492273623048; "google.c.a.c_l" = test; "google

Is it possible to get push notification stats like count of deliveries and opens when sending messages through Firebase notification API?

一笑奈何 提交于 2019-12-01 13:15:11
We are about to switch to Firebase notifiaction API from Parse.com (that are retiring their service in jan 2017) to send push notification to our android and iOS Apps. My question now is that I can't see any statistics about counts of successful deliveries and opens in the Firebase Console for a specific message ? The only thing we get when posting to https://fcm.googleapis.com/fcm/send is a message_id {"message_id":123456789} But I havn't seen any documentation on a api how to follow up a sent message with this message_id . And the Firebase console has only the these kind of stats for

Does a notification message count towards the collapse_key limit?

落爺英雄遲暮 提交于 2019-12-01 12:15:40
As per the Firebase Notification docs : Notification messages are always collapsible. I was trying to figure out if they have some intrinsic collapse_key . And if so, does that count towards the collapse_key limit of 4 per device? You are correct. All the notifications sent from the Web Console are collapsible. Which means they have an implicit collapse_key If a device has a pending-to-be-delivered messages from the Web Console, this implicit collapse_key counts towards the limit of 4 per device. 来源: https://stackoverflow.com/questions/39655543/does-a-notification-message-count-towards-the

Parse Nested JSON Array from Notification Data using Gson in Android

不羁的心 提交于 2019-12-01 12:11:49
问题 I am getting data in JSON format from FCM notification. It has different format based on notification types as below: Format 1: accept_request: { "alert": "Accept Request By driver", "title": "Accept Request By driver", "booking_id": "247", "notification_type": "accept_request" } Format 2: end_request: { "alert": "End trip By driver", "title": "End trip By driver", "booking_id": "247", "notification_type": "end_request", "servicesList": [ { "service_id": "1", "service_name": "Services1",

Firebase sending multiple push notifications instead of stacking or replacing

早过忘川 提交于 2019-12-01 05:20:59
I am trying to have a previous push notification stack with the new one or replace it in the system tray for android. I am not sure how to do this as the push notification is sending back both data and notification objects, and from what I understand the notification goes directly to the system tray. If so how do I stop the notification from appearing independently. Some users would get 5-10 notifications and it would keep pushing up. EDIT: I tried collapse_key but it still does not replace prior notifications with the same key... am I doing it wrong somehow here? method: 'POST', uri: 'https:/

Firebase sending multiple push notifications instead of stacking or replacing

强颜欢笑 提交于 2019-12-01 03:21:41
问题 I am trying to have a previous push notification stack with the new one or replace it in the system tray for android. I am not sure how to do this as the push notification is sending back both data and notification objects, and from what I understand the notification goes directly to the system tray. If so how do I stop the notification from appearing independently. Some users would get 5-10 notifications and it would keep pushing up. EDIT: I tried collapse_key but it still does not replace

Android Firebase Messaging: How Update UI from onMessageReceived()

雨燕双飞 提交于 2019-12-01 00:52:27
I have successfully implemented Firebase messaging in my app. Works great in the background and onMessageReceived() gets called when the app is in the foreground (yippee!). The issue I have is that I need to update the UI dynamically and I am stuck on the best way to achieve this. I don't want to send the user an in-app notification (as the sample code shows), I'm not sure I want to send a broadcast, all I want to do is to access the MainActivity in order to call a method already there, however I have no reference to the MainActivity in the service. @Override public void onMessageReceived

Android Firebase Messaging: How Update UI from onMessageReceived()

穿精又带淫゛_ 提交于 2019-11-30 18:08:56
问题 I have successfully implemented Firebase messaging in my app. Works great in the background and onMessageReceived() gets called when the app is in the foreground (yippee!). The issue I have is that I need to update the UI dynamically and I am stuck on the best way to achieve this. I don't want to send the user an in-app notification (as the sample code shows), I'm not sure I want to send a broadcast, all I want to do is to access the MainActivity in order to call a method already there,

Handle the data payload without user tapping on the notification?

依然范特西╮ 提交于 2019-11-30 17:56:55
问题 When in the background, apps receive the notification payload in the notification tray, and only handle the data payload when the user taps on the notification. Is there any way to handle the data payload without user tapping on the notification? 回答1: Basing from the FCM docs on Handling Messages: App state Notification Data Both Foreground onMessageReceived onMessageReceived onMessageReceived Background System tray onMessageReceived Notification: system tray Data: in extras of the intent. It