How to check whether profile Id permissions and accordingly redirect to authorize page using Facebook.Rest.Api? -


For a given profile ID, I must post a message from my site. I've created a Facebook app using the Facebook.Rest.Api API. I succeeded in posting, but for id who are not authorized I want to redirect to authorize the login page.

  (window.top.location.href = "https: //www.facebook com / dialog / oauth? Client_id = xxxxx and redirect_uri = http: //XXXX.com& Space = publish_stream ";)   

I am checking that the user has already given permission to use Facebook Connect, and then using the above code to show the login ID , Whenever profile ID is not allowed. So I hope to login page, but rather bypasses it and shows the redirect URL.

If I try differently without having to connect to Facebook for permission, then it works fine Does anyone know of any solution?

So SDK / Facebook knows that when the user asks for permission, you pass in perms setting Do something by doing if you need to post it there, so allow the canvas accrual to "publish_stream" the same way.

  var auth = new CanvasAuthorizer {perms = "user_about_me, publish_stream"};   

Then it is a matter of investigation that the user authorizes that access.

  if (auth.Authorize ()) {var client = new FacebookClient (auth.Session.AccessToken); Dynamic parameters = new ExpandoObject (); Parameters.message = "test the application message"; Parameters.link = "http://www.example.com/article.html"; Parameters.picture = "http://www.example.com/article-thumbnail.jpg"; Parameters.name = "test the application paragraph title"; Parameters.caption = "test app caption for links"; Parameters.description = "Check the link's long description of the link"; Parameters.actions = New {name = "View on Zombo", link = "http://www.zombo.com",}; Dynamic result = client.Post ("me / feed", parameter); } Else {// What to do if the user does not publish permit}    

Comments