0
我正在开发Android应用程序,我需要能够定期获取用户有多少条未读通知,并将其显示在我的应用程序中。获取Facebook通知API 3.0
我相信这在3.0 API中并不是直截了当的。
有人可以请解释一下最好的方法吗?
我使用这个代码:
Request notificationsRequest = Request.newGraphPathRequest(
Session.getActiveSession(), "/me/notifications",
new Request.Callback() {
@Override
public void onCompleted(Response response) {
GraphObject object = response.getGraphObject();
if (object != null) {
notifications = object.getProperty("data")
.toString();
} else {
notifications = "Notifications returns null";
}
}
});
但它返回null
。