2012-01-07 6 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. 
    } 
}); 
関連する問題