diff --git a/docs/sdks/quickstart/ios.mdx b/docs/sdks/quickstart/ios.mdx index 96f28a148a..0c9b71827b 100644 --- a/docs/sdks/quickstart/ios.mdx +++ b/docs/sdks/quickstart/ios.mdx @@ -48,7 +48,81 @@ BOOL success = [OIMManager.manager initSDKWithConfig:config ``` -### 4. 登录 +### 4. 设置监听器 + +#### 方式一 +```swift +// 会话相关监听 +- (void)setConversationListenerWithOnSyncServerStart:(OIMVoidCallback)onSyncServerStart + onSyncServerFinish:(OIMVoidCallback)onSyncServerFinish + onSyncServerFailed:(OIMVoidCallback)onSyncServerFailed + onConversationChanged:(OIMConversationsInfoCallback)onConversationChanged + onNewConversation:(OIMConversationsInfoCallback)onNewConversation + onTotalUnreadMessageCountChanged:(OIMNumberCallback)onTotalUnreadMessageCountChanged; + +// 好友关系链相关监听 +- (void)setFriendListenerWithOnBlackAdded:(OIMBlackInfoCallback)onBlackAdded + onBlackDeleted:(OIMBlackInfoCallback)onBlackDeleted + onFriendApplicationAccepted:(OIMFriendApplicationCallback)onFriendApplicationAccepted + onFriendApplicationAdded:(OIMFriendApplicationCallback)onFriendApplicationAdded + onFriendApplicationDeleted:(OIMFriendApplicationCallback)onFriendApplicationDeleted + onFriendApplicationRejected:(OIMFriendApplicationCallback)onFriendApplicationRejected + onFriendInfoChanged:(OIMFriendInfoCallback)onFriendInfoChanged + onFriendAdded:(OIMFriendInfoCallback)onFriendAdded + onFriendDeleted:(OIMFriendInfoCallback)onFriendDeleted; + +// 群组相关监听 +- (void)setGroupListenerWithOnGroupInfoChanged:(OIMGroupInfoCallback)onGroupInfoChanged + onJoinedGroupAdded:(OIMGroupInfoCallback)onJoinedGroupAdded + onJoinedGroupDeleted:(OIMGroupInfoCallback)onJoinedGroupDeleted + onGroupMemberAdded:(OIMGroupMemberInfoCallback)onGroupMemberAdded + onGroupMemberDeleted:(OIMGroupMemberInfoCallback)onGroupMemberDeleted + onGroupMemberInfoChanged:(OIMGroupMemberInfoCallback)onGroupMemberInfoChanged + onGroupApplicationAdded:(OIMGroupApplicationCallback)onGroupApplicationAdded + onGroupApplicationDeleted:(OIMGroupApplicationCallback)onGroupApplicationDeleted + onGroupApplicationAccepted:(OIMGroupApplicationCallback)onGroupApplicationAccepted + onGroupApplicationRejected:(OIMGroupApplicationCallback)onGroupApplicationRejected + onGroupDismissed:(nullable OIMGroupInfoCallback)onGroupDismissed; + +// 消息相关监听 +- (void)setAdvancedMsgListenerWithOnRecvMessageRevoked:(OIMRevokedCallback)onRecvMessageRevoked + onRecvC2CReadReceipt:(OIMReceiptCallback)onRecvC2CReadReceipt + onRecvGroupReadReceipt:(OIMReceiptCallback)onRecvGroupReadReceipt + onRecvNewMessage:(OIMMessageInfoCallback)onRecvNewMessage; + +// 登录用户相关监听 +- (void)setSelfUserInfoUpdateListener:(OIMUserInfoCallback)onUserInfoUpdate; + +// 用户状态相关监听 +- (void)setUserListenerWithUserInfoUpdate:(nullable OIMUserInfoCallback)onUserInfoUpdate + onUserStatusChanged:(nullable OIMUserStatusInfoCallback)onUserStatusChanged; + +// 自定义业务相关监听 +- (void)setRecvCustomBusinessMessageListener:(OIMObjectCallback)onRecvCustomBusinessMessage; + +``` + +#### 方式二 + +```swift + +// 会话相关监听 +- (void)addConversationListener:(id)listener; +- (void)addIMSDKListener:(id)listener; +// 好友关系链相关监听 +- (void)addFriendListener:(id)listener; +// 群组相关监听 +- (void)addGroupListener:(id)listener; +// 消息相关监听 +- (void)addAdvancedMsgListener:(id)listener; +// 用户相关监听 +- (void)addUserListener:(id)listener; +// 自定义业务相关监听 +- (void)addCustomBusinessListener:(id)listener; + +``` + +### 5. 登录 ```swift [OIMManager.manager login:@""