Your syntax is correct, but orkut does not allow applications to write
to any other user's app data other than that of the current user. This
prevents me from overwriting another user's data and with potentially
malicious content. Your app should still be able to fetch OWNER data,
but you will only be able to write to the VIEWER's data store.

- Jason

On Oct 14, 3:29 am, hwked <[EMAIL PROTECTED]> wrote:
> Just to add. Data retrieval using "
> req.add(req.newFetchPersonAppDataRequest("OWNER",'twitterid'),'userdata');
> " works fine.
>
> The problem occurs in "
> req.add(req.newUpdatePersonAppDataRequest("OWNER",'twitterid',twit_id));
> "
>
> However, if I replace OWNER with VIEWER in the above statement, it
> works fine. i.e.
>
> "
> req.add(req.newUpdatePersonAppDataRequest("VIEWER",'twitterid',twit_id));
> " works fine.
>
> What am I doing wrong?
>
> On Oct 14, 3:19 pm, hwked <[EMAIL PROTECTED]> wrote:
>
> > Ah I just tried this, and it worked out.
>
> > If I replace "OWNER" with "VIEWER" everywhere, it works out. Why isn't
> > it working for OWNER ??
>
> > On Oct 14, 9:05 am, hwked <[EMAIL PROTECTED]> wrote:
>
> > > It doesn't seem to be working for me. Neither at sandbox.orkut.com nor
> > > at prod.sandbox.orkut.com . I already tried clearing my browser cache
>
> > > here is the relevant piece of code:
>
> > > function storeSettings()
> > > {
> > >         var req = opensocial.newDataRequest();
> > >         var twit_id = "ahujaankit";
>
> > > req.add(req.newUpdatePersonAppDataRequest("OWNER",'twitterid',twit_id));
> > >         req.send(onStoreSettings);
>
> > > }
>
> > > function onStoreSettings(data)
> > > {
> > >         if(data.hadError())
> > >         {
> > >            alert("Data Couldn't be Stored!");
> > >         }
> > >         else
> > >         {
> > >            alert("Data Stored!");
> > >         }
>
> > > }
>
> > > function loadSettings()
> > > {
> > >         var req = opensocial.newDataRequest();
> > >         req.add(req.newFetchPersonRequest("OWNER"),'owner');
>
> > > req.add(req.newFetchPersonAppDataRequest("OWNER",'twitterid'),'userdata');
> > >         req.send(onLoadSettings);
>
> > > }
>
> > > function onLoadSettings(data)
> > > {
> > >         var owner = data.get('owner').getData();
> > >         var owner_id = owner.getId();
> > >         var userdata = data.get('userdata').getData();
> > >         var twitid = null;
> > >         if(userdata[owner.getId()])
> > >         {
> > >                 var twitid = userdata[owner.getId()]['twitterid'];
> > >         }
>
> > >         if(twitid)
> > >         {
> > >                 twitter_id = twitid;
> > >                 getTweets();
> > >         }
> > >         else
> > >         {
> > >                 makeSettings();
> > >         }
>
> > > }
>
> > > Unfortunately, Data Couldn't be Stored is always displayed.
> > > Do you see anything wrong with this code? Please reply soon as I am
> > > stuck on this.
--~--~---------~--~----~------------~-------~--~----~
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-orkut@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to