How to add an application to a page(which I have created) through API with Publish_stream permissions?
Here is the Sequence of things I have tried sofar using app. Adding App to a page using page access token code is adding app to page apps section but unable to add "publish_stream,manage_pages" permission.
For log in to Facebook
private const string Scope = "publish_stream,manage_pages";
FacebookClient _fb = new FacebookClient();
var fbLoginUrl = _fb.GetLoginUrl(
new
{
client_id = AppId,
client_secret = Appsecret,
redirect_uri = RedirectUri,
response_type = "code",
scope = Scope,
state = state
});
To get short lived access token
if (Request.QueryString["code"] != null)
code = Request.QueryString["code"];
var result = _fb.Post("oauth/access_token",
new
{
client_id = AppId,
client_secret = Appsecret,
redirect_uri = RedirectUri,
code = code,
scope = Scope,
response_type="token"
});
To get long lived access token
var result1 = _fb.Post("oauth/access_token", new { client_id = AppId, client_secret = Appsecret, grant_type = "fb_exchange_token", fb_exchange_token= Session["fb_access_token"] as string });
To get Page access Token
dynamic accounts = _fb.Get("me/accounts");
Add App to a Page using Page Access Token
var sResult = _fb.Post("<PAGE-ID>/tabs",
new
{
app_id = AppId,
access_token = <PAGE ACCESS TOKEN>,
scope = Scope
});
/{page}/tabs? that's the correct method of adding a tab and it seems like your code sample is correct - Igy