twilio / twilio-chat-demo-android

Chat API Demo Application for Android
MIT License
62 stars 51 forks source link

Room not found #75

Closed amigax closed 6 years ago

amigax commented 6 years ago

the room to connect to for text chat is almost never appearing in the list of available rooms, this makes chat impossible. Why is that?

berkus commented 6 years ago

There is no notion of Rooms in chat, do you mean Channel? Is it public?

amigax commented 6 years ago

Yes sorry channel, they seem to appear sometimes but always delayed, why would they be delayed or sometimes not appear?

berkus commented 6 years ago

Do you await for complete client synchronisation before requesting a channel list?

Can you collect a log file for a case when a particular channel does not show up? Please record friendly name and sid of that channel separately.

amigax commented 6 years ago

Im not sure, how do I know if the client sync is complete? The video call connects properly, then I wait a few minutes and query channel list, often the channel is not ready.

I will try get a log for this and post it here, thanks very much.

berkus commented 6 years ago

Hmm, chat does not support video calls.

amigax commented 6 years ago

I merged text chat and video chat into one app, we want to be able to have a video call, and then if the user wants to also type they can hit a button to go to the text chat. But it is at this point that the channel is not always available. Im not sure what actually creates the channel and how, or why it is delayed. I did not write the server side, I just receive a push notification with details of which channels I can join. Any ideas?

berkus commented 6 years ago

Have you looked in the chat demo application how it manages the channel lists? You need to start ChatClient and wait for it to be fully syncrhonized; demo app does that.

amigax commented 6 years ago

Great thanks, yes I am using the chat demo code inside my app, so what code is it that gets called when it is fully synchronized? is that onChannelSynchronizationChange in ChannelActivity.java ? if not please point me to the correct method/position where I can print a message to know for sure when it is synchronized.

Finally, is there any way to speed up this synchronization if it seems to take too long? What is it that actually takes the time, I mean what is it doing? I Much appreciate the help.

berkus commented 6 years ago

The part that should be checking the sync status is here. (The demo app doesn't check it yet, but it should actually, right now it relies on slow load of everything because it doesn't request channel by sid right after start. I will update it.)

You should look at this callback and check SynchronizationStatus to be CHANNELS_COMPLETED or COMPLETED.

amigax commented 6 years ago

Thanks very much, but it appears the ChatClientListener is implemented in ChannelActivity, so this means you must launch ChannelActivity before the listener can know if its synchronized? Which defeats the purpose, because you would need to load and wait inside ChannelActivity wouldnt you? I want to know ahead of time so I can make a "chat" button appear once syncing is done, but I do not want to be sitting on the ChannelActivity for this, I want to do it in the background while user is on a video call.

berkus commented 6 years ago

ChatClientListener is for chat client and you dont have to implement it in the activity, you can do it as soon as you create ChatClient.

amigax commented 6 years ago

Oh I see, can you give me an example of this? Looks like it would only kick off when the ChannelActivity starts?

amigax commented 6 years ago

oh i see sorry like this:


 basicClient.getChatClient().setListener(new ChatClientListener() {
            @Override
            public void onChannelJoined(Channel channel) {

            }
etc
berkus commented 6 years ago

Yep!

amigax commented 6 years ago

Great thank you!!

berkus commented 6 years ago

Ping me if it worked successfully for you.

berkus commented 6 years ago

No response, closing.