获取Facebook应用安装时间戳

时间:2012-05-20 10:12:54

标签: javascript facebook api facebook-graph-api

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

一般情况下,我想验证当前在线的用户是否为新用户且尚未注册的返回用户。

1 个答案:

答案 0 :(得分:1)

您可以使用FB.getLoginStatus推荐here它可以告诉您天气访问者登录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.
  }
 });