जावास्क्रिप्ट एपीआई का उपयोग करके आप एंकर टैग के चारों ओर लपेटने के लिए 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.
}
});
नोट: मैं बस सामने यह कॉल करने के लिए और प्रतिक्रिया पर अपने खुद के जे एस चर बूलियन सेट होता तो मैं अमेरिकन प्लान API कॉल का उपयोग करने नहीं था फिर। फिर किसी भी आश्रित कोड को एक साधारण जेएस बूलियन परीक्षण के साथ लपेटें।
स्रोत
2012-02-09 20:11:14
यह क्या है, iframe fb ऐप? या स्टैंडअलोन साइट? – serg
इस बिंदु पर एफबी के साथ इसका कोई लेना-देना नहीं है, बस किसी भी अधिकृत पहुंच प्रक्रिया की तरह, यदि आपके पास वैध सत्र आगे बढ़ता है, अन्यथा संकेत दें – ifaour