facebook permissions request without login button
I started a new facebook app with php-sdk 3.0 and I have a problem :
when the user comes on the app for the first time, he gets a page with just the facebook logo and a link "access facebook.com" even if the user is already connected to facebook ...
how can I skip this s开发者_StackOverflow社区tep ? without previous sdk , I was able to go the permissions request screen directly ?
The dreaded facebook blue box of death. It sounds like you're trying to do a redirect inside the app; try using javascript to do window.top.location.href = url;
instead.
First I have a question to clarify. Then some possible answers based on some assumptions about your question.
Are you writing a Website with Facebook integrated, or an App for facebook?
Im going to assume you are writing a website with facebook integration. If you look at the example that came with the new API you can see they are using $facebook->getUser();
This attempts to get the facebook User. You can get a facebook user, but they may not have a valid FB session, so to check this you want to use.
$facebook->api('/me/home');
If this returns information instead of an exception you have a user with a valid session. At this point attempting, using php's header() function you can redirect them to the page given to you by $facebook->getLoginUrl(); and they should just be taken to the permissions window and not required to log in.
However, If you do not check for a valid user before you attempt to get the login url im pretty sure the api assumes that there is no one logged in and forces them to the log in page first.
If on the other hand you are talking about creating an App for Facebook itself, I think the original poster had the proper answer.
精彩评论