facebookunity-game-enginefacebook-unity-sdk

How to update permissions for posting pictures to Facebook


I develop a game with unity3d, I've integrated facebook's unity3d-SDK. At login, I used

public void LoginFB()
{
    var perms = new List<string>() { "public_profile", "email","user_friends"};
    FB.LogInWithReadPermissions(perms, AuthCallback);
}

But when I take a screenshot to post to facebook using :

FB.API("me/photos", HttpMethod.POST, ScreenshotSharePostCallBack, wwwForm);

The callback result said : 403 forbidden.

So I want to update the Permissions, but I have no idea about how to update it.

when I added the follow on the share button

FB.LogInWithPublishPermissions(new List<string>() { "publish_actions" }, callback : PublishActionsDone);

the app crashed.

Please tell me how to update the permissions when user click the button of sharing ,and how to open share dialog when using FB.API(.....). Thanks !


Solution

  • This doens't work anymore. You have to use FB.ShareLink() now. which doesn't require any permission like "publish_actions" anymore. This now what Facebook prefers. BTW I forgot to mention you have to build it in order for it to work and see the results. :D

    https://developers.facebook.com/docs/unity/reference/current/FB.ShareLink