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. Get Public Channels
  • 2. Get Joined Channels
  • 3. Get Hidden Channels
  • 4. Get Total Unread Message Count
  • 5. Mark All Channels As Read
  • 6. Search Joined Channels
  • 7. Search Public Channels
  1. iOS
  2. Channel

View Channel List

1. Get Public Channels

You can view all public channels even if you are a not member.

The list is paginated, so to get to the next page, you can pass the last TPChannel from the previous list to get to the next page.

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

2. Get Joined Channels

View currently joined channels.

The list is paginated, so to get to the next page, you can pass the last TPChannel from the previous list to get to the next page.

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

3. Get Hidden Channels

View currently joined channels that have been marked as hidden.

The list is paginated, so to get to the next page, you can pass the last TPChannel from the previous list to get to the next page.

[[TalkPlus sharedInstance] getHiddenChannels:lastChannel 
    success:^(NSArray<TPChannel *> *tpChannels, BOOL hasNext) {
    // SUCCESS
    // If 'hasNext' is YES, call this method with the last object in 'tpChannels'.
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
TalkPlus.sharedInstance()?.getHiddenChannels(lastChannel, 
    success: { tpChannels, hasNext in
    // SUCCESS
    // If 'hasNext' is true, call this method with the last object in 'tpChannels'.
}, failure: { (errorCode, error) in
    // FAILURE
})code

4. Get Total Unread Message Count

Get the total number of unread messages from all joined channels.

[[TalkPlus sharedInstance] getTotalUnreadCount:^(int totalCount) {
    // SUCCESS
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
TalkPlus.sharedInstance()?.getTotalUnreadCount({ totalCount in
    // SUCCESS
}, failure: { (errorCode, error) in
    // FAILURE
})

5. Mark All Channels As Read

Mark as read all unread messages from joined channels.

[[TalkPlus sharedInstance] markAsReadAllChannel:^{
    // SUCCESS
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
TalkPlus.sharedInstance()?.mark(asReadAllChannel: {
    // SUCCESS
}, failure: { (errorCode, error) in
    // FAILURE
})

6. Search Joined Channels

Search joined channels using various filters.

  • You can filter channels by name, category, subcategory, private tag and joined members.

  • TPChannelQueryParams class is available starting from TalkPlus iOS SDK v0.5.6.

TPChannelQueryParams *params = [[TPChannelQueryParams alloc] init];
params.lastChannel = lastChannel;
params.channelName = channelName;
params.category = category;
params.subcategory = subcategory;
params.memberIds = memberIds;
params.frozenType = TPUnspecifiedFrozenChannel;
params.privateTag = privateTag;
    
[[TalkPlus sharedInstance] searchChannels:params 
    success:^(NSArray<TPChannel *> *tpChannels, BOOL hasNext) {
    // SUCCESS
    // If 'hasNext' is YES, call this method with the last object in 'tpChannels'.
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
let params = TPChannelQueryParams()
params.lastChannel = lastChannel
params.channelName = channelName
params.category = category
params.subcategory = subcategory
params.memberIds = memberIds
params.frozenType = .unspecifiedFrozenChannel
params.privateTag = privateTag

TalkPlus.sharedInstance()?.searchChannels(params,
    success: { tpChannels, hasNext in
    // SUCCESS
    // If 'hasNext' is true, call this method with the last object in 'tpChannels'.
}, failure: { (errorCode, error) in
    // FAILURE
})

7. Search Public Channels

Search public channels using various filters.

  • You can filter channels by name, category, subcategory, private tag and joined members.

  • TPChannelQueryParams class is available starting from TalkPlus iOS SDK v0.5.6.

TPChannelQueryParams *params = [[TPChannelQueryParams alloc] init];
params.lastChannel = lastChannel;
params.channelName = channelName;
params.category = category;
params.subcategory = subcategory;
params.memberIds = memberIds;
params.frozenType = TPUnspecifiedFrozenChannel;
params.privateTag = privateTag;
    
[[TalkPlus sharedInstance] searchPublicChannels:params 
    success:^(NSArray<TPChannel *> *tpChannels, BOOL hasNext) {
    // SUCCESS
    // If 'hasNext' is YES, call this method with the last object in 'tpChannels'.
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];
let params = TPChannelQueryParams()
params.lastChannel = lastChannel
params.channelName = channelName
params.category = category
params.subcategory = subcategory
params.memberIds = memberIds
params.frozenType = .unspecifiedFrozenChannel
params.privateTag = privateTag

TalkPlus.sharedInstance()?.searchPublicChannels(params,
    success: { tpChannels, hasNext in
    // SUCCESS
    // If 'hasNext' is true, call this method with the last object in 'tpChannels'.
}, failure: { (errorCode, error) in
    // FAILURE
}
PreviousUpdating ChannelNextManage Channel Members

Last updated 11 months ago