简体   繁体   English

使用适用于Facebook的“用户通知”图形API

[英]Using ''User Notifications" Graph API for Facebook

Since Graph API v2.3, the notification request have been deprecated. 从Graph API v2.3开始,通知请求已弃用。 I am new to using the API's and I was wondering how to use the POST edge request found here: https://developers.facebook.com/docs/graph-api/reference/user/notifications/ 我是使用API​​的新手,我想知道如何使用此处找到的POST边缘请求: https : //developers.facebook.com/docs/graph-api/reference/user/notifications/

More specifically, to retrieve the unread notification's for a user. 更具体地说,为用户检索未读的通知。

Here is the code I have so far: 这是我到目前为止的代码:

function getInfo() {
  FB.api("/me/notifications", function(response) {
    console.log(response);
  });
}

That endpoint is for sending notifications only, you can´t get the unread notifications anymore. 该端点仅用于发送通知,您不再能收到未读的通知。 And you need to use an App Token with an App Scoped ID for that call. 并且您需要为该调用使用具有应用程序范围ID的应用程序令牌。 You should not use an App Token client side, so sending notifications should always be done server side. 您不应该使用App Token客户端,因此发送通知应该始终在服务器端进行。

More information: https://developers.facebook.com/docs/games/services/appnotifications 更多信息: https : //developers.facebook.com/docs/games/services/appnotifications

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM