I am having a problem with the Facebook GUI, which does not return anything for a request to receive custom notifications. I do this with a batch request, using the same syntax to get the user's news feed, and the news feed request is working fine. I also have permission to manage_notifications enabled. I always get a null pointer exception in my code when I try to parse the result of a graph call for notifications.
Please note that when I got into the chart explorer in my Internet browser and typed "me / notifications? Include_read = true", I get the corresponding data.
Here is the code for my request.
static Request notificationsRequest = Request.newGraphPathRequest(fbSession, "me/notifications?include_read=true", 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"; } } });
Any ideas? Thanks.
EDIT: I updated the code and found out that the GraphObject object is returning null, and why it cannot parse any of it. There seems to be something wrong with the graphical query, but I can't figure out what it is. As I said, the exact same method for getting news for users ("me / home") works fine.
source share