Use this file to discover all available pages before exploring further.
Responsible for managing recent conversation data, such as: adding recent conversations, deleting recent conversations, unread message counts, etc.This documentation only covers core methods. For more details, check the [WKSDK shared].conversationManager interface in the code.
Trigger timing: After establishing connection, SDK actively triggers pulling recent conversations after going offlineIncrementally sync recent conversation data after going offline:
// version Data version number// lastMsgSeqs Concatenated recent conversation seq relationship data// callback SDK should call this callback when getting messages from server (Note: callback must be called regardless of success or failure)[[WKSDK shared].conversationManager setSyncConversationProviderAndAck:^(long long version, NSString * _Nonnull lastMsgSeqs, WKSyncConversationCallback _Nonnull callback) { // Implement your server API call here // Example: [YourAPIManager syncConversations:version lastMsgSeqs:lastMsgSeqs success:^(NSArray<WKConversation*> *conversations, long long newVersion) { callback(conversations, newVersion, nil); } failure:^(NSError *error) { callback(nil, version, error); }];} ack:^(uint64_t cmdVersion, void (^ _Nullable complete)(NSError * _Nullable)) { // If ack receipt is not needed, directly call complete(nil); complete(nil);}];
Through recent conversation extension properties, you can customize your unique business attributes, such as implementing draft functionality similar to WeChat, with draft data synchronized across multiple devices.
Any data changes to recent conversation objects will trigger the WKConversationManagerDelegate delegate. Similarly, calling updateOrAddExtra will also trigger this delegate.
Trigger timing: Triggered when calling [[WKSDK shared].conversationManager syncExtra]
// version Latest extension data version existing on client// callback Callback data to SDK after syncing extensions[[WKSDK shared].conversationManager setSyncConversationExtraProvider:^(long long version, WKSyncConversationExtraCallback _Nonnull callback) { // Implement your server API call here // Example: [YourAPIManager syncConversationExtras:version success:^(NSArray<WKConversationExtra*> *extras, long long newVersion) { callback(extras, newVersion, nil); } failure:^(NSError *error) { callback(nil, version, error); }];}];