0

如何仅在当前使用的 facebook 应用程序的安装时间中使用 JS api?

一般来说,我想验证当前在线的用户是新用户,而不是尚未注册的返回用户。

4

1 回答 1

1

您可以按照这里FB.getLoginStatus的推荐使用它可以告诉您天气访问者是否已登录 facebook,如果是,他们是否已在您的应用程序中注册。

FB.getLoginStatus(function(response) {
  if (response.status === 'connected') {
    // the user is logged in and has authenticated 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 has not authenticated your app
  } else {
    // the user isn't logged in to Facebook.
  }
 });
于 2012-05-20T11:20:49.223 回答