c# - 如何使用 facebook graph api 创建对象,用于统一游戏?
问题描述
我正在学习如何在 unity3d 游戏中使用 facebook 图形 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"}}
仍然无法创建对象。我应该使用哪种方法来创建对象有点困惑?还是我做错了什么?
帮助将不胜感激。
解决方案
推荐阅读
- c++ - c++ 以二进制模式将文件读取到对象中失败,但在标准输入中可以,并且在文本中读取文件
- reactjs - html标记作为ckeditor4-react中的placeHolder
- android - github 操作颤振给出错误“工件模式:build/app/outputs/apk/release/*.apk 不匹配任何文件”
- button - 如何在清单中使用多个接收器媒体按钮
- python - Python中关于类和赋值的执行时间
- javascript - 使用 Expo 相机录制视频上传服务器使用 axios api 请求显示错误
- javascript - Bootstrap 行变体元素不会改变行颜色
- javascript - JS 脚本未按顺序下载和评估
- docker - 在 Docker 上运行的 Selenium Hub 的 Windows 身份验证
- docker - 来自 docker stats 命令的容器的实际 CPU 使用率是多少