stayLoggedIn usage with loginWithFacebookSdk()

For the loginWithFacebookSdk() method, how can I enable users to stay login untaill token expires or manual logout?



Backendless.UserService.loginWithFacebookSdk({email:"email"},new Backendless.Async(fbOk, fbFail));

The above code works but when page gets refreshed, Backendless.UserService.getCurrentUser() returns null.

Looks like the “stayLoggedIn” functionality is not implemented in our JS library yet. I’ll open an internal ticket.

Please do the needful to have this implmented in the next coming release :slight_smile:

I see that this feature does not work for G+ login as well. Please do onsider this too in your intenal ticket.

Now login does not work at all. i am using hte script at http://api.backendless.com/sdk/js/latest/backendless.js

I don’t see any relevant code pushes to the Git at https://github.com/Backendless/JS-SDK/blob/master/libs/backendless.js

Code is

Backendless.UserService.loginWithGooglePlus(true,new Backendless.Async( loginOk, loginFail ) );

Error is

backendless.js:360 POST [url=https://api.backendless.com/v1/users/social/oauth/googleplus/request_url]https://api.backendless.com/v1/users/social/oauth/googleplus/request_url[/url] 400 (Bad Request)

Object {code: 3052, message: "External authentication failed with message 'Can not parse scope from request body'", statusCode: 400}

Script at http://api.backendless.com/sdk/js/latest/backendless.js is old, will be updated soon.

As for login functions, you have asked to add stayLoggedIn to loginWithFacebookSdk (also added for loginWithGooglePlusSdk). It is not implemented for easy login methods. So loginWithGooglePlus method doesn’t expect the first argument to be boolean. It’s expect the ‘fieldsMapping’ (or just pass the Async).

Stanislav

I’ts not yet implemented or never will be implemented? Should user create new ticket for implementing each part of the features in a single functionality? :frowning:

When you asked to try the new SDK, where should one get that? It’s neither in the Git nor on the CDN.

No need for creating new ticket from user. :slight_smile: The internal ticket for implementing stayLoggedIn functionality in easy logins have already created (today), so soon it will be available and I will notify you about that as usual.

For now you can get latest SDK from here:

Or from this links:

https://npmcdn.com/backendless/libs/backendless.min.js
https://npmcdn.com/backendless/libs/backendless.js

Stanislav

Thanks. Waiting for the new version with easy login.

Any ETA for fixes and relevant documentation updates?

It’s already on master.

https://github.com/Backendless/JS-SDK
The signature for FB login is next:

Backendless.UserService.loginWithFacebook(facebookFieldsMapping, permissions, callback, container, stayLoggedIn);

If you don’t use one or all of this parameters:

facebookFieldsMapping, permissions, callback, container

you have to pass null instead.
So, it could look like

Backendless.UserService.loginWithFacebook(null, null, new Backendless.Async(successCb, errorCb), null, true);

Stanislav