我正在学习如何在unity3d游戏中使用facebook graph API,以便创建对象以将其用于向玩游戏的朋友索要礼物,发送挑战以邀请他们玩游戏。
我试图使用图形API添加它们,
{
"app_id":29xxxxxxxxxxxxx,
"type":"testapp:life",
"url":"https:\/\/apps.facebook.com\/appname",
"title":"Life",
"description":"Use this life to play another time!"
}
获得以下结果
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1,
"fbtrace_id": "XXXXXXXXXXX"
}
}
我也尝试使用c#脚本
var formDict = new Dictionary<string, string>()
{
{"title", "Life"},
{"type", "testapp:life"},
{"app_id", "29xxxxxxxxxxxx"}
};
var formData = new Dictionary<string, string>() { { "object", Facebook.MiniJSON.Json.Serialize(formDict) } };
FB.API("/me?objects/testapp:life", HttpMethod.POST, CreateFBLifeCallback, formData);
并在日志中获取以下错误信息
{"error":{"message":"(#10) Application does not have permission for this action","type":"OAuthException","code":10,"fbtrace_id":"XXXXXXXXXXX"}}
仍然无法创建对象。有点困惑我应该使用哪种方法创建对象?还是我做错了什么?
我们将不胜感激。