2012-11-01 49 views
0

我在facebook應用程序(iframe應用程序)中有一個Facebook粉絲大門,但它僅在使用管理員帳戶登錄時纔有效。當我在正常用戶的情況下測試沒有沙箱模式的應用程序時,他們卡在非粉絲部分,但他們是粉絲。 我檢查了頁面ID,它是正確的。 感謝您的幫助facebook粉絲大門只能使用管理員帳戶Javascript

 FB.getLoginStatus(function (response) { 
      if (response.status == 'connected') { 
       var user_id = response.authResponse.userID; 
       var page_id = "[pageid]"; 
       var fql_query = "SELECT uid FROM page_fan WHERE page_id =" + page_id + " and uid=" + user_id; 
       var the_query = FB.Data.query(fql_query); 

       the_query.wait(function (rows) { 

        if (rows.length == 1 && rows[0].uid == user_id) { 
         $("#container").show(); 
         $("#container_notlike").hide(); 
         $("#notloggedin").hide(); 
         alert("User like page") 

        } 

        else { 
         $("#container_notlike").show(); 
         $("#container").hide(); 
         $("#notloggedin").hide(); 
         alert("User NOT like page") 
         login(); 
        } 
       }); 
      } else { 
       $("#container_notlike").hide(); 
       $("#container").hide(); 

       $("#notloggedin").show(); 

       login(); 

      } 
     }); 

    } 
    init(); 
+0

有用戶授予您在'user_likes'許可,您將會收到通知Auth流? – Igy

+0

(你可以打電話給'/ me/permissions') – Igy

+0

謝謝你,你解決了我的問題! –

回答

相關問題