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) {
}
}
);
TalkPlus.getPublicChannels(lastChannel,
object : TalkPlus.TPCallbackListener<List<TPChannel>, Boolean>() {
override fun onSuccess(tpChannels: List<TPChannel>, hasNext: Boolean) { }
override fun 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) {
}
}
);
TalkPlus.getChannels(lastChannel,
object : TalkPlus.TPCallbackListener<List<TPChannel>, Boolean>() {
override fun onSuccess(tpChannels: List<TPChannel>, hasNext: Boolean) { }
override fun 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) {
}
}
);
TalkPlus.getHiddenChannels(lastChannel,
object : TalkPlus.TPCallbackListener<List<TPChannel>, Boolean>() {
override fun onSuccess(tpChannels: List<TPChannel>, hasNext: Boolean) { }
override fun 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) {
}
});
TalkPlus.getTotalUnreadCount(object : TalkPlus.CallbackListener<Int>() {
override fun onSuccess(totalCount: Int) { }
override fun onFailure(errorCode: Int, 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) {
}
});
TalkPlus.markAsReadAllChannel(new TalkPlus.CallbackListener<Void?>() {
override fun onSuccess(aVoid: Void?) { }
override fun onFailure(errorCode: int, 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) {
}
});
val tpChannelQueryParams: TPChannelQueryParams =
TPChannelQueryParams.Builder()
.setLastChannel(lastChannel)
.setChannelName(channelName)
.setPrivateTag(privateTag)
.setSubCategory(subCategory)
.setMemberIds(memberIds)
.setCategory(category)
.setFrozenType(TPChannelQueryParams.TPChannelFrozenType.NONE)
.build()
TalkPlus.searchChannels(tpChannelQueryParams, object : TalkPlus.TPCallbackListener<List<TPChannel>, Boolean>() {
override fun onSuccess(List<TPChannel> tpChannels, Boolean hasNext) { }
override fun onFailure(errorCode: Int, 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) {
}
});
val tpChannelQueryParams: TPChannelQueryParams =
TPChannelQueryParams.Builder()
.setLastChannel(lastChannel)
.setChannelName(channelName)
.setPrivateTag(privateTag)
.setSubCategory(subCategory)
.setMemberIds(memberIds)
.setCategory(category)
.setFrozenType(TPChannelQueryParams.TPChannelFrozenType.NONE)
.build()
TalkPlus.searchPublicChannels(tpChannelQueryParams, object : TalkPlus.TPCallbackListener<List<TPChannel>, Boolean>() {
override fun onSuccess(List<TPChannel> tpChannels, Boolean hasNext) { }
override fun onFailure(errorCode: Int, exception: Exception) { }
})
Last updated