Well, I'm not sure this is the best way, but this is how I've been doing it since I haven't figured out how to iterate through the maps.
The data comes back as a map object per the spec (for newFetchPersonAppDataRequest) "When processed, returns a Map<PersonId <http://code.google.com/apis/opensocial/docs/javascript/reference/opensocial.DataRequest.PersonId.html>>, Map<String, String>> object." So in your example you should be able to access the data by using data[personID]["dataKeyName"]. Like I said I haven't figured out how to iterate through these, so in order to grab the data for say "OWNER_FRIENDS" I first make sure I have a list of owner friends ( from newFetchPeopleRequest ) and then iterate through them and check to see if a corresponding value exists in my appdata object. So I would do something like this: ownerFriends = ( get a list of friends using newFetchPeopleRequest then get("key").getData() ) data = ( as you described below, a returned object from newFetchPersonAppDataRequest ) ownerFriends.each( function(aPerson){ // note that each is a function of collection which is returned by newFetchPeopleRequest if( data[aPerson.getId()] != null ) { // do something with data... can be accessed using data[aPerson.getId()]["dataKey"] } }); This works for me for now, but I'd be in anyone's debt who could explain map iteration. [EMAIL PROTECTED] wrote: > In testing, I verified that friends can indeed see each other's person > app data, so that's good. It would've been a little crazy having to > use global app data for everyone, I'm glad that provision was in > there. > > I am having a bit of an issue with using the returned data, though. I > can verify using firebug that it's coming through, and that it's > correct, but I can't seem to figure out how to display it on the page. > In my handler function, I get the response item from the response data > (using data = response.get(key)), and pull the object out of the > response data (using theobject = data.getData()), but I can't get the > actual string value of theobject to display. If anyone could give me > some advice, I'd appreciate it. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "OpenSocial API Definition (was OpenSocial Developers)" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/opensocial-api?hl=en -~----------~----~----~----~------~----~------~--~---
