2010-12-03 110 views
0

我想FB:手機網絡登錄按鈕的工作,一拉:http://developers.facebook.com/docs/guides/mobile/的Facebook FB:登錄按鈕用於移動網絡

不過,我不知道在哪裏添加以下代碼:&display=touch

我FBML是標準:

<fb:login-button autologoutlink='true' perms='user_about_me,email'></fb:login-button> 

<div id="fb-root"></div> 
<script> 
    window.fbAsyncInit = function() { 
     FB.init({ appId: 'XXXXXXX', status: true, cookie: true, xfbml: true }); 
     FB.Event.subscribe('auth.login', function() { 
      location.href = "...."; 
     }); 
    }; 
    (function() { 
     var e = document.createElement('script'); 
     e.type = 'text/javascript'; 
     e.src = document.location.protocol + 
     '//connect.facebook.net/en_US/all.js'; 
     e.async = true; 
     document.getElementById('fb-root').appendChild(e); 
    }()); 
</script> 

任何想法?

回答

1

我很肯定你不能使用FBML標籤來移動web應用程序。至少,他們不會接受display=touch的說法。

這意味着你將需要使用稍微複雜的OAuth實現它們所描述的http://developers.facebook.com/docs/guides/mobile/

它還挺有道理的,如果你想想看。 FBML標籤通常依賴彈出窗口或覆蓋圖,您無法真正確定它將與所有移動瀏覽器兼容。 OAuth實施將帶您進入FB頁面,並將您返回主機站點以進行身份​​驗證和授權。