Hi Ricardo,
On Which container you are working on ? looks like orkut has some solution for this problem. This snippets of code i have taken from orkut doc and may help you. for detail check this on - http://code.google.com/apis/orkut/docs/orkutdevguide.html function request() { var req=opensocial.newDataRequest(); req.add(req.newFetchPersonRequest("VIEWER"), "viewer"); req.send(response); }; function response(data) { var viewer = data.get("viewer").getData(); var profile_url = viewer.getField(opensocial.Person.Field.PROFILE_URL); var regex = /uid=([^&#]+)/; var result = profile_url.match(regex); if (result.length == 2) { var uid = result[1]; /* uid now contains the viewer's orkut UID */ } else { /* there was a problem getting the UID */ } }; request(); Thanks Avinash On 6/11/08, Ricardo <[EMAIL PROTECTED]> wrote: > > > Thanks Kumar! So if the guest of the profile (the viewer) doesn't have > the application I can't get her ID? > > > On 11 jun, 10:53, "Kumar Majethia" <[EMAIL PROTECTED]> wrote: > > Hi Ricardo, > > > > The viewer should have added the app to her profile in order for you to > get > > the ViewerID. That's how you distinguish viewers who have the app > installed > > vs those that don't. > > > > HTH > > KM > > > > -----Original Message----- > > From: [email protected] > > > > [mailto:[EMAIL PROTECTED] On Behalf Of Ricardo > > Sent: Wednesday, June 11, 2008 7:17 PM > > To: OpenSocial - OpenSocial Application Development > > Subject: [OpenSocial] Problems getting the viewer ID > > > > I'm having some problems determinating the viewer ID. When the owner > > of the application is visualizing it, I have access to both owner and > > viwer ID and they are the same. But, when the viwer is visualizing the > > application on other user profile the viewer ID is undefined. > > This code is in the request: > > > > var req = opensocial.newDataRequest(); > > var params = {}; > > params[opensocial.DataRequest.PeopleRequestFields.MAX] = 1000; > > params[opensocial.DataRequest.PeopleRequestFields.FILTER] = > > opensocial.DataRequest.FilterType.HAS_APP; > > > > req.add(req.newFetchPersonRequest('OWNER'), 'owner'); > > req.add(req.newFetchPersonRequest('VIEWER'), 'viewer'); > > > > req.add(req.newFetchPeopleRequest('OWNER_FRIENDS', params), > > 'ownerFriends'); > > req.send(onLoadData); > > > > This code is in the response: > > > > globalOwner = data.get('owner').getData(); > > globalViewer = data.get('viewer').getData(); > > var ownerFriends = data.get('ownerFriends').getData(); > > > > So, I try: > > alert(globalViewer.getId()); //and I get undefined hehre > > > > Thanks in advance. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "OpenSocial Application Development" 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 -~----------~----~----~----~------~----~------~--~---
