即使删除正常返回,Facebook 应用程序邀请通知也不会消失
我有一个 Facebook 应用程序,并且运行得足够好,用户可以邀请朋友,但我似乎无法删除通知。
我在 python 中,在 Django 中,使用 urllib 来发出删除请求:
conn = httplib.HTTPSConnection('graph.facebook.com')
user = request.facebook.user
t = urllib.quote(user.oauth_token.token)
conn.request("DELETE", '/%s_%s?access_token=%s' %(request_id, uid, t))
print(conn.getresponse().reason)
所以我得到“OK”作为 .reason,但通知并没有消失。
我做错了什么?
I have a facebook app and have it working far enough that users can invite friends, but I can't seem to delete the notifications.
I'm in python, on Django, using urllib to issue the delete request thusly:
conn = httplib.HTTPSConnection('graph.facebook.com')
user = request.facebook.user
t = urllib.quote(user.oauth_token.token)
conn.request("DELETE", '/%s_%s?access_token=%s' %(request_id, uid, t))
print(conn.getresponse().reason)
So I'm getting "OK" back as the .reason, but the notifications aren't going away.
what am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该注意到FB返回的request_id有时有很多ID。例如,如果 2 个或更多朋友邀请您使用某个应用程序,Facebook 可能会将这些 request_id 连接到一个字符串。 request_id 参数的格式可能是“A_FacebookId,B_FacebookId”。
您必须拆分参数才能检索正确的 ID,并一一删除。到目前为止,它对我来说效果很好。
You should notice that the request_id returned by FB sometimes has many IDs. For example, if 2 or more friends invite you to use an application, Facebook may join those request_id to one string. The request_id params may have the format
"A_FacebookId,B_FacebookId
".You must split the parameters to retrieves the correct id, and delete them one by one. So far it works well for me.