Retrieve user's Nickname and Data in Photon Chat JavaScript/TypeScript SDK
Comments
-
Hi @rjkz808,
Unlike Photon Realtime (PUN, Photon Voice), Photon Chat does not have Nickname.
What "Data" field are you referring to? the one sent back in custom authentication?
That's probably not implemented or not exposed in the Photon Chat JavaScript SDK if not all Photon Chat SDKs.
How urgent is this?0 -
Hi! I need some custom properties to be stored for each user. For example, user's level in game. And I also need to update this properties. If user has just raised its level, it would be confusing that old messages are shown with the old level to other persons. How can I make this work within Photon Chat?
0 -
I also want to mention one thing - for now I just send some additional metadata as JSON string in the message content. Can this approach be considered correct for Photon Chat SDK?
0 -
Hi @rjkz808,
How can I make this work within Photon Chat?
Can this approach be considered correct for Photon Chat SDK?
You actually use the approach we suggest usually.
Photon Chat allows you to exchange anything serializable/supported by Photon.
So this approach is OK.
Another trick you could use to optimize and improve this:
Chat's online status feature allows a user to broadcast a custom message to all other users who have added him as a friend via AddFriends. This custom message could include the user's properties and other things. This could save some extra messages in chat channels. More information here.
0