First off, welcome to the community! Hopefully you find it very useful as you make your journey with SendBird.
The documentation does mention that its best practice to add these items on creation, however looking at the
SendBird.d.ts, it does’t look like any method for updating or creating the user supports anything more than
It looks like once you are able to add those discovery keys via a custom method you’ll need to create with the platform API, then you can use the
uploadFriendDiscoveries() method to discover friends.
Yes, that’s what even I noticed. Currently, I have done that workaround by using axios to create user and then using js sdk calls in the rest of the places of my project.
Also, I noticed one more thing. If we use platform API to query users, we get discovery_key of users along with their data. However, that is not the case with js sdk.
Yeah, that’s why I posted here, if someone would comprehend the same. Will contact them.
The user creation and update is recommended to be done by platform API in secure setting, which requires creation of access tokens or session tokens. The discovery key is only available through Friends interface through SDK for privacy protection.
Can you please provide sample or any reference for the same? I am not getting discovery_key in getUser neither am I receiving any event in UserEventHandler after calling uploadFriendDiscoveries.
Have you registered
UserEventHandler? If so, are you receiving any callback when calling
Additionally, have you updated users with discovery_keys via the platform API?
Yes Tyler, I have done both. While creating user, I am using platform api to add discovery_keys. I have also registered uploadFrinedDiscoveries() but I am not receiving callback. I have exactly followed this guide:
Thanks for verifying that. I’ll do some testing on my end and see if I can get it to work. I’ll let you know what I find.
Just wanted to let you know I haven’t forgotten about you. Unfortunately I had something come up at work which has had me sidetracked. I hope to be able to get a working example for you this week.
@Tyler Thanks but if you have other priorities please take those up as we have now decided to implement 1-1 group channel rather than showing friends list and chat.