0

I am a new user of Titanium and have started debugging a bank application. I am stuck at one of the bugs related to user session handling.

Currently, the user logs in to the app and does the transactions, but if the user kills the app without logging out, then the app should automatically log him/her out when relaunched freshly(by which i mean NOT RESUMED FROM THE BACKGROUND). I have researched a lot about it for iOS application but have hardly found any solution for Titanium.

I have tried "pause" and "resume" event listeners but they are for, if the app is running in the background. But what I want is, if the user swipe closes the app then it should log out the user automatically.

Thanks in advance for any help

  • Whenever the titanium app is relaunched index.js ( for alloy ) / app.js ( for classic ) file is triggered first; so here you can write some method that will force user to goto login screen. – turtle Jun 19 '15 at 08:21
  • Hello @turtle, yes i finally resolved the issue, I created a Ti.App.Properties to set a variable appLaunch to ("yes" if launched for the first time or "no", if launched from the background). In app.js: var opened = Ti.App.Properties.getString("appLaunch","yes" == "yes"); if(opened){ if(exports.isLoggedIn()){ exports.logout(); Ti.App.Properties.setString("appLaunch", "no"); } } – user1307808 Jun 21 '15 at 07:16

0 Answers0