Just to close this question: I've searched this forum for similar questions and it appears that this is the expected behaviour. As I was testing my app using a viewer user that didn't had the app installed, Orkut returned an null for viewer data, due to privacy issues, i believe.
I spite I agree that the viewer data should be protected from non- installed apps, It's strange that the method hadError() wasn't used to provide a better error handling. Best regards, Alex. P.s.: The topic I found: http://groups.google.com/group/opensocial-orkut/browse_thread/thread/656b86ccb7930a17/66977459391b414f?hl=en&lnk=gst&q=viewer+id+null#66977459391b414f) On Jul 5, 3:23 am, "Prashant (Google)" <[email protected]> wrote: > Hi Alex, > > Which environment (sandbox/production) are you testing this in? > > Prashant > > On Jul 4, 5:41 pm, Alex Porto <[email protected]> wrote: > > > Hum... Strange. It was working yesterday (I think. It was saturday night. I > > may not remember everything), and now, it's not. > > >owneris still returning correctid, but data.get("viewer").getData() is > > returning empty. > > > varowner= data.get("owner").getData().getId(); > > varviewer= data.get("viewer").getData().getId(); > > > Alex. > > > On Sat, Jul 3, 2010 at 9:08 PM, Alex Porto <[email protected]> wrote: > > > Hi Robson! > > > > It worked! I'm gonna try the opensocial-templates tomorrow, but theid > > > requests are working now. > > > > Thank you! > > > > And my regards to any group members from Argentina :-) > > > > Alex. > > > > On Sat, Jul 3, 2010 at 7:06 PM, Robson Dantas <[email protected]>wrote: > > > >> Try this, and let me know how it goes: > > > >> function callData() { > > > >> var req = opensocial.newDataRequest(); > > >> req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.VIEWER), > > >> "viewer"); > > >> req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.OWNER), > > >> "owner"); > > >> req.send(onRequest); > > >> } > > > >> function onRequest(data) { > > > >> varowner= data.get("owner").getData(); > > >> varviewer= data.get("viewer").getData(); > > > >> alert(owner.getId()); > > >> alert(viewer.getId()); > > > >> } > > > >> Theowneridis different from uid. It's ok. > > > >> Robson Dantas > > > >> 2010/7/3 Alex Porto <[email protected]> > > > >>> Gentlemen, > > > >>> I've noticed this issue: I can getviewerandownerid'susing > > > >>> req.add(req.newFetchPersonRequest("OWNER"), "get_owner"); > > >>> req.add( req.newFetchPersonRequest( 'VIEWER' ), 'get_viewer' ); > > > >>> And then, after the request data arrives, > > > >>> function dataAvailable(data) { > > >>> var ownerData = data.get('get_owner').getData(); > > >>> varowner= ownerData.getField( opensocial.Person.Field.ID); > > > >>> var viewerData = data.get('get_viewer').getData(); > > >>> varviewer= viewerData.getField( opensocial.Person.Field.ID); > > > >>> However, this code isn't working when theviewerisn't theowner. I.e.: > > >>> When I'm watching an app installed on my Orkut account, it return's ok. > > >>> But > > >>> when other users loads the app on my Orkut profile, the viewerData is > > >>> invalid. I can catch this by data.hadError(), but data.errorMessage() > > >>> returns undefined, as well as viewerData. > > > >>> Also, I noticed that theownerIdreturned in both cases is differente > > >>> from the uid present at Orkut URL. > > > >>> Any hint's about that? > > > >>> Thank you, > > > >>> Alex. > > > >>> -- > > >>> You received this message because you are subscribed to the Google > > >>> Groups > > >>> "orkut Developer Forum" group. > > >>> To post to this group, send email to [email protected]. > > >>> To unsubscribe from this group, send email to > > >>> [email protected]<opensocial-orkut%2Bunsubscrib > > >>> [email protected]> > > >>> . > > >>> For more options, visit this group at > > >>>http://groups.google.com/group/opensocial-orkut?hl=en. > > > >> -- > > >> You received this message because you are subscribed to the Google Groups > > >> "orkut Developer Forum" group. > > >> To post to this group, send email to [email protected]. > > >> To unsubscribe from this group, send email to > > >> [email protected]<opensocial-orkut%2Bunsubscrib > > >> [email protected]> > > >> . > > >> For more options, visit this group at > > >>http://groups.google.com/group/opensocial-orkut?hl=en. -- You received this message because you are subscribed to the Google Groups "orkut Developer Forum" 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-orkut?hl=en.

