long newSyncTime = System.currentTimeMillis();
Date lastSyncDate = new Date(lastSyncTime);
for (String type : userDataTypes) {
IFacebookContentBuilder builder = createBuilder(type, accessToken);
builder.doSynchonization("me", lastSyncDate);
}
// get friends
IFacebookRESTClient fbClient = facebookClientFactory.createFacebookAPIClient(accessToken);
//List<User> friendList = fbClient.getUserFriends();
List<User> friendList = fbClient.getFacebookConnectionByID("me/friends", User.class);
// for each friend synch types: User, Post, Events, Status, Notes
for (User friend : friendList) {
for (String type : friendDataTypes) {
IFacebookContentBuilder builder = createBuilder(type, accessToken);
builder.doSynchonization(friend.getId(), lastSyncDate);
}
}
lastSyncTime = newSyncTime;
}