simonbs
simonbs

Reputation: 8042

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:params 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?

Upvotes: 0

Views: 3472

Answers (2)

simonbs
simonbs

Reputation: 8042

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;
}

Upvotes: 1

glarkou
glarkou

Reputation: 7101

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.

Upvotes: 0

Related Questions