Support Topics Documentation Slack YouTube Blog

Get device registration id from another divice

Hello,
In my app, I find another device and it appears on the list. I want to get the registration ID of the selected device when I select that device in the list. In fact, I want to get another user’s device ID that is on my users list. How can I it?

Are you talking about table DeviceRegistration ?
If so look at the columns deviceToken and deviceId, they are related to specific device.
It also has relation column user. But you should consider that devices will be bound to the particular user only if the registration was made after user was logged in.

yes,
when i select one of the users from Users table, how can get deviceId form DeviceRegistration table?

You can use ‘where clause’ as for any other tables and select only records for specific object.

Hi @saeed_noshadi

You can retrieve all the user devices and then get their deviceIds

the whereClause will look like the fallowing

user = `USER_OBJECT_ID`

Regards, Vlad