Viewing Channel LIst

1. Get Public Channels

You can view 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.getPublicChannels(lastChannel, 
    new TalkPlus.TPCallbackListener<List<TPChannel>, Boolean>() {
        @Override
        public void onSuccess(List<TPChannel> tpChannels, Boolean hasNext) {
        }
        @Override
        public void onFailure(int errorCode, Exception exception) {
        }
    }
);

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.getChannels(lastChannel, 
    new TalkPlus.TPCallbackListener<List<TPChannel>, Boolean>() {
        @Override
        public void onSuccess(List<TPChannel> tpChannels, Boolean hasNext) {
        }
        @Override
        public void onFailure(int errorCode, Exception exception) {
        }
    }
);

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.getHiddenChannels(lastChannel, 
    new TalkPlus.TPCallbackListener<List<TPChannel>, Boolean>() {
        @Override
        public void onSuccess(List<TPChannel> tpChannels, Boolean hasNext) {
        }
        @Override
        public void onFailure(int errorCode, Exception exception) {
        }
    }
);

4. Get Total Unread Message Count

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

TalkPlus.getTotalUnreadCount(new TalkPlus.CallbackListener<Integer>() {
    @Override
    public void onSuccess(Integer totalCount) {
    }
    @Override
    public void onFailure(int errorCode, Exception exception) {
    }
});

5. Mark All Channels As Read

Mark as read all unread messages from joined channels.

TalkPlus.markAsReadAllChannel(new TalkPlus.CallbackListener<Void>() {
    @Override
    public void onSuccess(Void aVoid) {
    }
    @Override
    public void onFailure(int errorCode, Exception exception) {
    }
});

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 Android SDK v0.5.5.

TPChannelQueryParams tpChannelQueryParams =
    new TPChannelQueryParams.Builder()
    	.setLastChannel(lastChannel)
    	.setChannelName(channelName)
	.setPrivateTag(privateTag)
	.setSubCategory(subCategory)
	.setMemberIds(memberIds)
	.setCategory(category)
	.setFrozenType(TPChannelQueryParams.TPChannelFrozenType.NONE)
	.build();
	
TalkPlus.searchChannels(tpChannelQueryParams, new TalkPlus.TPCallbackListener<List<TPChannel>, Boolean>() {
    @Override
    public void onSuccess(List<TPChannel> tpChannels, Boolean hasNext) {
    
    }
			
    @Override
    public void onFailure(int errorCode, Exception exception) {
			
    }
});

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 Android SDK v0.5.5.

TPChannelQueryParams tpChannelQueryParams =
    new TPChannelQueryParams.Builder()
    	.setLastChannel(lastChannel)
    	.setChannelName(channelName)
	.setPrivateTag(privateTag)
	.setSubCategory(subCategory)
	.setMemberIds(memberIds)
	.setCategory(category)
	.setFrozenType(TPChannelQueryParams.TPChannelFrozenType.NONE)
	.build();
	
TalkPlus.searchPublicChannels(tpChannelQueryParams, new TalkPlus.TPCallbackListener<List<TPChannel>, Boolean>() {
    @Override
    public void onSuccess(List<TPChannel> tpChannels, Boolean hasNext) {
    
    }
			
    @Override
    public void onFailure(int errorCode, Exception exception) {
			
    }
});

Last updated