In Firebase Cloud Messaging, where can I see the list of users/devices who have registered for push? - firebase

I’m testing Firebase Cloud Messaging with iOS.
Every time I send out a test notification to the app on my iPhone, the number in the screenshot increases, even if it’s the same device.
Anyone know where I can see this list of users? Would preferrably like to manage these, force remove them etc.

The tooltip says Estimate based on approximately xxxx users who are registered to receive notifications. Some targeted users will not see the message due to device inactivity. For recurring campaigns, estimate is for initial send only.
I don't believe you can see that list of registered users anywhere.

Related

Swift - FireStore/FCM (Firebase Cloud Messaging)

I've incorporated Firebase Cloud Messaging into my app. After messing around, I kind of understood the premise of how it operates. So, as a result, I structured my code so that when users sign up the FCM token is stored. After creating two accounts, I realise both FCM tokens for the user were the same.
Looked online and sorted this issue, and now I can refresh the token on launch, and still append the new FCM token when users initially sign up.
So now, I ask the question - Users are created with a fcmToken field (which I can refer to in my code), however, due to the fact a new token is generated on launch each time does this render the token(s) stored for each user useless? Or can I still push to the specific user using the fcmToken?
I've looked online, but can't seem to find an answer.
FCM tokens don't uniquely identify an individual end user. They identify a specific installation of an app on a specific device. When sending with that token, it doesn't matter who is signed in to the app (or if anyone is signed in at all) - the app will still receive it and need to figure out what to do with it. It's up to you to decide what to do with that message, given the sign-in state of the user. If you expect that your app could have multiple users sharing a single app on a single device, then you will probably want to send something in the payload to determine who that message was intended for, if necessary.
#doug great answer, but there's a common implementation problem when people share a device, so please add a warning, something like: often only the last logged in user should receive push notifications, otherwise he could see messages from the person who was logged in before. your backend should not only store all the devices a user is logged in, but also for each device who the last active user is and check this upon sending a push. the question whether you receive push or not when logged out is a common topic, too.

Does Ionic 2 support private & public Firebase notifications?

I'm thinking to work on firebase notifications in the last few days but I want to some answers for this few questions:
Does Ionic2 support firebase notifications ?
Will notification show in the top of screen when my application closed or it should be work in the background ?
Is firebase notification sent on time or it may take long time ?
If I assumed Ionic 2 can send private notifications (to my device only), so can I send public notification for all application users ?
If the answer of all questions "yes", wish you give me any useful links that may help me (if you have a time)
In addition to Gabriel's answer:
The default behavior for notifications is for it to show on the top part of the screen. I haven't worked on Ionic before, but AFAIK, the behavior should compared to Android.
With that said, you should refer to the Handling Messages part of the FCM docs.
There are factors to consider that may affect the time it takes for the device to receive a message, but as FCM's behavior, it would try it's best to send the message, as soon as feasible (see my answer here).
Gonna itemize this further:
Specific device only - Yup. When sending the message, just specify the registration token(s) that should recieve that message.
All devices - Yup. You could use the Firebase Notifications Console. But if you intend to send the message by using the REST API, you have to make sure that the devices are subscribed accordingly to your custom global topic.
About the device-to-device Gabriel mentioned, I think it should be worded as server to specific device(s).
Yes it does, and it works fine with FCM (Firebase Cloud Messaging, aka GCM - Google Cloud Messaging). It supports subscribing to topics and device-to-device notification via HTTP client. The topics subscriptions and device-to-device both require FCM plugin.
Yes, they'll appear on top of your device screen as any push notification, you'll just need to code how it'll behave after receiving it, like execute something if the notification is tapped, or do something if it's received and the app is already open (foreground), it's all up to you.
It's sent on time, i've never had delay problems, the longer it took to send the notification and i receive in my device was 10 seconds. But as far as i know it "stores" your notification for 24 hours, so if the servers go down or something happen the notification has a life time of 24 hours to be sent.
You can, as said in first answer, subscribe your users to topics. Let's say you want a topic to sent message so all users can receive, you can have an all topic, or have one only for logged users, one only for users who bought products, you can even get all users tokens and send one by one, but it's much better having them subscribe to topics.
Topics notifications can be sent via the Firebase project console. Device-to-device is sent by your app code.
To send device-to-device you'll need a token, it's provided by the FCM plugin (link above) and you'll need to store this token somewhere, like in your user node on Firebase. I usualy use the user device ID provided by the Device plugin to have his token, since the user can have multiple devices and log in all then, this'll prevent token overriding.
I don't know good tutorials about configuring FCM with Firebase, if i find something i'll edit the question and add it for you, but stick to the ionic native link and the FCM plugin github page.
Hope this helps.

What are some restrictions that Google has to prevents a push notification from being shown to the user that we should know about?

What are some restrictions that Google has to prevents a push notification from being shown to the user that we should know about?
I tried sending 80K pushes at once, and Google either
Automatically revokes the push token or queues up the push and doesn’t display it to the user
i'm using FCM
There isn't any official documentation that states any mind of restrictions for the push notifications from FCM, other than the Message Payload size limit, the DeviceMessageRateExceeded error (kinda similar to Throttling, which AFAIK is no longer applied) possibly only for iOS, and TopicsMessageRateExceeded error to avoid spamming when sending to topics.
Other possibilities for a message not showing up could be because of the device(s) itself (see my answer here).

What is the best way to use firebase as an events broker?

I am writing a connected home device (alarm system) which can receive events/messages from a mobile device (e.g. a message to dismiss an alarm).
Example of a scenario (mobile device is an iphone for the sake of the example):
Connected device at home sounds alarm and notifies the iphone (using iOS push notifications, not firebase)
iphone user brings up the app, and clicks "dismiss"
connected device gets "dismiss" message and stops the alarm
I was thinking about using firebase's live database for this interaction, so the iphone app would set a db field, and the home device (which runs python) would subscribe to this field and see that it has been set.
The problem is that this is not a very clean implementation, as I would need the home device to turn off the dismiss field after it has received it, so that subsequent dismiss event can be recognized.
Essentially I am implementing messaging on top of a live database.
Is there a cleaner way to do this in firebase?
If not, is this a reasonable implementation?
Are there alternatives to firebase that take care of such a scenario?
What I really need is a web-based event-broker as-a-service...
I would suggest looking at https://github.com/firebase/firebase-queue
There are a few examples of usage on SO such as My Firebase Queue doesn't do anything after I changed to Firebase 3
Many of our developers are using Firebase with a server to perform tasks like background processing, integrating with third party APIs, or handling advanced authentication requirements. Today, we're introducing Firebase Queue, a fault-tolerant multi-worker job pipeline built on Firebase.
If you're writing your server code in Node, Firebase Queue makes it easy to handle background jobs with a worker queue. We're already using it in our private backups feature, where we reliably handle hundreds of jobs per day across multiple machines. ( https://firebase.googleblog.com/2015/05/introducing-firebase-queue_97.html )

sending ios push message without user action

I want to collect device attributes and send them to the mdm server using push notification.
Steps involved are:
create a configuration profile with mdm payload
get device token
use apple push notification service to send a notification to the device.
get back device attributes
do same with multiple devices which the company manages
Questions:
Will the user always need to act on a message or I can send a message onto the device without user action and get the work done?
Do I need an app on the device to send back the token?
It sounds like you're trying to use push notifications to poll iOS devices and return information.
Push notifications do not provide a mechanism to execute code on a device without user interaction. You would have to have an application loaded on the device, and the user would have to click through from the notification to your app.
In iOS, applications generally don't run unless the user is actively interacting with them. There are a few exceptions (e.g. background audio.)
You do need to have an app running to get the device token. You call registerForRemoteNotificationTypes. See APNs docs for more information.
Edited to add more information:
Looks like the MDM protocol uses push notifications to do just what you describe. However, there's nothing about it in Apple's "Local and Push Notification Programming Guide" (linked above).
Apparently Apple keeps tight control over the MDM documentation (see here and here).
However, I did find this paper from blackhat describing how the system works.
My earlier point about not executing arbitrary code on a device without user interaction still applies. There's a finite set of commands that can be executed (see Appendix A).
I came across this question when searching for iOS push notification access payload without user interaction - Just want to add that, in iOS 7 and above, it is possible to send silent push notifications to app, and app can process them without user interaction.
However, I've also found some discussions saying that the silent push notifications are not delivered reliably, in this SO post. That's why I'm still looking for alternate ways to retrieve payloads of the normal remote push notifications. Doesn't look like there's a way.

Resources