Raj Shah
Raj Shah

Reputation: 29

How to Stay as "Logged in" mode in titanium Alloy App when App window closed from background mode?

I have made simple login Application in titanium alloy in which user have to login by username and password. I have noticed that after login in to App whenever user operate Application and suddenly he/she close Application from background mode, App automatically goes in Logged Out mode even he/she Did not manually Logged out from Application. How I can make settings in App so that After logged in, It always stays in Home screen titanium alloy window even after closing app from background.

Please suggest your comments in code or useful links

Thank You Raj

Upvotes: 0

Views: 248

Answers (1)

Jagu
Jagu

Reputation: 762

You have to use share properties: Titanium.App.Properties

E.g:

if(Ti.App.Properties.getBoolean("userIsLogged", false){
 //redirect home
}else{
 // redirect login
}

//login e.g:
var successLogin=function(e){
Ti.App.Properties.setBoolean("userIsLogged", true);
};

Upvotes: 3

Related Questions