cometchat/chat-sdk-javascript

clears the Asyncstorage data on app close.

Closed this issue · 4 comments

  • SDK version: 1.8.5 (react native).
  • SDK is working fine. issue while closing the app it clears the Asyncstorage data.

Same issue.

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.

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.

Fixed in the latest version v2.0.6