cometchat / chat-sdk-javascript

Voice & Video Calling and Text Chat SDK for JavaScript/Web
Other
30 stars 24 forks source link

clears the Asyncstorage data on app close. #54

Closed ajaygajra closed 4 years ago

ajaygajra commented 4 years ago
Huzaifaak commented 4 years ago

Same issue.

mayur-bhandari commented 4 years ago

Hello @Huzaifaak , can you please let us know when does the async storage gets cleared? If you are facing an issue where you have to login the user to cometchat every time you kill the app. Solution: The SDK keeps a track of the logged in user and thus you do not need to call the login method every time. We suggest that you use the CometChat.getLoggedInUser() method. If the method returns null, only then you need to log the user into the SDK using the login method.

If you are getting some other issues, kindly let us know.

SheikhSharjeel commented 4 years ago

The issue regarding the async storage seems to be resolved. But after a certain period after the app has been killed it again asks to log in. Probably around after an hour or so. But within this time if I kill the app and come back it doesnot ask to login again. Is there any session time after which the async storage gets cleared and that is why it asks to log in again?

What we are doing is that the SDK keeps a track of the logged in user and thus we donot call the login method every time. We use the CometChat.getLoggedInUser() method. If the method returns null, only then we log the user into the SDK using the login method.

Because until and unless I log out of the app it shouldn't ask me login even if I open the app after a day, it should directly take me inside the app. I think you would agree with me on this.

Plus even if the app is running in background, it doesnot ask to log in again within an hour but at times the chat does not load and we are stuck at the main users screen where the list of users appear. There is constant loading here and the list of users is not appearing. This happens when there is inactivity on the app and the app has been running in the background for like 15 20 minutes and when I come back to the app again the users list dissappear and is stuck at loading.

I also shared this query on your slack support Hybrid Channel around 5 6 days ago but there hasn't beeen any response on it so far. Would really appreciate a swift response.

mayur-bhandari commented 4 years ago

Fixed in the latest version v2.0.6