What's the difference among friends?

Friday, September 26, 2008 at 1:56 PM

I'm excited to announce that we've launched two important changes to the iGoogle developer sandbox. First, we have done a major upgrade on the sandbox friends manager that allows you to import, search and create groups of contacts. To share items with a contact, make sure you are in the iGoogle sandbox, and add a contact to the group called "Friends." If you already have the sandbox friends gadget installed, it should automatically upgrade. If not, you can add it here.

For development purposes, if you are sharing with friends in Google Reader, the same contacts in your "Friends" group in Reader will also be in your "Friends" group in the iGoogle sandbox. Your old sandbox friends will have to be added again to the "Friends" group.



In conjunction with the new sandbox friends manager, we are also changing what people and sharing calls return. You can now share content with contacts in your "Friends" group, even if those contacts have not added you to their "Friends" group. For example:
var req = opensocial.newDataRequest();
req.add(req.newFetchPeopleRequest("VIEWER_FRIENDS"), "friends");
req.send(response);

Will now return some friends with ids, and some friends without. Friends with ids are those who have you in their "Friends" group, while friends without ids do not.
function response(data) {
var friends = data.get("friends").getData();
friends.each(function(person) {
if (person.getId()) {
alert(person.getDisplayName() + " is a mutual friend.");
} else {
alert(person.getDisplayName() + " hasn't put you in their \"Friends\" group.");
}
});
};

When you post an update, it will be viewable to any person in your "Friends" group.

If you have any questions about these changes, feel free to contact us in the developer forum.