Jump to content

  • Log In with Google      Sign In   
  • Create Account

Problems with Facebook Sharing in Window Phone


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 BraveVN   Members   -  Reputation: 111

Like
0Likes
Like

Posted 02 May 2014 - 10:33 AM

Hello folks, first, I must say that I have post this question 3 times in Unity Community (include answer hub and its forum) but no one can solve it. I use TakeScreenShot() function (it's in the InteractiveConsole example in Facebook SDK for Unity) to take a screenshot and post it to FB. But there are 2 problems appeared:
 
- First: the screenshot that's captured is a gray blank like this: (sorry, I don't have permission to post an image)
 
 
- Second: No one can see my post except me although I set the photo to public.
 
How can I fix these problems ? Thank you.
 
Here is the code of TakeScreenShot() function
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");
       wwwForm.AddField("message", "herp derp.  I did a thing!  Did I do this right?");

       FB.API("me/photos", Facebook.HttpMethod.POST, Callback, wwwForm);
       Debug.Log("done");
}

 



Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS