如何在Facebook上清除应用邀请通知? [英] how can I clear the app invite notification on Facebook?

查看:223
本文介绍了如何在Facebook上清除应用邀请通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 API 发送通知请求时,它们以预期。但是,在用户跟随链接并接受App权限之后,通知仍然存在。

When I use the API to send notification requests, they arrive as expected. However after the user follows the link and accepts the App permissions, the notification persists.

是否有额外的电话需要清除通知?我知道一段时间后自动过期,但这似乎并不令人满意。我不知道有什么东西,还是这真的不行吗?

Is there some additional call I need to make to clear the notification? I know it auto expires after some time, but that doesn't seem entirely satisfying.

推荐答案

这是您在用户接受应用邀请时删除应用请求的方式。

This is how you delete app request when users accept an app invitation.

当用户接受邀请,即通过点击应用请求通知到您的应用程序画布页面时,Facebook会在request_ids参数中发送逗号分隔的ids。您可以使用这样的图形API获取此请求并将其删除:

When user accepts an invitation i.e. comes to your application canvas page by clicking on app request notification, Facebook sends comma separated ids in "request_ids" parameter. You can get this requests and delete it using graph api like this :

在此我删除最后一个请求ID:

Here I am deleting the last request id :

$ids = $_GET['request_ids'];
$id_arr = explode(",",$ids);
$count  = count($id_arr);
$delete_url="https://graph.facebook.com/".$id_arr[$count-1]. "?access_token=" . $token . "&method=delete";
$result = file_get_contents($delete_url);
echo("Requests deleted (true or false) ?" . $result);

如果多次请求request_ids字段可能包含多个请求ID。我不确定,但您可能需要全部删除。

Note request_ids field may contain multiple request id if he has been invited multiple times. I am not sure but you may need to delete all.

这篇关于如何在Facebook上清除应用邀请通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆