Hi Samir,
please try this code:
facebookClient29 = new DefaultFacebookClient("ACCESS_KEY"
, Version.VERSION_2_9);
Connection<Insight> insights = facebookClient29.fetchConnection(
"999577163512356/insights",
Insight.class,
Parameter.with("metric", "page_fan_adds_unique,page_fan_adds"));
int count = 0;
for (List<Insight> insightList : insights) {
for (Insight insight : insightList) {
LOG.info("Insight Id: " + insight.getPeriod());
LOG.info("Insight Title: " + insight.getName());
count++;
}
}
LOG.info("Total Insights: " + count);
This is not tested, but gives an idea how it should work. BTW if this is the solution (and I think so :)) you can drop a short note, because I add this important information to our documentation for other developers running in this problem.
Cheers
Norbert