322
Views
2
Comments
[OneSignal Notification Plugin] how to get all players id of all registred users
Question
onesignal-plugin
Mobile icon
Forge asset by Alexandre Costa

Hi 

Please provide me the solution to get playerid of all registred user 




thanks

UserImage.jpg
Alexander van Doorn

Hello Mohammed,

Inside the OneSignal API module I made a function myself that checks if the User has a device. I did this by using an aggregate to see if there are any devices linked to the specific UserID.

You could do sort of the same and create a function with an aggregate that retreives all the UserIDs for the devices that are registered.

I hope this helps.

Kind regards,

Alexander van Doorn

UserImage.jpg
Alexander van Doorn

Alexander van Doorn wrote:

Hello Mohammed,

Inside the OneSignal API module I made a function myself that checks if the User has a device. I did this by using an aggregate to see if there are any devices linked to the specific UserID.

You could do sort of the same and create a function with an aggregate that retreives all the UserIDs for the devices that are registered.

I hope this helps.

Kind regards,

Alexander van Doorn

I made the function myself because I could also use it.

This is what it looks like:

I append every User that is linked to a Device to my User List return value.

I haven't tested it with having linked a user to multiple devices but I guess it's just going to add the user anyway.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.