Problems with Facebook Sharing

Hello folks, I use TakeScreenShot() function (it’s in the InteractiveConsole example in FB 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:

-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");
}

Hi,

it’s a known bug that Texture2D.ReadPixels is broken in 4.3.4f1 on Windows Phone. It’s fixed in Unity 4.5, which is about to come out, but until then you have two workarounds you could use:

  1. Application.CaptureScreenshot() - that would save the screenshot to disk and then you could read it;
  2. Native plugin to read off backbuffer directly.

Thank you, I’ve updated to the latest version of FB SDK (5.0.3) and the TakeScreenshot() function works good in Unity Editor but the 2nd problem above still exist: No one can see my post except me.
However, When I built for Window Phone 8 platform, it appeared tons of error:

Assets/Facebook/Scripts/FB.cs(358,28): error CS0103: The name `Security' does not exist in the current context
Assets/Facebook/Scripts/FB.cs(366,42): error CS1501: No overload for method `GetType' takes `1' arguments
Assets/Facebook/Scripts/FB.cs(378,22): error CS1502: The best overloaded method match for `System.Reflection.MethodInfo.MakeGenericMethod(params System.Type[])' has some invalid arguments

Assets/Facebook/Scripts/FB.cs(378,22): error CS1503: Argument `#1' cannot convert `object' expression to type `System.Type[]'
Assets/Facebook/Scripts/FB.cs(388,13): error CS1594: Delegate `FB.RemoteFacebookLoader.LoadedDllCallback' has some invalid arguments

Assets/Facebook/Scripts/FB.cs(388,13): error CS1503: Argument `#1' cannot convert `object' expression to type `Facebook.IFacebook'

Have u solved this problem ?
I am having the exactly same problem.

It’s been a long time that I’m not working on it, but you can try to use the latest FB SDK fixed version by Zee posted here: http://forum.unity3d.com/threads/facebook-sdk-for-unity-plus-windows-phone-8.217907/