I’m trying to create a facebook login url using Facebook PHP SDK (v.3.2.0) from
https://github.com/facebook/facebook-php-sdk
below is my code
$config = array( 'appId' => '***',
'secret' => '***',
'cookie' => true
);
require_once("facebook.php");
$facebook = new Facebook($config);
$params = array('scope' => 'user_birthday, user_location, email',
'redirect_uri' => "http://my_domain.in/user/fb",
'display' => 'popup'
);
$loginUrl = $facebook->getLoginUrl($params);
the problem is when the loginUrl is clicked it will give error from facebook as below:
API Error Code: 100 API Error Description: Invalid parameter Error
Message: Display type popup. isn’t valid on http://www.facebook.com. You
should access a different domain (m.facebook.com, http://www.facebook.com),
or use one of the following supported display types: page, popup,
iframe, touch, none
the question is where did i go wrong?
fyi, the very same code were fine before, somehow it’s not working now, i kinda missed when the problem actually happen at first, but in between i did upgrade the facebook-php-sdk from 3.1.1 to 3.2.0, n possibly the domain and url settings in my facebook app.
app domain : my_domain.in
site url : http://www.my_domain.in
furthermore,
even my i changed the params into
$params = array('scope' => 'user_birthday, user_location, email',
'redirect_uri' => "http://my_domain.in/user/fb"
);
i still receive an error with different message
API Error Code: 100
API Error Description: Invalid parameter
Error Message: Unsupported scope: ‘email.’. Supported scopes: ads_management create_event create_note email export_stream friends_about_me friends_activities friends_birthday friends_checkins friends_education_history friends_events friends_games_activity friends_groups friends_hometown friends_interests friends_likes friends_location friends_notes friends_online_presence friends_photo_video_tags friends_photos friends_questions friends_relationship_details friends_relationships friends_religion_politics friends_status friends_subscriptions friends_videos friends_website friends_work_history manage_friendlists manage_notifications manage_pages offline_access photo_upload publish_actions publish_checkins publish_stream read_friendlists read_insights read_mailbox read_page_mailboxes read_requests read_stream rsvp_event share_item sms status_update user_about_me user_activities user_birthday user_checkins user_education_history user_events user_games_activity user_groups user_hometown user_interests user_likes user_location user_notes user_online_presence user_photo_video_tags user_photos user_questions user_relationship_details user_relationships user_religion_politics user_status user_subscriptions user_videos user_website user_work_history video_upload xmpp_login
please help,
thanks.
SOLVED.
the problem was there was an additional character (a dot) in my href attribute,
as coded below
noticed it after reviewing again the error message (popup*.* email*.*).
it simply worked when i removed the character.
so it is not caused by the facebook-php-sdk version nor the domain/url settings in my facebook app.
sorry for any trouble caused.