Utilizzando l'API JavaScript si vorrà utilizzare FB.getLoginStatus per avvolgere il tag di ancoraggio. Vedere https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/
Esempio da quella pagina:
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.
}
});
Nota: Vorrei semplicemente effettuare questa chiamata in anticipo e impostare la mia booleana variabile JS sulla risposta quindi non ho dovuto usare la chiamata API FB ancora. Quindi avvolgi qualsiasi codice dipendente con un semplice test booleano JS.
fonte
2012-02-09 20:11:14
Che cos'è questa iframe fb app? O sito autonomo? – serg
a questo punto non ha nulla a che fare con FB, proprio come qualsiasi processo di accesso autorizzato, se si ha una sessione valida procedere, altrimenti richiedere – ifaour