OneSignal - Send Notification to all devices of some users - push-notification

I'm developing an app/website where the user has to be logged in, so I can identify them via email. In the app the user can register for push-notifications about different topics. I'm filtering the target-users via OneSignal's tag feature.
Since a user can be logged in with one account on multiple devices, the notifications should be sent to all of the user's devices.
Is there any way to do this?
Update:
I found some information on the following link:
https://documentation.onesignal.com/docs/internal-database-crm
But I would honestly prefer a solution, which doesn't require storing all the playerIds in my database.

Related

What is the best way to make persistent in-app notifications with Firebase?

I learned how to use push notifications at Firebase. It works. As the next step, I want to add persistent in-app notifications, similar to Stackoverflow, Facebook, Instagram, etc
Currently we're using at Firestore and Real-Time database.
We have several use cases:
Users' content is viewed
Users receive a message from another user
Some system update about a new feature
Where should we keep these notification messages? Should it be in the same place where all original messages are stored? Or should each user have notification collections? Or are there some other ways to solve it?
I found a lot of stuff about push notifications, but I can't find anything how to handle regular persistent notifications.

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.

How to implement Firebase Invites in my Android application?

I want to implement the Firebase Invite Feature, where a user can send a link which is unique to his/her friends and whenever the other receiver installs the app using this link my application recognize it and act accordingly.
Now I have searched quite a while about Firebase invite and I came to know that you can send the link only via email and android messages. However, I want the user to send via any other social networking app.
What approach should be followed while implementing this?
Firebase Invites is a UI layer to send dynamic links to other users through email. If you want to send the links with another service, you can create them directly using Firebase Dynamic Links.

Send Firebase Cloud Messaging notification to users by user property

I'm trying to send out an FCM message to a specific set of users (or really, a single user) based on a specific user property but looking through the FCM HTTP API I can't seem to find a way to do that. I can send to users via topics, registration tokens, and device group notification keys, but I don't have any of that infrastructure set up in the near term. I know this functionality exists as you can send such a message via the UI, but I'm not seeing how to do it in the API documentation as yet.
There is currently no parameter that you could use to specify a user property (or even for user segments) that will serve as a target for the FCM API to send the message to.
As you've already searched, the only targets possible are single/multiple registration tokens (to and registration_ids), topics, conditions, and device groups (notification_key).
The option you're looking for is currently only available when using the Notifications Console.

[OneSignal][Unity] Create ID after login

I am running into a small issue in my unity app after adding the OneSignal plugin. I can receive push notifications if I send them from the web server and everything is fast. However, my concern is that OneSignal assigns one ID to the device not to the user.
My question is: there is any way to create an ID after my login?
The only problem in the actual state is if the user has multiple accounts or if a friend connects from that device. Both users would have the same ID and therefore both would receive the same notifications.
Thanks.
I would recommend using OneSignal.SendTag in your app to tag the user with your userId when they login. Then when they logout call OneSiganl.DeleteTag to remove it.
This will allow you to send a notification with the tags field on the OneSignal create notification REST API POST call.

Resources