Code Monkey home page Code Monkey logo

Comments (7)

davejohnson avatar davejohnson commented on July 21, 2024

Glad it worked for you and I have a fix coming! Essentially just look in the plugin js code and in login first check if there is a session object in localStorage and if not then continue and get the session object and save a copy in localStorage.

from phonegap-facebook-plugin.

eyalfx avatar eyalfx commented on July 21, 2024

Great, I can give it a shot.
Are you planing on checking it in?

from phonegap-facebook-plugin.

eyalfx avatar eyalfx commented on July 21, 2024

oops, didn't mean to close the issue. I thought that "comment & close" button will close the window :)

from phonegap-facebook-plugin.

dokterbob avatar dokterbob commented on July 21, 2024

It seems as though, in my case, session.expires equals 4001-01-01 00:00:00 +0000 (it's a token with offline permission) whereas new Date().valueOf() yields something like 1317933785247. Hence, the comparison fails and the session is never restored.

In other words: please reopen this one. ;)
(More research in progress...)

from phonegap-facebook-plugin.

dokterbob avatar dokterbob commented on July 21, 2024

Also, the current code makes it impossible to determine whether the user gets login feedback at all.

For example; in an actual app we want users to only have to login once (ideally). We do this the first time by displaying a nice login button. However, in the current API there is no way to determine whether this button should be displayed (hence whether an access token is present in local storage).

A better alternative might be to automatically restore the session during the init function, automatically loggin the user in. Then, later, we might explicitly call getLoginStatus to determine whether the session is valid at all etcetera.

from phonegap-facebook-plugin.

davejohnson avatar davejohnson commented on July 21, 2024

@dokterbob good point. looking into that now. for some reason I went down that path and then decided against it but I will have a second look.

from phonegap-facebook-plugin.

dokterbob avatar dokterbob commented on July 21, 2024

This one seems a dup of #69 and ought to be reopened, probably: the new Date().valueOf() seems to be still occuring. I remember having fixed this one particular issue - but I guess I have lost the results of that. Will try again.

from phonegap-facebook-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.