Asking for permission using new PHP SDK (3.X.X)
问题 How can I ask for permissions using new PHP SDK? I don't want to use the graph api and parse the url all the time. When the application is opened it should automatically ask for permissions if the user hasn't granted one already. 回答1: Here's how i'm doing it with the latest PHP SDK (3.0.1) // init new facebook class instance with app info (taken from the DB) $facebook = new Facebook(array( 'appId' => 'YOUR APP ID', 'secret' => 'YOUR APP SECRET' )); // get user UID $fb_user_id = $facebook-