In my app, I don’t want to allow users to login with multiple devices concurrently. To achieve this, I will revoke session token before user tries to login with new device. This makes the session be closed from any prelogined device.
So, I’m testing it with iOS SDK and implemented SessionDelegate. When I revoke session tokens, “sessionWasClosed()” funtion is expected to be called. It is called, but not everytime. It is called irregulary. Sometime it is called, but sometimes not. I have no idea what makes difference. The same procedure with same code makes different result.
Meanwhile, whenever I revoke session token, sendbird log says ‘Socket is not connected’ error has happend. So I added ConnectionDelegate, and found that “didDisconnect(userId: String)” function is called reliably. Is it supposed to be like that? Should I use ConnectionDelegate rather than SessionDelegate?
SendbirdChatSDK iOS 4.2.1.
I don’t know what exactly causes this problem. But it mostly happens at first connection. After I reconnect, session delegate called everytime. If I terminate app and start again, then the problem happens again or not.
My goal might be achievable with ConnectionDelegate, not SessionDelegate. But I don’t think it is good.