我正在整合Facebook连接在我的网站使用PHP SDK ..一切工作正常,除非我想,而不是重定向到Facebook身份验证,我想打开OAuth对话框..目前Im使用以下URL验证..它重定向至Facebook,但不开放的OAuth Dailog ..在Facebook的PHP SDK中打开身份验证对话框
https://www.facebook.com/dialog/oauth?client_id=XXXXXXXXXXX&redirect_uri=http%3A%2F%2Fwww.setsail2nz.com.au%2Fmicrosite%2Ffbalbums.php%3Fpid%3D1&state=ad89eddd7f71e7337785f604710c97e8&scope=user_photos%2Cpublish_stream%2Cmanage_friendlists%2Cemail&display=popup
任何想法?
编辑: 我知道如何做到这一点与Facebook的JS SDK ..但有没有办法做到这一点与PHP?
编辑2:好了,现在即时通讯使用JS SDK,但仍然它不是打开对话框。这里是我的代码
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'XXXXXXXXXX', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
oauth : true // enables OAuth 2.0
});
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
function fblogin()
{
FB.login(function(response)
{
alert(response);
},{perms: "user_photos,publish_stream,manage_friendlists,email"});
}
</script>
您可以使用JS-SDK这一点。 – 2012-03-24 13:26:53
是的,我知道的JavaScript ..但有没有办法用PHP Sdk做到这一点? – casper123 2012-03-24 14:30:30