Problem when take a screenshot and share to Facebook

Edited: I build this game for Android and Window Phone platfomr.

Hello guys,
In my game, when player die, there is a stat board appear with a “Share” button, what I want is when player hit the button, it capture game’s screenshot and then share to Facebook. For easily understand, It work exactly like the “Share” button in Flappy Bird game.

Here is my code, I tested with a Debug.log(“done”) at the end of the TakeScreenshot() function and when I hit the button, I got the result: there is a word “done” in console window, the game is stopped just a bit of second (I think it’s has captured the screenshot) but nothing appeared.

if (// share button)
void callFB () {
		if (!FB.IsLoggedIn) {
			FB.Login("email,publish_actions", LoginCallback);                                                                                                                                                                
		else StartCoroutine(TakeScreenshot());
	void LoginCallback(FBResult result) {                                                                                          
		if (FB.IsLoggedIn) {                                                                                      
	void OnLoggedIn() {                                                                                          
		FbDebug.Log("Logged in. ID: " + FB.UserId);                                            

	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);
		byte[] screenshot = tex.EncodeToPNG();
		var wwwForm = new WWWForm();
		wwwForm.AddBinaryData("image", screenshot, "InteractiveConsole.png");
		wwwForm.AddField("message", "herp derp.  I did a thing!  Did I do this right?");
		FB.API("me/photos", Facebook.HttpMethod.POST, Callback, wwwForm);

	private Texture2D lastResponseTexture;
	private string lastResponse = "";
	public string ApiQuery = "";
	void Callback(FBResult result)
		lastResponseTexture = null;
		if (result.Error != null)
			lastResponse = "Error Response:

" + result.Error;
else if (!ApiQuery.Contains(“/picture”))
lastResponse = "Success Response:
" + result.Text;
lastResponseTexture = result.Texture;
lastResponse = "Success Response:

@BraveVN, your question is important. Who can help!