Browser push notifications per user - push-notification

Is it possible to limit push notifications to only one user per browser profile? Right now we have multiple users who use the same computer by signing in/out. I don't want user A to see any notifications from user B and vise versa.

Related

How to unlink a device in Firebase notification if a user is no longer connected

I understand that Firebase can detect if a user uninstalls an app from a device and will thus mark that device UID as no longer linked and notify us when we decide to send a notification to that device.
But my question is what can i do when i user logs out or decides to log in with a different login, as far as firebase is concerned it will have 2 users that will get notifications on that device? I could be wrong and Firebase notification will notice that 2 users are connected to the same device on the same app and mark all other device UIDs as no longer linked and remove them? Is this a correct assumption?
I just want to avoid sending notifications to an app that is no longer linked to a particular user.
Can someone tell me where i can go to read more about how Firebase Notifications are actually handled?
Thanks

Send FCM Push notification to device within specific radius

I want to to send push notification manually to devices around a specific location. I don't want to send a notification every time the device enters the radius, just once.
Is there a way to do this?
There is nothing built into Firebase Cloud Messaging to send a message to devices that enter a specific area for the first time. That sort of specific requirement is up to you to build, on top of FCM and other APIs.
You'll need to have a background process that checks the user's location. Once you have that, you can send it to FCM. But also consider why you need FCM here in the first place, as you could also show a local notification in that case when the user first enters the area.

Flutter - push firebase notifications to specific users without firebase auth

I am working with Firebase to push notifications and I don't use Firebase authentication on my app (I have my own system).
I didn't find an answer to this question:
Is it possible to push notifications to a specific user with firebase without Firebase authentication (and therefore, without a UID)? How?
The push notifications are not sent based on user, they are sent based on push notification token that is received when you register for push notifications (iOS & Android).
The push notification token will change in the case of uninstall/install and has nothing to do with what user is logged in in the app, you can send push notifications to apps that don't have users at all.
In order to target a specific user with push notification, you must do something called user segmentation, that is, filter user based on particular properties of these users. In general user segmentation is done by tracking user action and user properties and depends on the push notification platform in use. For example you can track user actions in the app, like user added product to cart, user has x products in cart and then send a push notification to all users that have more than 3 products in cart.
All the push notifications platform link the push notification token to the events triggered.
If you are using firebase, the most easiest way is to track user properties, there are a lot of tutorials on this part. Although, in my opinion, firebase tracking is kind of crappy.
One thing to note, since the push notification token is not linked to the user directly, in case there are two users (two accounts) using the same device they, they will receive push notifications on the same device, so don't send sensitive information via push notifications.

Worklight send push notifications without username

I want to create an application which have 2 modes: non-logged-in and logged-in (having username).
I want to send push notifications to devices in both modes. The non-logged-in devices should receive notifications such as general announcements, new events, etc. The logged-in mode devices will also receive same notifications and few more.
Now what I want to do is to subscribe the device to receive notifications for non-logged-in mode then once the user logs in to his account from that device I want to unsubscribe the previous non-logged-in notifications.
I've read the answer to this question : Worklight: Push notification without User ID I think that I can play with onUserSubscribe callback when registering the user and unsubscribe the userId of the persistent cookie.
Is this a good idea ? Is there another suggestion ?
My thinking is that you could register an app to 2 event sources.
The first event source will handle the general notifications that an app should receive, whether a user is logged-in or not.
The second event source will handle the notifications for logged-in users.
When the app launches, subscribe to the first event source.
When the user decides to log-in, subscribe to the second event.
You should allow the user to unsubscribe from both if s/he so chooses, as well.
Additional information:
IBM Worklight 6.1 Information Center: search for "push notifications"
Push Notifications training module
So what you're trying to achieve is push notifications broadcast (send to all users). This is something that you'll be able to do with upcoming Worklight 6.2 release. You will not have to subscribe users according to username, but will be able to specify tags during subscription. And after that you'll be able to send push notifications according to this tags.

Push notification IOS/Android

I am writing back end for mobile app, we are sending pushes (something like one user add
another to buddies) he should accept it or decline via push notification(it is required), server got some feedback from notification, and do something.
I am familiar with two techniques about pushes, first I push directly on device using token, second is abstraction when user subscribes for channel and I send push notification on this channel. Id in my application is email, and I suggest to update device token in the database each time user login, and send push on it, but how should I identify device OS ?(IOS/Android)
1) How to scale it, if user have multiple devices, and when user will logout, and login from other device ?
May be there is common solutions for this problem.

Resources