Get the Id (or the whole contact object) of the current log on user
RespondidaHello,
I need to compare the current user with his other contacts. How can I get the id (or the contact object) of the current log on user ?
-
Hi Nathanael,
As explained by Andrea, if you are using the SDK for Node.JS, you have access to the connected user information (current user) by checking the nodeSDK.connectedUser property.
Using the SDK for Web, you have an equivalent method rainbowSDK.contacts.getConnectedUser()
Same for the SDK for Android: RainbowSdk.instance().myProfile().getConnectedUser()
Could you precise what kind of SDK you use ?
Thanks
-
Hi,
here you can find a solution https://hub.openrainbow.com/#/documentation/doc/node/tutorials/Managing_contacts
-
Hi Patrice,
This API rainbowSDK.contacts.getAll() directly replies all known contacts.
(loaded/asked at SDK start and updated if needed)
It's a synchronous call, no need of an event.The existing event
RAINBOW_ONCONTACTINFORMATIONCHANGED
is fired if a contact is updated and for new contacts.Best regards,
Pascal
Por favor, entrar para comentar.
Comentários
7 comentários