MySpace Developer Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

how to know if viewer has app installed?

Last post 04-29-2008 2:12 PM by Jeremy. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-28-2008 6:11 PM

    how to know if viewer has app installed?

    How can I figure out when the viewer has the app installed?

    If the pingInstall/Remove callbacks are dropped for some reason, is there a way to tell on the next page view of the user if they have added the app or removed it, so we can auto-discover and correct their state in our db ( that's what we do on FB ).

    I'm trying to make sure that when a user adds the app (or removes it), we update our databases properly.  And I'm afraid that the pingInstall callback might not be called in advance of the first request to the app (so that we might not be done setting up before the first request asking to render stuff for that user).  Or

     

    Anyone else thinking about the same thing?

  • 04-29-2008 10:21 AM In reply to

    Re: how to know if viewer has app installed?

    See if you can get data for the viewer. If not, it's not added.

  • 04-29-2008 2:12 PM In reply to

    Re: how to know if viewer has app installed?

    Just to note on the above: even if the VIEWER does not have the App installed, DataRequest will still return a ResponseItem object (it used to come back null) -- the DataResponse will return .hadError() as true, and the ReponseItem for VIEWER will return "Unauthorized" (I believe, it may not be exactly that) on a .getErrorMessage() call.

    As far as the Install/Uninstall callback being removed -- I don't think that's likely to happen; they're a part of the OpenSocial 0.7 Gadget specification. And I'm sure the Install callback get pings before the browser is redirected to the Canvas, but there could be a potential problem (that people have already noticed), that the permission granted by the installation does not propogate down to the API servers before a DataRequest or RESTful API request hits the server -- but the standard way to handle that is to simply re-request until the permission is granted.

    If you're worried about your own servers having the same problem, then I suggest you use a similar solution; obviously there's a chance that the Install-ping might not reach your servers before a request generated by the Canvas. So keep trying that request until your server grants similar permission.

Page 1 of 1 (3 items)