0

I need my app to request the offline_access permission (detailed here), but as ever I'm baffled by the Facebook documentations.

It says I need a comma separated list of my permission demands, like 'publish_stream,offline_access' etc

where do i put this list in the interface below????

alt text

Haroldo
  • 36,607
  • 46
  • 127
  • 169
  • can you show us your front-end code (where you ask the user to login)? both answers are correct but based on your code you might want to use a different approach – ifaour Jan 14 '11 at 12:52
  • it's a single user app, it requires the user to be logged in. Think i found the solution here: http://stackoverflow.com/questions/1059640/facebook-offline-access-step-by-step will update this post once i have thoroughly tested that solution... – Haroldo Jan 14 '11 at 13:14

3 Answers3

2

It's used with the API, as follows

$facebook = new Facebook(array(
    'appId'  => FACEBOOK_APP_ID,
    'secret' => FACEBOOK_SECRET,
    'cookie' => false,
));

$facebook_login_url = $facebook->getLoginUrl(array(
    'next' => '',
    'cancel_url' => '',
    'req_perms' => 'email,publish_stream,status_update'
));

Where $facebook_login_url is the URL tha the user needs to follow to grant you access.

Does that help?

Matt Lowden
  • 2,586
  • 17
  • 19
0

You can't do this with that interface. You need to set scope parameter when redirecting user to facebook.

x=y&scope=email,user_about_me,user_birthday,user_photos,publish_stream,offline_access
navruzm
  • 503
  • 3
  • 7
0

First define which permissions you will need:

$par['req_perms'] = "friends_about_me,friends_education_history,friends_likes,friends_interests,friends_location,friends_religion_politics,
     friends_work_history,publish_stream,friends_activities,friends_events,
    friends_hometown,friends_location,user_interests,user_likes,user_events,
    user_about_me,user_status,user_work_history,read_requests,read_stream,offline_access,user_religion_politics,email,user_groups";
$loginUrl = $facebook->getLoginUrl($par);

Then, check if the user has already subscribed to app:

$session = $facebook->getSession();
if ( is_null($session) ) {
    // no he is not
    //send him to permissions page
    header( "Location: $loginUrl" );
}
else {
    //yes, he is already subscribed, or subscribed just now
    echo "<p>everything is ok";
    // write your code here
    }
cuneyt
  • 336
  • 5
  • 15