Offline support and handle session if user is already login

We have downloaded and created the give application

We have followed the following steps

  1. Login as first user
  2. Login as second user
  3. Had some conversation with using chat.
  4. Now exit the app (kill the app).
  5. Now go offline, switch off the network in mobile.
  6. Now opening the app again.
  7. Now again i am able to see login screen.

We need that if user is already login then it should not ask to login again and want to see the conversation had with even if mobile network is off. expecting the data should persist locally in device or realm SDK

in Firebase / AWS Amplify this functionality is working so can you please help to resolve this problem as soon as possible.