Hi Rush,

http://code.google.com/apis/opensocial/docs/javascript-0.6/reference/opensocial.DataRequest.html

VIEWER_FRIENDS isn't allowed: "the supported keys are VIEWER, OWNER, 
OWNER_FRIENDS, or a single ID within one of those groups"

Hopefully they'll change this eventually... or at least leave it up to 
the container.

There's also an error with fields/fields1 here:

var fields = ["flag"];                                                 
                             
 req.add(req.newFetchPersonAppDataRequest("VIEWER_FRIENDS", fields1), 
"friends_data");

-Dustin / www.iWiddit.com

rush wrote:
> Hi all,
>
> I want to add application data to each viewer friend. for this I m
> doing something like this:
>
> function requestMe()
> {
>     var req = opensocial.newDataRequest();
>     req.add(req.newFetchPersonRequest("VIEWER"), "viewer");
>     req.add(req.newFetchPeopleRequest("VIEWER_FRIENDS"),
> "viewer_friends");
>     var fields = ["flag"];
>     req.add(req.newFetchPersonAppDataRequest("VIEWER_FRIENDS",
> fields1), "friends_data");
>     req.send(handleRequestMe);
> };
> function handleRequestMe(data)
> {
>     var viewer = data.get("viewer");
>     var friendsdata_obj = data.get("friends_data");
>     var viewerFriends = data.get("viewer_friends").getData();
>     var friendsdata = friendsdata_obj.getData();
>     viewerFriends.each(function(person)
>     {
>         if(friendsdata[person.getId()]["flag"]!="true")
>       alert("true");
>         else
>       alert("false");
>     });
> };
>
> But it gives javascript error "friendsdata has no properties".
>
> m i wrong anywhere? I have no idea how to use it. Please help me.
> I also want to use newUpdatePersonAppDataRequest for the same to
> update the field.
> Please help me in this.
>
> Thanks
> Rush
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenSocial API Definition" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to