SendBird Reconnection Problem

Hi, I’ve got some issues with the SendBird Reconnection function.

  1. On Android API 29 the connection is always interrupted when we are trying to open chat room via notification. But when we deactivate background detection it is working normally.
  2. When we using auto background detection, how Send Bird determine when to disconnect or reconnect?

Hi @wildhansatriady, thank you for reporting the problem to us.

For problem #1, could you please further explain what you mean by interrupted? Does reconnection fail? Or existing connection gets closed?

For problem #2, what we do is that we register an ActivityLifecycleCallbacks using Application#registerActivityLifecycleCallbacks. Then we manage connection resources using onActivityResumed and onActivityPaused events.

If you could provide us the sdk version you are using and the error logs, we can look into it and possibly provide you some better answer. Thanks.

  1. here is the log

W/SendBird: [14:01:47.474 SocketManager:onError():716] >> onError : Socket is closed, reconnecting : false, explicitDisconnect : true

E/PINGER: [14:01:45.764 Connection$Pinger:stop():376] Pinger stop timer is null

yes, the existing connection gets closed.

  1. In API 29 there is a possibility that onActivityPause is called even our activity is in the foreground. I’m not sure whether this is a bug from android or not but, maybe you have some workaround for this?

we are currently using using this sdk version :

sendBird = ‘3.0.148’
sendBirdSyncManager = ‘1.1.26’

@wildhansatriady We’ll look into it. If you could please provide us some more logs (ideally the full log) it would be really helpful because knowing what happened before and after the socket closure will enable us to understand what was going on.

For the workaround, we will have to pinpoint the problem first so when we’ve found the root cause we’ll try to come up with possible solutions. Thank you.

Hi @wildhansatriady, I looked into it but at the current moment I was unable to locate the source of the problem. Unfortunately my hands are currently full so I cannot promise you when I can deliver some meaningful results. Could you please contact our solutions team or sales team so that we can issue a ticket for this? Then hopefully some of my low-priorities jobs can be delayed for this. Please let them know you have posted your question here and we’ve talked about this - this will speed up some process.

I’m sorry that I cannot be helpful to you now but we’ll do our best.