- Home /
2 issues with Facebook Sharing in Window Phone
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: http://i7.minus.com/iXiHlCcSWaVfC.jpg
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");
}
Answer by booba · May 21, 2014 at 02:40 PM
how do you call your function? you need to StartCoroutine() for the yield to work. (that's my best guess for why your screenshot is gray) about the private picture in fb - i noticed that when you do this from unity's editor the picture is published with "only me" privacy settings, but when you actually do it from a device (android here) it's fine. also if you were playing with your app maybe your account has a high privacy setting already saved for it although you changed it at some point. go to your settings -> apps and remove the app's record from your profile then try again.
Thanks for your help. I had used StartCoroutine() but it's not works. Besides that, I just realize latest FB SD$$anonymous$$ for Unity not support for Window Phone and FB SD$$anonymous$$ Plus (a fixed version from a fan of Unity that come from here: chillsters.com/facebook-sdk-for-unity-plus-windows-phone-8/) has many errors and cannot take the screenshot as well
well then i'm guessing you're dropping the sdk? i'm currently experimenting with a native android plugin to open a share intent ins$$anonymous$$d of posting through the facebook sdk... can't say that it's easy to make work
Answer by andrescavallin · Aug 07, 2014 at 05:28 AM
Dear Brave, the problem is not related to Chillsters SDK, actually is a Bug on some Windows Phones that will eventually get fixed. See here: http://fogbugz.unity3d.com/default.asp?615213_854qu441tj00hbqr The reason you are the only one seeing your posts is because you app is still being developed on Facebook, you need to get approved by Facebook (publish_actions) and then go live. By the way, you will never get approved by Facebook by harcoding messages on the post like "herp derp", you need to allow the user to edit what is being posted.
Your answer
Follow this Question
Related Questions
Share image with hastag 2 Answers
Facebook share screenshot with link. 1 Answer
facebook sdk share screen shot 0 Answers
Problem when take a screenshot and share to Facebook 1 Answer