2012-01-07 91 views
0

我有一个运行在iframe中的facebook应用程序。当有新用户进入时,它会要求获得所需的权限,并让用户登录以进一步使用该应用程序。如何为iframe应用创建“欢迎页面”?

现在我想把欢迎页面放在用户可以放入“邀请代码”,如果用户是新的,否则目前的流程要求许可将遵循。

所以我的问题是每次有用户进来时我怎么才能在他实际浏览权限对话框之前向他显示一个页面?

让我知道,如果这个问题对你们其他人有意义,我会进一步解释可能与步骤。

-deepak

回答

0

使用JavaScript SDK和调用FB.getLoginStatus(https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/)来确定用户是否已经验证过了到您的应用程序。

FB.getLoginStatus(function(response) { 
    if (response.status === 'connected') { 
    // the user is logged in and connected to your 
    // app, and response.authResponse supplies 
    // the user's ID, a valid access token, a signed 
    // request, and the time the access token 
    // and signed request each expire 
    var uid = response.authResponse.userID; 
    var accessToken = response.authResponse.accessToken; 
    } else if (response.status === 'not_authorized') { 
    // the user is logged in to Facebook, 
    //but not connected to the app 
    } else { 
    // the user isn't even logged in to Facebook. 
    } 
});