www.iconnectiva.com
Posts: 0
Joined: Wed Jul 23, 2014 11:08 am

one time login in a application in appery.

I have a login page.But the page will appear only once.once the user successfully loged in the application will go to main page once the application have been resumed.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

one time login in a application in appery.

Hello,

Sorry, I'm not sure I understand you correctly. Could you please clarify your issue with more details?

www.iconnectiva.com
Posts: 0
Joined: Wed Jul 23, 2014 11:08 am

one time login in a application in appery.

I have a login page.This page will appear only once.means once the user successfully logged into the application after,this login page will never appear when user trying resume the application.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

one time login in a application in appery.

Sorry, I still need more information. You want to create this logic or you have some problems with it?

www.iconnectiva.com
Posts: 0
Joined: Wed Jul 23, 2014 11:08 am

one time login in a application in appery.

Hi,
We have tried to implement the above thing.What I have done explaining below-
For the first time application started after installing the .apk file-
i)The login page has two input boxes and one login button.User can provide his user id and password on the input boxes.On click event of login button we are invoking a service(Authentication).If the authentication is successful the webservice
will return "true".
ii)On click of login button we have invoked another javascript.This script will check the response of the web service.if it is true the application will navigate to landing page otherwise a dialogue box will appear.
iii)We also have set a value of local storage "login" to "true" once the user successfully authenticated in the above js.
Next time when the user trying to restart the application-
i)We have incorporated a java script on the page show event of the login page that will check the value of the "login" local storage variable.If the value is true the application will navigate to the landing page.
up till now this is working fine and we have successfully incorporated one time login of a user in our application.

But problem is that once the mobile is being switched off and switched on again the value of the local storage is set to null.So the javascript checking of the on load event of login page fails and the login page appears again.

Our objective is to achieve that user will provide his user id and password only once until and unless he intentionally logged out from the application or reinstall the application again.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

one time login in a application in appery.

It is very strange that the values in the local storage are reset after a reboot of the device. Maybe it is a feature of a particular of your device? Could you please test the application on another device? Your approach should work. Could you please also specify, do you really use local storage as described here, for example: http://devcenter.appery.io/documentat... ?

www.iconnectiva.com
Posts: 0
Joined: Wed Jul 23, 2014 11:08 am

one time login in a application in appery.

Hi Evgene,
thanks for your support.Finally I have found the issue.DELETE_CACHE_FILE
parameter was somehow checked in appsettings.

www.iconnectiva.com
Posts: 0
Joined: Wed Jul 23, 2014 11:08 am

one time login in a application in appery.

I have another question-
suppose JSON response of a service is like below-
'a':'10'
'b':'20'
'c':'30'

how to store this total response in a local storage from where I can create two arrays using java script-
arr1=[a,b,c]
arr2=[10,20,30]

from these values I want to create chart.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

one time login in a application in appery.

To get all keys from the object's json you may use function Object.keys(obj) https://developer.mozilla.org/en-US/d...
To get an array of values, you can by running through all the keys:
http://stackoverflow.com/a/7861051

www.iconnectiva.com
Posts: 0
Joined: Wed Jul 23, 2014 11:08 am

one time login in a application in appery.

Hi,
Thanks for your support.But my concern is how can I access the response in java script.

Return to “Issues”