Hi, i had add facebook sdk success to my unity game, when i use my facebook developer account then login to facebook and post a message and photo to facebook it working perfectly.
But when i change to another facebook account and post a message and photo i get an error message:
java.io.FileNotFoundException: https://graph.facebook.com/me/photos ?
Here is my code:
// After call init and login success:
public 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();
stt = "Connecting to facebook...";
byte[] screenshot = tex.EncodeToPNG();
var wwwForm = new WWWForm();
wwwForm.AddBinaryData("image", screenshot, "InteractiveConsole.png");
wwwForm.AddField("message", "I just score "+score.ToString()");
FB.API("me/photos", Facebook.HttpMethod.POST, Callback, wwwForm);
}
call TakeScreenshot() function to post massage and photo to facebook wall.