使用新的Facebook請求對象只給出一個ID。如何識別接受通知請求的用戶
如果用戶邀請使用Multi Friend Finder的許多朋友,則只會給出一個請求ID。
然後,當受邀用戶轉到其Facebook頁面並接受請求時,會使用相同的請求ID。
現在我無法確定這個用戶是誰,因爲所有受邀用戶都有相同的請求ID。
如何訪問用戶的ID?
更新:
我明白,我必須要求用戶批准我的申請。我有下面的代碼,以確定用戶是否已經授權我的應用程序:
FB.init
(
{
appId : "<%=APPLICATION_ID%>",
status : true,
cookie : true,
oauth : true
}
);
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
alert('connected');
var uid = response.authResponse.userID;
var accessToken = response.authResponse.accessToken;
alert(uid)
} else if (response.status === 'not_authorized') {
alert('notconnected');
// the user is logged in to Facebook,
//but not connected to the app
**//here need to get authorization for the application**
}
});
我如何獲得授權對話框來在Facebook的?
我保存了發送請求的用戶的數據。但是,當用戶點擊請求通知時,我只會收到請求標識號FB用戶標識。在Facebook爲每個用戶生成不同的請求ID之前。如果它只有一個請求ID,那麼我需要能夠識別誰點擊了他們的請求通知。 – chell 2012-01-18 11:35:21
正如我所說:**你應該讓他連接你的應用程序**。看到我更新的答案... – 2012-01-18 11:59:39
這正是我所做的。感謝Juicy Scripter。尼斯名字順便說一句。 – chell 2012-01-19 08:29:12