我正在整合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