I used the following code to get the viewer's ID

            function request_viewerID() {
                var req = opensocial.newDataRequest();

req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER,
'hashKey'));
                req.send(callback);
            };

            function callback(obj) {
                var viewer = data.get('hashKey').getData();
                return viewer
            };

            viewerID=request_viewerID()
            alert(viewer);

But it doesn't work. Is there anything wrong with the code?

And I also how can I detect which view the app is being run on? (gadget or
profile or cavas or whatever)?


--
Akash Manohar
[EMAIL PROTECTED]

Reply via email to