While the other answers are useful, what I was looking for was an example of Android code. I realized this and posted it here. The code below receives registered and / or authenticated user notifications.
//Initialze your Facebook object, etc. Facebook _facebook = ... ... Bundle bundle = new Bundle(); bundle.putString(Facebook.TOKEN, _accessToken); String result = _facebook.request("me/notifications", bundle, "GET");
Then you need to parse the string "result". This is in json format. Here is an example of how it would look:
JSONObject jsonObjectResults = new JSONObject(result); JSONArray jsonNotificationDataArray = jsonObjectResults.getJSONArray("data"); for (int i=0;i<jsonNotificationDataArray.length();i++) { JSONObject jsonNotificationData = jsonNotificationDataArray.getJSONObject(i); if (_debug) Log.v("Title: " + jsonNotificationData.getString("title")); }
I hope other people find this useful.
source share