开发者

Request Permission in Facebook iFrame Tab Page

开发者 https://www.devze.com 2023-02-12 13:15 出处:网络
Well, this doens\'t work. FB.Connect.showPermissionDialog(\"email,offline_access\", function(perms) { if (!perms) {

Well, this doens't work.

FB.Connect.showPermissionDialog("email,offline_access", function(perms) {
    if (!perms) {
        document.location.href='YouNeedToAuthorize.h开发者_如何学编程tml';
    } else {
    document.location.href='homePage.html';
    }
});

FB.Connect is undefined


Try

this.FB.Connect.showPermissionDialog("email,offline_access", function(perms) {
    if (!perms) {
        document.location.href='YouNeedToAuthorize.html';
    } else {
    document.location.href='homePage.html';
    }
});

Also make sure you have this towards the end of your page.

  <div id="FB_HiddenIFrameContainer"
       style="display:none; position:absolute; left:-100px;top:-100px; width:0; height: 0;">
    <script
    src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"
    type="text/javascript"></script>
    <script type="text/javascript">
    FB_RequireFeatures(["CanvasUtil","XFBML"], function(){
    FB.Facebook.init( "{{ API_KEY }}", "/fb/xd");
    FB.XdComm.Server.init("/fb/xd");
    FB.CanvasClient.startTimerToSizeToContent(); });
    </script>
  </div>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号