Klat
  • TalkPlus SDK
  • Android
    • Getting Started
    • Callback
    • User
      • Create User / Login
      • Update User Information
      • Block / Unblock
      • Logout
      • Delete User
    • Channel
      • Create / Delete Channel
      • View Channel
      • Updating Channel
      • Viewing Channel LIst
      • Manage Channel Members
      • Join / Leave Channel
      • Messaging
      • Hide / Show Channel
      • Freeze / Unfreeze Channel
      • Transfer Channel Ownership
      • Channel Push Notification Settings
      • Channel Member Data
    • Push Notification
    • Sample Application
    • What's New
  • iOS
    • Getting Started
    • Callback
    • User
      • Create / Login
      • Update User Information
      • Block / Unblock
      • Logout
      • Delete User
    • Channel
      • Create / Delete Channel
      • View Channel
      • Updating Channel
      • View Channel List
      • Manage Channel Members
      • Join / Leave Channel
      • Messaging
      • Hide / Show Channel
      • Freeze / Unfreeze Channel
      • Transfer Channel Ownership
      • Channel Push Notification Settings
      • Channel Member Data
    • Push Notification
    • Sample Application
    • What's New
  • Unity
    • Getting Started
    • Callback
    • User
      • Create User / Login
      • Update User Information
      • Block / Unblock
      • Logout
      • Delete User
    • Channel
      • Create / Delete Channel
      • View Channel
      • Updating Channel
      • View Channel List
      • Manage Channel Members
      • Join / Leave Channel
      • Messaging
      • Hide / Show Channel
      • Freeze / Unfreeze Channel
      • Transfer Channel Ownership
      • Channel Push Notification Settings
      • Channel Member Data
    • Push Notification
    • Sample Application
  • JavaScript
    • Getting Started
    • Realtime Event
    • Pagination
    • User
      • Create User / Login
      • Update User Information
      • Block / Unblock
      • Logout
      • Delete
    • Channel
      • Create / Delete Channel
      • View Channel
      • Updating Channel
      • View Channel List
      • Manage Channel Members
      • Join / Leave Channel
      • Messaging
      • Hide / Show Channel
      • Freeze / Unfreeze Channel
      • Transfer Channel Ownership
      • Channel Push Notification Settings
      • Channel Member Data
    • Push Notification (FCM)
    • Sample Application
    • What's New
  • Flutter
    • Getting Started
    • Callback
    • User
      • Create User / Login
      • Update User Information
      • Block / Unblock
      • Logout
      • Delete User
    • Channel
      • Create Channel
      • View Channel
      • Updating Channel
      • View Channel List
      • Manage Channel Members
      • Join / Leave Channel
      • Messaging
      • Hide / Show Channel
      • Freeze / Unfreeze Channel
      • Transfer Channel Ownership
      • Channel Push Notification Settings
      • Channel Member Data
    • Push Notification (FCM)
  • REST API
    • Getting Started
    • API
      • Users
        • Create User
        • Login (using login token)
        • View User
        • Update User
        • Activate / Deactivate
        • Enable / Disable Push Notification
        • Delete User
        • View Users
        • View Channels
        • Block / Unblock
      • Channel
        • Create Channel
        • View Channel
        • Update Channel
        • Delete Channel
        • View Channel List
        • Manage Channel Members
        • Messaging
        • Hide / Show Channel
        • Channel Freeze / Unfreeze
        • Transfer Channel Ownership
        • Channel Push Notification Settings
      • Bot
        • Create Bot
        • View Bot List
        • View Bot
        • Update Bot
        • Delete Bot
        • View Joined Channel List
        • Messaging
        • Join / Leave Channel
    • Push Notification
    • Rate Limit
  • MISC
    • Webhooks
    • SDK Rate Limit
    • Error Code
    • FAQ
      • Function
      • Spec
Powered by GitBook
On this page
  • 1. Invite Users
  • 2. Remove Members
  • 3. Get Channel Member List
  • 4. Ban Users
  • 5. Unban Users
  • 6. Mute Members
  • 7. Unmute Members
  • 8. Peer Mute
  • 9. Peer Unmute
  • 10. Get Peer Muted List
  1. iOS
  2. Channel

Manage Channel Members

1. Invite Users

You can invite members to the channel even if you are not the owner.

Any member can add another member to channel.

[[TalkPlus sharedInstance] addMemberToChannel:channel 
    userIds:userIds 
    success:^(TPChannel *tpChannel) {
    // SUCCESS
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
TalkPlus.sharedInstance()?.addMember(to: channel,
                                     userIds: userIds,
                                     success: { tpChannel in
  // SUCCESS
}, failure: { (errorCode, error) in
  // FAILURE
})

2. Remove Members

Only the channel owner can remove members.

[[TalkPlus sharedInstance] removeMemberToChannel:channel 
    userIds:userIds 
    success:^(TPChannel *tpChannel) {
    // SUCCESS
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
TalkPlus.sharedInstance()?.removeMember(to: channel,
                                     userIds: userIds,
                                     success: { tpChannel in
  // SUCCESS
}, failure: { (errorCode, error) in
  // FAILURE
})

3. Get Channel Member List

For super channel, this is the only way to get channel members.

[[TalkPlus sharedInstance] getChannelMembers:tpChannel 
    lastUser:lastUser 
    success:^(NSArray<TPMember *> *tpUsers, BOOL hasNext) {
  // SUCCESS
  // If 'hasNext' is YES, call this method with the last object in 'tpUsers'.
} failure:^(int errorCode, NSError *error) {
  // FAILURE
}];
TalkPlus.sharedInstance()?.getChannelMembers(tpChannel,
  last: lastUser,
  success: { tpMembers, hasNext in
  // SUCCESS
  // If 'hasNext' is true, call this method with the last object in 'tpMembers'.
}, failure: { (errorCode, error) in
  // FAILURE
})

4. Ban Users

  • Only the channel owner can ban users.

  • Banned users are immediately removed from the channel and cannot join the channel until unbanned by the channel owner.

[[TalkPlus sharedInstance] banMemberToChannel:channel 
    userIds:userIds 
    success:^(TPChannel *tpChannel) {
    // SUCCESS
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
TalkPlus.sharedInstance()?.banMember(to: channel,
                                     userIds: userIds,
                                     success: { tpChannel in
  // SUCCESS
}, failure: { (errorCode, error) in
  // FAILURE
})

5. Unban Users

Only the channel owner can unban users.

[[TalkPlus sharedInstance] unBanMemberToChannel:channel 
    userIds:userIds 
    success:^(TPChannel *tpChannel) {
    // SUCCESS
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
TalkPlus.sharedInstance()?.unBanMember(to: channel,
                                     userIds: userIds,
                                     success: { tpChannel in
  // SUCCESS
}, failure: { (errorCode, error) in
  // FAILURE
})

6. Mute Members

Mute feature allows the channel owner to mute specific members in the channel. Muted members are not allowed to send messages.

  • Only the channel owner can mute other members.

  • expireInMinutes specifies when mute status is expired. Default value for expireInMinutes is 0 (no expiry).

[[TalkPlus sharedInstance] muteMemberToChannel:channel 
    userIds:userIds 
    expireInMinutes:expireInMinutes
    success:^(TPChannel *tpChannel) {
    // SUCCESS
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
TalkPlus.sharedInstance()?.muteMember(to: channel,
                                     userIds: userIds,
                                     expireInMinutes: expireInMinutes,
                                     success: { tpChannel in
  // SUCCESS
}, failure: { (errorCode, error) in
  // FAILURE
})

7. Unmute Members

Only the channel owner can unmute other members.

[[TalkPlus sharedInstance] unMuteMemberToChannel:channel 
    userIds:userIds 
    success:^(TPChannel *tpChannel) {
    // SUCCESS
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
TalkPlus.sharedInstance()?.unMuteMember(to: channel,
                                     userIds: userIds,
                                     success: { tpChannel in
  // SUCCESS
}, failure: { (errorCode, error) in
  // FAILURE
})

8. Peer Mute

You can mute another member in the channel.

  • Any user can 'peer mute' another member in the channel.

  • If you 'peer mute' another member, you will stop seeing messages from that particular member in the channel but other users will continue to see messages from that member in the channel.

  • There is no push notification or event handler for this event.

  • expireInMinutes allows you to control when 'peer mute' status expires. Default value for expireInMinutes is 0 (no expiry).

[TalkPlus.sharedInstance mutePeerToChannel:channel
        userIds:@[userId]
        expireInMinutes:0
        success:^(TPChannel *tpChannel, NSArray<TPMember *> *mutedPeers) {
   // SUCCESS (returns muted members)
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
TalkPlus.sharedInstance()?.mutePeer(to: channel,
                                    userIds: [userId],
                                    expireInMinutes: 0,
                                    success: { channel, mutedPeers in
   // SUCCESS (returns muted members)                                      
},failure: { errorCode, error in
    // FAILURE
})

9. Peer Unmute

There is no push notification or event handler for this event.

[TalkPlus.sharedInstance unMutePeerToChannel:channel
        userIds:@[userId]
        success:^(TPChannel *tpChannel, NSArray<TPMember *> *unMutedPeers) {
   // SUCCESS (returns unmuted members)
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
TalkPlus.sharedInstance()?.unMutePeer(to: channel,
                                     userIds: [userId],
                                     success: { tpChannel, unMutedPeers in
   // SUCCESS (returns unmuted members)
}, failure: { (errorCode, error) in
  // FAILURE
})

10. Get Peer Muted List

[TalkPlus.sharedInstance getMutedPeers:channel
    lastUser:lastUser
    success:^(NSArray<TPMember *> *mutedPeers, hasNext) {
    // SUCCESS 
    // If 'hasNext' is YES, call this method with the last object in 'mutedPeers'.         
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
TalkPlus.sharedInstance()?.getMutedPeers(channel,
    lastUser: lastUser,
    success: { mutedPeers, hasNext in
    // SUCCESS
    // If 'hasNext' is true, call this method with the last object in 'mutedPeers'.                                           
}, failure: { errorCode, error in
    // FAILURE
})
PreviousView Channel ListNextJoin / Leave Channel

Last updated 11 months ago