[OneSignal Notification Plugin] how to get all players id of all registred users

[OneSignal Notification Plugin] how to get all players id of all registred users

  
Forge Component
(5)
Published on 2016-12-14 by Alexandre Costa
5 votes
Published on 2016-12-14 by Alexandre Costa

Hi 

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




thanks

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

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.