Regards,
Back, when “Authenticated Referrals” not depreciated, if the user entered to my facebook application through the canvas url, was redirected to dialogue authorization (for permissions).
Now that do not exist the option, I must do it manually so you can redirect url through the canvas.
I am using Codeigniter for it and from what I see, facebook cancel any redirection I do.
Here is my code:
try {
$fb_id = $this->facebook->getUser();
if ($fb_id) {
$fb_data = $this->facebook->api('/me');
return $fb_data;
} else {
echo 'You don't give me the permissions';
$url = $url = $this->facebook->getLoginUrl(array(
'scope' => 'email,user_likes,user_about_me,publish_stream,user_birthday',
'redirect_uri' => $this->config->item('app_name')
));
header("location:$url");
redirect($url, 'refresh');
}
} catch (Exception $exc) {
echo $exc;
}
Is there a simpler way to do it? Any examples you can show me? Thanks in advance
NOTE: My application is a (for now) recorder audio for users
First is a registration with personal information.
Then show the recorder audio.
My target is when a new user find my application (apps.facebook.com/my_app), enter to my app and show automatically the oauth dialog for permission (as before). Then enter to the registration view.
This has nothing to do with codeigniter, just make sure that your
redirect_uriis your canvas page URL “apps.facebook.com/app_name“.And then use Javascript to redirect the user to the OAuth dialog with something like:
also check out the Canvas Tutorial.