简体   繁体   中英

Twilio Android Chat Client function 'getSubscribedChannels()' returns incomplete channels

I'm developing an android chat client that uses the Twilio Programmable Chat Client SDK. I am trying to get a list of the channels the current user as joined, using the following function:

List<Channel> channels = mChatClient.getChannels().getSubscribedChannels();

for(Channel channel: channels){
     Log.d("CHANNELS", "Channel: " + channel.getUniqueName());
}

However, the retrieved channels' unique names (or friendly names) are always empty, like so:

D/CHANNELS: Channel: 
D/CHANNELS: Channel: 
    Channel: 
    Channel: 
    Channel: 
    Channel: 
    Channel: 

The only way I'm able to get the channels with complete information is using the channel descriptors, which is more complex since it requires getting all the channels (Channel class) from the descriptors (ChannelDescriptor).

Has the getSubscribedChannels() method been deprecated or is the code incorrect for the results I want?

Thanks

Is you client in the fully synchronised state by the time you call getSubscribedChannels() ?

Make sure that when you call it, you have already received this callback with status .COMPLETED .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM