gpt4 book ai didi

javascript - 如何检查用户是否已接受我在 Facebook 中的申请请求?

转载 作者:行者123 更新时间:2023-11-28 21:11:08 24 4
gpt4 key购买 nike

我使用以下方法发送我的应用程序请求

function sendRequest() {
FB.ui({method: 'apprequests',
message: 'You have received a pretty image from a friend.',
data: 'some tracking info',
title: 'Select friends to send your image to.'}, function (response) {

if (response && response.request_ids) {

$(function(){
//get friends who accepted the request

} else {

//Do something if they don't send it.

}
})
}

但是,我不知道如何检查是否有 friend 接受了请求?知道怎么做吗?我还想在用户接受请求时收到通知...我该如何实现这一点?

最佳答案

您需要保存response.request_ids,然后您可以使用打开的图表来查询有关这些请求的信息。使用应用程序登录获取访问/身份验证 token ,然后查询图形 API:

https://graph.facebook.com/[request_id]?access_token=[ token ]

但即使不这样做,您也应该只记录用户在单击“邀请”时做出的响应。 Facebook 在 URL 中传递 request_ids 参数。当用户访问您的应用程序时,您应该检查这一点。然后您可以更新用户响应请求的信息。

关于javascript - 如何检查用户是否已接受我在 Facebook 中的申请请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8623498/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com