On Mon, Jul 2, 2012 at 5:41 PM, Roel van Dijk <[email protected]> wrote:
>
> Does anyone here know what is going on? Why does the first request work,
> but all following requests fail? How can the people object miss many
> functions?
>

This turned out to be a timing issue. The getViewer() function is added tot
osapi.people service object by a gadgets.util.registerOnLoadHandler. Our
call to getViewer() also happens on page load, but apparently too early, so
it happens before the function was added to osapi.people.

I couldn't find a callback or event to use for the completion of the
registered registerOnLoadHandler-s.

We've fixed this by explicitly checking for the existence of
osapi.people.getViewer, and delaying our gadget's Javascript until the
function exists.

-- 
Roel

Reply via email to