Having developed some error handling code inside my Unity application to perform user actions when a Facebook denial request (like forcing a local user to log out or requesting a new permission), I saw some inconsistencies between the HTML API (Error Code Handling) and the results. which I get for failed requests.
When you try to publish a score ( API points ) without granting write access to my application, the request assigned to the callback receives FBResult, containing
result.Error == "403 Forbidden"
instead of being related to:
result.Error == {
"error": {
"message": "API Permission Denied",
"type": "",
"code": 10 ,
"error_subcode": 467
}
}
When you look at the FB friendsmash-unity sample , they ignore the errors presented in the following code snippet:
void APICallback(FBResult result)
{
Util.Log("APICallback");
if (result.Error != null)
{
Util.LogError(result.Error);
FB.API("/me?fields=id,first_name,friends.limit(100).fields(first_name,id)", Facebook.HttpMethod.GET, APICallback);
return;
}