Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"expires_at" bug? #17

Open
natenrb9 opened this issue Jan 30, 2015 · 6 comments
Open

"expires_at" bug? #17

natenrb9 opened this issue Jan 30, 2015 · 6 comments
Labels

Comments

@natenrb9
Copy link

I am just starting out with the Facebook API, so I am definitely just in the learning phase. I did find what seems to be a bug:

AccessToken.php > extend()

$expires_at = isset($data['expires_at']) ? $data['expires_at'] : 0;
should be
$expires_at = isset($data['expires']) ? $data['expires'] : 0;

If you look at $data that "expires" is the actual name of the key.

But even after I changed this it is still not converting the date correctly for the $token.
It is showing the expires_at date as public 'date' => string '1970-03-01 23:09:46.000000'

@natenrb9
Copy link
Author

Oh, as to the date formatting, looks like the problem is facebook returns the 'expires' as a total seconds timestamp, and the function being used accepts UNIX timestamps, and it doesn't look like it is being correctly converted over.

@jdsingh
Copy link

jdsingh commented Jan 31, 2015

Did you find any solution ?

What is the response you get when you call $token->getInfo()

For me $data variable only contains access_token in it.

@jdsingh
Copy link

jdsingh commented Jan 31, 2015

Yes it looks like a bug.

@SammyK
Copy link
Owner

SammyK commented Feb 2, 2015

You're right this is an issue that should be addressed. I fixed it in the official PHP SDK but forgot to back port it to FQB.

The thing is that depending on the way you obtain the access token, sometimes it will return expires and other times is returns expires_at. So both cases need to be accounted for. You can see the fix from the PHP SDK.

@SammyK SammyK added the bug label Feb 2, 2015
@SammyK
Copy link
Owner

SammyK commented Feb 2, 2015

PS: Thanks for pointing out the issue @natenrb9! :)

@phazei
Copy link

phazei commented Jul 25, 2015

In the response I'm getting from extend()
$response = FQB::getConnection()->send('/oauth/access_token', 'GET', $params, $app_request = true);

It is returning "expires_in" which is 5184000 - 60 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants