Using Social.framework and SLRequest with field extension
So far OS X 10.8.2 Social.Framework works fine:
NSURL *requestURL = [NSURL URLWithString:@"https://graph.facebook.com/me/friends"];
SLRequest *fbRequest = [SLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:requestURL parameters:params];
This correctly delivers the object's friend list me()
. Fine!
However, as soon as I try to use Field Expansion as follows, the request fails with an error: The active access token should be used to request information about the current user:
[NSURL URLWithString:@".../friends?fields=cover,picture"];
This is certainly due to the fact that the access_token will be added inside the Social.framework program using st. like "? access_token =% @", which by itself will not work with the previous ones ? fields = .
So, I am wondering if this is really a bug in the framework, or am I using it incorrectly? I am really grateful for any helpful information.
source to share
After contacting Apple directly, this is definitely the answer: Add field extension tags using a GET parameter variable instead of adding them to the actual URL:
SLRequest *fbRequest = [SLRequest requestForServiceType:SLServiceTypeFacebook
requestMethod:SLRequestMethodGET
URL:requestURL
parameters:@{@"fields":@"cover,picture"}];
It's obvious, but I didn't think about it :). I'll give this thread as it is in case someone might stumble upon the same issue in the future!
source to share