我正在尝试让我的应用程序(iOS、Android)允许用户将屏幕截图发布到 Facebook,并附上链接和描述。我可以使用 FB.API() 将屏幕截图从我的应用程序上传到 Facebook 为我的应用程序自动生成的用户相册,方法是:
int width = Screen.width;
int height = Screen.height;
Texture2D 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();
string picName = "Idioman_" + Time.time + ".png";
wwwForm.AddBinaryData("image", screenshot, picName);
Debug.Log("trying to post screenshot");
FB.API("me/photos", Facebook.HttpMethod.POST, PostPicCallback, wwwForm);
而且我可以使用 FB.Feed() 从互联网上发布一张图片,其中包含一个链接和对用户提要的描述。有没有办法通过链接和描述将屏幕截图发布到用户的提要?