My request:
<FBRequestConnection: 0x93a8ba0, 1 request(s):(
<FBRequest: 0x9395c90, session: 0xa8aeb80, graphPath: https://graph.facebook.com/me, HTTPMethod: GET, parameters:
{
"access_token" = BAAG4P63ZBHK0BAObimWrMZCGOzn3s6qOtqynyzkJmIN0fKiKGlCkmlqlKMcpbvrrhN9QJsIxrTc7PZCFoceuCwAC2ygCph27WV72iwxkbi2svKCDemDo8BBqOwc6bp6DQH7U9tjp4gZBofb4brYg;
fields = name;
format = json;
"migration_bundle" = "fbsdk:20120913";
sdk = ios;
})>
My response:
result (null)
error Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x93b1ad0 {com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 100;
message = "(#100) Unknown fields: name.";
type = OAuthException;
};
};
code = 400;
}, com.facebook.sdk:HTTPStatusCode=400}
What is the reason behind?
If I send without fields = name; then I get back some default user data.
Invoking:
FBRequest *graphRequest = [[FBRequest alloc] initWithSession:[FBSession activeSession]
graphPath:request.graphPath
parameters:request.parameters
HTTPMethod:request.httpMethod];
FBRequestConnection *connection = [[FBRequestConnection alloc] init];
[connection addRequest:graphRequest
completionHandler:^(FBRequestConnection *connection, id result, NSError *error)
{
[self requestCompleted:connection result:result error:error];
}];
[connection start];
Request object:
-(NSString*)graphPath
{ return @"https://graph.facebook.com/me"; }
-(NSDictionary*)parameters
{
return [NSDictionary dictionaryWithObjectsAndKeys:
@"name", @"fields",
nil];
}
-(NSString*)HTTPMethod
{
return @"GET";
}
Have tried with fixed parametes as well, no effect:
graphRequest = [[FBRequest alloc] initWithSession:[FBSession activeSession]
graphPath:@"https://graph.facebook.com/me"
parameters:[NSDictionary dictionaryWithObjectsAndKeys:@"name", @"fields", nil]
HTTPMethod:@"GET"];
Graph path must be relative.
Now I use only @”me” instead of @”https://graph.facebook.com/me”, and works like a charm.