Notifications using Graph API
Facebook recently made access to the user's notifications using the Graph API possible. Using the Graph API we should now be able to mark a notification as read.
I used the REST API to mark notifications as read before without any problems and now I would like to use the Graph API instead. I am making the following request:
[facebook requestWithGraphPath:@"notifications" andParams:para开发者_如何学运维ms andHttpMethod:@"POST" andDelegate:self];
And the params
dictionary will look like this:
{
id = xxxxxxxx;
unread = 0;
}
I am getting the following error:
OAuthException: (#3) Application does not have the capability to make this API call.
Does anyone have an idea why I might be getting this error?
The error was happened because I was using the notification_id
which FQL returned but it seems that the Graph API returns another type of ID. E.g. notif_xxxxxxxxxx_xxxxxxxxx
and the request should look like:
[facebook requestWithGraphPath:@"notif_xxxxxxxxxx_xxxxxxxxx" andParams:params andHttpMethod:@"POST" andDelegate:self];
With the params
dictionary being:
{
unread = 0;
}
Do you request the correct permission??
manage_notifications
Enables your app to read notifications and mark them as read.
This permission will be required to all access to notifications after October 22, 2011.
精彩评论