Reputation: 1792
Im requesting basic data from Unity app using official Facebook SDK. The problem appears when I add first_name field into friends list
There is no issue in Unity Editor, problem only appears on iOS, console screaming UnsuportedURL
Issue does not appear without the {first_name} right after friends
Request:
me?fields=id,name,friends{first_name}
Unity Code:
FB.API("me?fields=id,name,email,friends{first_name},first_name", HttpMethod.GET, delegate(FBResult dataResult) {
if (!string.IsNullOrEmpty(dataResult.Error)) {
//error occured
Debug.LogError(dataResult.Error);
error(dataResult.Error);
isFinished(true);
} else {
Debug.Log(dataResult.Text);
}
Upvotes: 1
Views: 606
Reputation: 1
Using the following query:
"/me?fields=id,first_name,gender,picture,email,friends{id,first_name,gender,picture},invitable_friends{id,first_name,picture}"
... works fine in the Unity Editor but not on iOS. The previous solutions don't work.
Switching from curly brackets to regular brackets - Facebook rejects it for containing an invalid character.
Switching to escaped curly brackets (%7B and %7D) - Still returns Unsupported URL.
Here's how I fixed it in the end:
"me?fields=id,first_name,gender,picture,email,friends.fields(id,first_name,gender,picture),invitable_friends.fields(id,first_name,picture)"
Upvotes: 0
Reputation: 1792
Looks like curly braces are the issue here breaking iOS NSURL
Escaping curly braces worked like here: NSURL with Curly Braces
"me?fields=id,name,email,friends%7Bfirst_name%7D,first_name"
Upvotes: 0
Reputation: 7373
Try this URL, using fields.
"me?fields=id,name,email,friends.fields(first_name),first_name"
Upvotes: 1