Conversations do not store nicknames and profile photos. Therefore, the SDK needs to obtain them from user profiles or group profiles saved in the local storage and use them in conversations. For a one-to-one conversation, the SDK obtains and uses the other user's nickname and profile photo. For a group conversation, the SDK obtains and uses the group name and group profile photo. To keep local user profiles and group profiles up-to-date, the latest SDK version has the following optimizations:
Ono-to-one chats:
getFriendsInfo
API to get strangers' profiles and update them locally.In summary, the SDK will ensure that the nicknames and profile photos in conversations with friends are up-to-date. While with strangers, the SDK cannot guarantee that and you need to actively pull the nicknames and profile photos if needed.
Group chats:
In summary, the SDK will ensure that the nicknames and profile photos in conversations are up-to-date for groups you have joined, but not for groups that you haven't joined or have left.
Note:
- The change of user profiles or group profiles do not trigger conversation update. Therefore, the nicknames and profile photos in a conversation will not be updated until the next conversation operation is performed (such as actively obtaining the conversation, marking the conversation as read, and sending/receiving messages).
- There is no relationship chain between you and a stranger. If the stranger's profile is changed, the backend will not send notifications, and the stranger's local profile will not be updated. It will be updated only when you actively pull the stranger's profile.
Messages store nicknames and profile photos. In order to keep the nicknames and profile photos of messages up-to-date, the latest SDK version has the following optimizations:
In summary, the SDK will ensure that the nicknames and profile photos of new messages are up-to-date, but not those of historical messages. The nicknames and profile photos of historical messages will be updated only when the senders' profiles exist in the local storage.
According to the above description, the latest SDK version has a lot of optimizations regarding nickname and profile photo. If you encounter any nickname and profile photo issues, please first upgrade your SDK to the latest version and check whether the issues are solved. If not, please see the following FAQs:
The change of nicknames and profile photos do not trigger conversation update. Therefore, the nickname and profile photo in a conversation will not be updated until the next conversation operation is performed (such as actively obtaining the conversation, marking the conversation as read, and sending/receiving messages). However, you can listen for friend or group profile update notifications to update the nicknames and profile photos in conversations.
There is no relationship chain between you and a stranger. If the stranger's profile is changed, the backend will not send notifications, and the stranger's local profile will not be updated. It will be updated only when you actively pull the stranger's profile or receive a message from the stranger. The message will carry the stranger's latest nickname and profile photo, and the SDK will update them locally after receiving the message.
Please refer to optimization 2 in Nickname and Profile Photo Update in the Message List. If the local storage does not have the senders' profiles, the nicknames and profile photos of historical messages won't be updated. They will be updated only when you actively pull the senders' profiles.
Conversation update and message sending/receiving are both frequent events. Synchronizing user profiles every time will cause huge pressure on the client and backend, seriously affecting application performance. We don't recommend that you actively pull user profiles in both cases, because it also affects application performance. The recommended approach is to pull user profiles when users click on the profile photos of messages.
Was this page helpful?