I have a code which I use to share a screenshot on Facebook once the user clicks on my "share" UI button, (once he logged in to Facebook). It works well and it shares the image directly on Facebook, but I want to have before the standard Facebook popup window that would ask the user the approval to share (and also includes the Facebook's privacy settings -public/friends only/ private.
I can get this dialog when I use FB.ShareLink
, but I need to share a screenshot so I use FB.API
Here is the code:
public void FacebookLogin()
{
var permissions = new List<string>() { "publish_actions" };
FB.LogInWithPublishPermissions(permissions);
}
public void FacebookShare()
{
var bytes = GameManager.instance.tex.EncodeToPNG();
var wwwForm = new WWWForm();
wwwForm.AddBinaryData("image", bytes, "InteractiveConsole.png");
wwwForm.AddField("message", "I did a thing! Did I do this right?");
FB.API("me/photos",HttpMethod.POST, APICallback, wwwForm);
}