Is there any way to retrieve or delete multiple Facebook request_ids in one Facebook Graph API call?
For example, if a user receives multiple requests from different people for the same app, they will be grouped as one notification and all the request_ids will be passed to the app as a comma separated list when the user accepts the notification. Is there any way to avoid having to loop through each one and individually retrieve/delete it?
Binyamin is correct that batch requests would probably work. However, I discovered that to fetch request data by request_ids, you can simply pass them as a comma separate list and avoid doing a batch request.
Your final graph URL wants to look like:
For the delete operation, I believe a batch operation is still required. When you get the request_id data back from FB from the above call, it will be an NSDictionary with each result_id as a key. You can look at each key and create a batch operation to delete them all.
Note that the current limit on batch requests is 50, per https://developers.facebook.com/docs/reference/api/batch/. So to be completely safe you should check the count of request_ids and if it is greater than 50, you will have to do multiple batch requests.