【发布时间】:2013-12-01 13:43:24
【问题描述】:
我无法通过 Unity 向 Facebook 发送图片,我在 Awake 和 FB.Login 中使用 FB.Init 正确连接到 Facebook,然后我使用文档中的代码拍摄并发送图片,但后来我得到了这个错误:
java.io.FileNotFoundException: https://graph.facebook.com/me/photos
使用此代码:
private IEnumerator TakeScreenshot()
{
yield return new WaitForEndOfFrame();
var width = Screen.width;
var height = Screen.height;
var tex = new Texture2D(width, height, TextureFormat.RGB24, false);
// Read screen contents into the texture
tex.ReadPixels(new Rect(0, 0, width, height), 0, 0);
tex.Apply();
byte[] screenshot = tex.EncodeToPNG();
var wwwForm = new WWWForm();
wwwForm.AddBinaryData("image", screenshot, "InteractiveConsole.png");
FB.API("me/photos", Facebook.HttpMethod.POST, picCallback, wwwForm);
}
我有什么遗漏吗?
谢谢
【问题讨论】:
标签: facebook facebook-graph-api unity3d filenotfoundexception