Group Firebase FCM on Android Device - android

I am trying to send cloud messages using the Firebase console. I am doing this for android device.
The push notifications do appear on the device fine along with the data sent with it.
But each notification shows up on its own. Meaning if I send 3 notifications three items show up in the notification bar.
What I want to achieve is that all the notifications to be grouped under one heading. As you have in WhatsApp or Facebook.
How can this be achieved using the Firebase Console?

By grouping the notification, do you mean stacking or bundling notifications?
If so, this is actually depends on how you handle notifications in your client app. You simply have to make use of the setGroup() to add all your notifications to a single group then calling notify() to let the NotificationManager of the changes.
This Add Each Notification to a Group documentation pretty much sums it all up.

Related

Can I set the "Difference push receive setting in firebase?"

I am now trying to make a mobile app push notification service on Firebase. But the function description is not quite specific as I expected.
I want to know these functions are available on Firebase. If not, It would be pleasure If you tell me other tool.
User can select the push message types they want to receive.(Ex. Receive sale information push, Do not receive game event push)
Instantly send auto push messages when user triggered certain condition.(Ex. Send appreciate push message when user closed their first app-open)
Thank you
Can not tell in much description here:
1. User can select the push message types they want to receive.(Ex.
Receive sale information push, Do not receive game event push)
You can use FCM's channeling feature,
You can set different channels.
Show the list of channels to user.
User can subscribe to the required channel.
User will receive the specific channel notification only.
Please refer : Notification Channel
2. Instantly send auto push messages when user triggered certain condition.(Ex. Send appreciate push message when user closed their first app-open)
You have manage this thing in your front end and backend logic.
Like on app close send request to the backend (can use onDestroy method )server and then the backend server will send notification.
Hope this will help you.
For Feature 1:
You can achieve this without even doing anything. Just send all notifications to everyone. However, use different Notification Channels. Users, can then choose to turn on/off certain notification channels using the Android system features (in relatively newer versions of android).
Another way could be to send these notifications to different FCM Topics. Give the users a settings pages, where there can select what kinds of notifications they would like to receive. In response to their selections, subscribe or unsubscribe them to the respective FCM Topic.
For Feature 2:
There could be several hundred ways of doing this. Can provide better advice if you could provide more information about your requirement.
If you talk about your example requirement
(Send appreciate push message when user closed their first app-open)
You can do it without any server, or push messaging scheme. Just keep track of the first_open event inside the app using Shared Preferences. Once you detect a first_open event, just compose a notification inside of the app locally, and show it whenever you like.

Sending notification to multiple devices without using subscribeToTopic in firebase

I know how to send notification to single user and multiple users by using subscribeToTopic ("all"), but how can I send Notification to a group of people according to my wish
To solve this, use Cloud Functions for sending notifications. You can send a notification to a single user or to a group of users according to your needs. I've exaplained the entire flow for doing this in my answer from this post. So a notification can be sent, even if the user has not opened the app. He will receive the notification every time something interesting happens.

Is it possible to target multiple apps with firebase, but only one will display the notification

I am new with FCM and I am still discovering its possibilities.
I wonder if it is the right tools to do what I want:
I would like to send a notification to all my users, to inform them about new informations for example.
The difficulty is that I want to target all the users of different apps (like 10 apps), and some of them may have more than one of my app installed.
So I do not want a user to have the same notification displayed multiple times (if he installed more than one of my app).
Is it something possible with Firebase?
Thank you
Yes you can! To achieve this, i recomand you using Google Cloud Messaging not FCM. which it's an earlier version. Here is a tutorial on how you can migrate from FCM to GCM.
To achieve this, all your 10 apps must use Firebase and all your users must be Firebase registered users. To send a notification to all devices, would mean then to select all the registration ids from that database, add them in an array and pass them further to GCM.
Note also, that strating with GCM 3.0 it's now possible to send a notification to all devices thanks to topics support. The app must suscribe to one or more topics and the server can send notifications to that topic without specifying individual devices. You can see here Topic Messaging.
Unfortunately, there is no way in which, with a single line of code, to send a notification to all of your users from all your apps. You can only send a notification to all your users that belong only to a single app. If you want that all of yours to get the same message, then you need to consider sending that particular message again, to all users that belong to each app. In this case, if a users is using more then one of your apps, will receieve that message for each app separately.

How to customize push notifications in Bluemix

I'm trying to configure NodeRED to send notifications to the Android apps on devices of a specific user and people who are registered as his family in the logic. I have never dealt with push notifications and I don't know what to look for so steps or even keywords to look up is appreciated.
It depends. Generally you can now see flows of your notification service. In the Node-RED flow editor, double-click the notification node to open the Edit function node dialog box. You should edit the payload object to customize the message notification.
Here there is an example that could be useful for you http://www.ibm.com/developerworks/library/wa-nodered-push-app/
I suggest using tags to group this 'family' of users together. After creating the tag, you will need some logic on the Android side to identify if the user is part of that family. If they are, you can subscribe them to the appropriate tag, then you can send a notification to all subscribers of that tag with one REST call. See the Bluemix doc Enabling tag-based notifications for more info.
As a general note, you can also send notifications to single users if you have their device ID. The device ID is included in the response after registering with the Push Notifications service and should be saved somewhere if you plan on using it for very specific push notifications. Something to consider, let me know if this helps.

android: sending a push notification using GCM to all the devices instead of only 1000

Hi i'm developing a news android app, and i want to send a push notification to all the registered devices, but apparently Google said in their tutorials that you can send a push notification to up to 1000 users. but this is very frustrating and i know apps that send push notifications to all their users.
I'm very confused about this and i have been looking for a solution for three days now, is there a clear way to send a push notification to all app-registered devices or not ?
Thanks in advance.
If you are planning on sending out push notifications in large quantities and to large user groups you should consider using a back-end service to simplify your life. Parse is one option. You can send push notifications to all of your users or even send out custom notifications based on certain conditions. You can find more information here:
https://parse.com/tutorials/android-push-notifications
There is no limit in sending the notification to the number of user.
GCM allows us to attach a message to 1000 users at a time. This doesn't mean there is a limit to the gcm notification
Refer this
http://developer.android.com/training/cloudsync/gcm.html#multicast

Categories

Resources