Support Topics Documentation Slack YouTube Blog

Keep login in app

Hello.
How do I keep the user in login mode?
I want to keep logged in when the user first logs in.
In Android, I can use shared settings but I want to know can i do in backendless?

Hello Seeed

You can use “stayLoggedIn” property when user logs in

here is a doc https://backendless.com/docs/android/users_login.html

Regards, Vlad

I wanna keep token when user is login and remove token when exit profile.
how can I do this?

“stayLoggedIn” property does exactly the same you describe =)

i cant use this method in documentation.
in my code i used this method for login:

    Backendless.UserService.login(mobile,email, object : AsyncCallback<BackendlessUser> {
        override fun handleResponse(user: BackendlessUser) {
           
        }

        override fun handleFault(fault: BackendlessFault) {
           
        }
    })

How do I change this code?

perhaps, in this way

Backendless.UserService.login(mobile,email, object : AsyncCallback<BackendlessUser> {
    override fun handleResponse(user: BackendlessUser) {
       
    }

    override fun handleFault(fault: BackendlessFault) {
       
    }
}, true)

this worked.
if I want to retrieve the current user data that has been logged in How can I do this?

take a look at the doc https://backendless.com/docs/android/users_login.html#validating-user-login there is code sample how to do that