How to require Friends Online Presence as non-revocable permission on Facebook? - facebook

I would like a new user of my canvas app to grant the "friends_online_presence" permission.
On the FB manual page, this permission is listed among the "User and friends Permissions" which should appear on the first page of the registration dialogue and should be non-revocable.
However, Facebook does the opposite - it redirects the user to the second page of the dialogue, where this permission is optional for the user.
If I try to make registration with other permissions from the list (i.e. friends_likes), it works as supposed - the permission is requested as non-revocable on the first screen.
Am I doing something wrong or this is actually a bug in their documentation?
Thanks!

Probably a bug in their documentation. You can however, check to see which permissions the user accepted. If you find they allowed your app, but not the friends permissions, you can give the user a specific screen telling them they can't use your app.

Related

How to mark a scope as required in Facebook OAuth2?

Is there a way to mark a scope such as publish_stream as required in Facebook OAuth2?
Currently a user can skip the permission and that results in a non working app in my example.
No you cant do that, in fact facebook asks to check for the extended permissions before performing any related action.
You can any time check for the permissions a user has granted with the API- /me/permissions. Check out- Graph API Explorer
There's no way to "require" extended permissions such as publish_stream as far as I know. Facebook has some docs about how to handle those cases where the user only gave some permissions:
https://developers.facebook.com/docs/facebook-login/permissions/#handling
Quote:
If a person declines the login dialog have a clear and upfront
explanation about why you are requesting each permission. Then let
them click or tap to opt back in to the permission request dialog. Do
not immediately redirect them into a permission request dialog without
an explanation.
For cases where someone has granted some permissions but not others,
only prompt for missing permissions at the point at which they are
needed. For example, if your app contains functionality which creates
an event on behalf of a person, only prompt for create_event
permission whenever they choose to add the event to Facebook.
Unless the permissions you are requesting in the login dialog are
critical to the functionality of your app and a feature doesn't work
without them, let people continue using your app without the
permissions.

Facebook App - Prompt permission to post

I have created an app. It does not prompt users to Post on Wall permission, after the GO to App popup. I have given the following settings for my app in developer account.
User & Friend Permissions: email,user_activities,user_likes,publish_actions
Extended Permissions: publish_stream,read_stream,offline_access
When i click a "Preview Login Dialog" link, it shown the following rights in "GO to App" popup.
THIS APP WILL RECEIVE:
Your basic info
Your email address
Your activities
Your likes
But, when i access the app at the first time, it shown the following rights alone.
THIS APP WILL RECEIVE:
Your basic info
Due to this, i could not post on well. I have checked.
Similarly, i have checked user's app setting page.
User account has no option like the below.
* Post on your behalf
* Access posts in your news feeds
What is wrong? I spent more than 3 hours to find out.
Be sure that you have expected permissions set in the scope parameter of method invoking the login dialog:
FB.login(function(response) {
// handle the response
}, {scope: 'email,user_activities,user_likes,publish_actions,etc...'});
And just in case, to be sure that you will have needed permissions before doing something that needs them, try handling revoked premissions, as I pointed here.
BTW, be sure to request only permissions your app really needs. You can scare users with so many permissions. ;)

Can we show Facebook permission Dialog Directly(my app is already authorized)

Basically I want to check the extended permissions the user has granted my app.
If any one permission that I want is not given by the user, Then I want the user to be redirected to facebook permission Dialog(Not the oauth dialog which comes first).
Is it possible to do that using php or js sdk(php preferred).
Then I want the user to be redirected to facebook permission Dialog(Not the oauth dialog which comes first).
First of all, there’s a misunderstanding on your side here: That is only one dialog, it’s only split into two pages where appropriate.
So when asking for (more) extended permissions, you just call the OAuth dialog the normal way (getLoginURL in PHP SDK, FB.login from the JS SDK) – if the user has already authorized your app and only new extended permissions are required, then only the second page of the dialog is shown automatically.

Automatically activate users' timeline on login

I am using the JavaScript SDK to login in the user on my website via Facebook, requiring the publish_actions permission. If I am getting it right, Open Graph stories published by using publish_actions are only visible for users who have their timeline enabled.
Is it possible to automatically activate the users' timeline after he logged in to my application and gave me the publish_actions permissions. I've seen authentication dialogs around the web where applications request the publish_actions permission and after granting the permission and logging in, the user automatically has the new timeline enabled.
I already searched a lot, but unfortunately I could not find anything in the developer documentation about how to do that.
How do I accomplish this?
If you request the publish_actions permission from the user and you have the action approved by Facebook, the message you talk about will appear in the login popup. Facebook automatically adds this message in as the features are only available with the new timeline profile. There isn't a setting you need to configure to add this message in.
What you describe is the intent of modifying user settings, and you can't do that.

Facebook permissions

Suppose I have a website that wants to access a Facebook's user account information. Usually, the user is presented with all the permissions the website is asking for, and can either allow or deny them as a whole.
Is it possible to let the user choose (with checkboxes on each permission on the authorization screen, for example) which permissions he wants to give the website?
This would be possible but it would need to be done in two stages.
Firstly you would have to present the user with your own dialog where they can choose their prefered permissions.
Secondly you would have to authorise the user with the selected permissions via a Facebook dialog.
If you're looking for an example the Facebook Graph Explorer already does this:
http://developers.facebook.com/tools/explorer/
The bigger issue would be keeping track of the users available permissions and reacting according.
unfortunatly not out of the box. (but this could be changed sometime in the future, as FB displays a required next to the rights if you look on the rights you give to an app)
I used to ask the required prems, and let the user add optional perms via a click, which again opens the perm dialog but only with the perms the user not already give to the site.
for an example. user sign in form, beside the "Hometown" field i have a button "Fill from facebook" if user hasn'T given me that right to access user_hometown i call for the right and fill the form.
see this post for a good explanation on the why and how:
http://www.fb-developers.info/tech/fb_dev/jssdk/learning_jssdk_12.php