Skip to content

Commit

Permalink
chore: Added steps to set up listeners.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brett committed Jan 3, 2024
1 parent 91ac8e0 commit ed2334e
Showing 1 changed file with 75 additions and 1 deletion.
76 changes: 75 additions & 1 deletion docs/sdks/quickstart/ios.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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<OIMConversationListener>)listener;
- (void)addIMSDKListener:(id<OIMSDKListener>)listener;
// 好友关系链相关监听
- (void)addFriendListener:(id<OIMFriendshipListener>)listener;
// 群组相关监听
- (void)addGroupListener:(id<OIMGroupListener>)listener;
// 消息相关监听
- (void)addAdvancedMsgListener:(id<OIMAdvancedMsgListener>)listener;
// 用户相关监听
- (void)addUserListener:(id<OIMUserListener>)listener;
// 自定义业务相关监听
- (void)addCustomBusinessListener:(id<OIMCustomBusinessListener>)listener;

```

### 5. 登录

```swift
[OIMManager.manager login:@""
Expand Down

0 comments on commit ed2334e

Please sign in to comment.