<div dir="ltr"><div>Hi</div><div><br></div><div>We are planning to use libotr in our mobile app and expect it to work like this.</div><div><br></div><div>1. Bob opens the OTR chat screen (different from regular chat) with Alice.</div>
<div><br></div><div>2. If its the first time, we send a Apple push notification to Alice saying 'Bob wants to have OTR chat with you. Go to the app'.</div><div><br></div><div>3. Alice goes into the app. Bob and Alice apps establish a secure session. The app persist the session on Alice' device.</div>
<div>The session is persisted on Bob's device as well.</div><div><br></div><div>4. Now Bob can send Alice messages even when her phone is switched off or off the network or the app is in the background.</div><div><br>
</div><div>5. Alice's app can restore the session on restart or whenever necessary to decrypt Bob's message.</div><div><br></div><div>We started persisting  userstate and so far not successful. I am wondering</div>
<div>if anybody has attempted persisting the userstate successfully or any pointers in general?</div><div><br></div><div>Once it works will be happy to send a pull request.<br></div><div><br></div><div>Thanks</div><div>Madhav</div>
<div><br></div><div>PS: As a side note, we managed to save and restore OTR session for the java(Android) implementation by extending <a href="https://github.com/jitsi/otr4j">https://github.com/jitsi/otr4j</a></div><div>the JSON format of the session looks like the attached. Although the attachment is in JSON format, we use BSON in the app.</div>
<div><br></div></div>