I finally figured it out! It was an extremely frustrating task because
all the documentation was wrong...but here is what I found worked for
me to access the persistent app data for the user (Viewer):

when setting the data i did this:
req.add(req.newUpdatePersonAppDataRequest("VIEWER", data, "foo"));

NOTE: the second param is actually the one where you have to put your
data!! in fact, the last param, "foo" doesn't really do anything, just
put any string there. When i tried removing the third param all
together the request did not work, so make sure to put some value
there.

When accessing your app data do the following:
var fields = "*";
req.add(req.newFetchPersonAppDataRequest(viewer, fields), 'dataKey');
req.send(callbackAfterGettingData);
NOTE: for the fields I simply used an asterick to tell orkut to return
all fields for the user's app data.

In your callback function do the following:

stringData = data.get('dataKey').getData()[me.getId()]["VIEWER"];
userAppData =
gadgets.json.parse(gadgets.util.unescapeString(stringData));

NOTE: use the 'dataKey' you specified in your earlier function, then
use the user's open social id to access their app data and finally ALL
of the user's data is stored in an object property called "VIEWER".
Once you access the VIEWER property you will get back all the data you
stored!


I hope this saves someone else loads of time!

(btw, the steps above are for Orkut using OpenSocial API v0.8)

On Oct 13, 2:26 pm, anatoly <anato...@gmail.com> wrote:
> same here, persistent data doesn't work on profile view
>
> please check it out
>
> On Oct 13, 9:16 pm, sunnydiv <sunny...@gmail.com> wrote:
>
> > my app is not picking up 'persistent data'
> > in PROFILE VIEW in production,
>
> > but picking it up
> > in PROFILE VIEW in sandbox
>
> > as always, i guess it will take 2 weeks for orkut team to pick this
> > issue up,
> > and then 2 weeks to fix it.
>
> > i am just beyond disappointed
>
> > On Oct 11, 7:28 pm, DevenH <dev...@gmail.com> wrote:
>
> > > Here is a link to the test version of the app:
>
> > >http://fb.peixeurbano.com.br/orkut/top-flavors-of-rio.xml
>
> > > you can find the external js here:
>
> > >http://fb.peixeurbano.com.br/orkut/js/common.js
>
> > > thanks!- Hide quoted text -
>
> > - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"orkut Developer Forum" group.
To post to this group, send email to opensocial-or...@googlegroups.com.
To unsubscribe from this group, send email to 
opensocial-orkut+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en.

Reply via email to