[Resolved] Android Facebook API Bug

It looks like the facebook api for android (fine on iOS) just appends the access token with a “?access_token=xyz” without checking if URL params already exist… This fails for a lot of use cases where i want to provide URL parameters to facebook (no response body is returned since facebook will ignore the token)…simple example is:

facebook.request("me/?fields=id,name,email", function(event) end);  

This results in the following URL being generated (note the ‘?’ between ‘email’ and ‘access_token’ in the url where a ‘&’ should be)

https://graph.facebook.com/me/?fields=id,name,email?access\_token=XYZ&format=json  

When the parameters are being appended by corona, the android layer needs to first check if the URL already contains a ‘?’ and if so, it needs to be appended with a ‘&’ instead.

In some cases i can get around it, but for certain facebook URLS I absolutely need to be able to provide parameters, like “/fql?query=”

[import]uid: 105599 topic_id: 32113 reply_id: 332113[/import]

That’s not how you are supposed to use this API. The URL arguments are supposed to be given to this function as a Lua table in its 3rd argument. Please see the following API documentation…
http://docs.coronalabs.com/api/library/facebook/request.html
[import]uid: 32256 topic_id: 32113 reply_id: 127938[/import]

oh, son of a…

Thanks! :slight_smile: [import]uid: 105599 topic_id: 32113 reply_id: 127940[/import]

Happy to help! :slight_smile:

You might also want to have a look at sample project “Networking/Facebook” that is included with the Corona SDK for some working example code. [import]uid: 32256 topic_id: 32113 reply_id: 127944[/import]

That’s not how you are supposed to use this API. The URL arguments are supposed to be given to this function as a Lua table in its 3rd argument. Please see the following API documentation…
http://docs.coronalabs.com/api/library/facebook/request.html
[import]uid: 32256 topic_id: 32113 reply_id: 127938[/import]

oh, son of a…

Thanks! :slight_smile: [import]uid: 105599 topic_id: 32113 reply_id: 127940[/import]

Happy to help! :slight_smile:

You might also want to have a look at sample project “Networking/Facebook” that is included with the Corona SDK for some working example code. [import]uid: 32256 topic_id: 32113 reply_id: 127944[/import]