Get permission and start publishing on the wall of your Facebook page, separately from your user account?

Using the Nathan Totten C # Facebook SDK, how can I get permission to post to the Facebook page wall for the page ID they provide?

I have a C # SDK for working with Facebook, to allow users to log in using a Facebook account, as well as create their own walls. However, I want users to enter the Facebook page ID (of which they are the administrator), and then start posting on this wall.

When they click the login button through Facebook, if they have never logged in before it automatically asks for their permission. Not sure how to do this later, when the user has already granted permission for their profile information ... and I want to get permission for their page wall.

+4
source share
1 answer

In order to get FB permission to publish on the Page Wall, you need to grant permission to manage users.

For example: https://graph.facebook.com/oauth/authorize?client_id=123456789&redirect_uri=http://example.com/&scope=publish_stream,share_item,offline_access,manage_pages

Once the user has been allowed to manage the pages, he can post to the page.

For the FB button, you can try the following:

<fb:login-button onlogin="OnRequestPermission();"></fb:login-button> function OnRequestPermission(){ var myPermissions = "publish_stream, manage_pages"; // permissions your app needs FB.Connect.showPermissionDialog(myPermissions , function(perms) { if (!perms) { // handles if the user rejects the request for permissions. This is a good place to log off from Facebook connect } else { // finish up here if the user has accepted permission request }; }); } 

I personally have not tried the fb-login button, so I'm not sure if it works correctly.

+6
source

Source: https://habr.com/ru/post/1339040/


All Articles