philippec / PhFacebook

MacOSX Interface to Facebook graph API
http://developer.casgrain.com/?p=107
Other
178 stars 44 forks source link

Invalid access token error #17

Closed kamaldshah closed 13 years ago

kamaldshah commented 13 years ago

I am trying to write a status message to a user's feed. I used the "publish_stream" and "offline_access" permissions and then tried to send the message me/feed?message=TestMessage". I get the following error:

{"error":{"type":"OAuthException","message":"An active access token must be used to query information about the current user."}}

When I check the token's expiry, it always shows 0. Is this expected?

philippec commented 13 years ago

It seems there was an issue with 0-expiry which has been fixed by infiniteNIL in the latest commit.

Could you try the latest source and report back? Thanks!

kamaldshah commented 13 years ago

I tried with the latest source. Now the token's expiry is nil instead of 0. However, the error is still being returned when I try to post a status message.

kamaldshah commented 13 years ago

I just tried a simple me?fields=id,name request which doesn't even require a token. And I got the same error back:

{"error":{"type":"OAuthException","message":"An active access token must be used to query information about the current user."}}

vytis commented 13 years ago

Make sure that you use the - (void) sendRequest: (NSString*) request params: (NSDictionary*) params usePostRequest: (BOOL) postRequest method with the params filled in. Putting everything in the request string doesn't work.

kamaldshah commented 13 years ago

Thanks a bunch Vytis, that fixed the problem!

philippec commented 13 years ago

Thanks, vytis, you're awesome :-)