I have an application that has a "share" button which posts a feed to user's wall. To provide this I request "publish_stream" permission when user enters the application. But this permission is not needed to use the other functionalities of the application. Therefore I only need to request the "publish_s开发者_运维技巧tream" permissiob when usr clicks "Share" button. Is this possible?
Regards, Baris
Ofcourse. Let's say most of your application's actions use "user_about_me,email" permissions smth like this:
[CanvasAuthorize(Permissions = "user_about_me,email")]
public ActionResult About()
{
return View();
}
Facebook will ask the user for these permissions (redirect to "Request for permission" page), when ie. About is accessed. Once accepted, your app will have these permissions granted, for all other actions as-well. When the user then goes to an action that's requires "publish_stream", fb will redirect to the "Request for permission" page, asking for additional permissions for your app.
[CanvasAuthorize(Permissions = "publish_stream")]
public ActionResult Invite()
{
return View();
}
It's up to you to whether grant all permissions at once, or as needed.
Hope this answer you questions :)
Best regards, Szymon
精彩评论