How to check if app is installed

5 views
Skip to first unread message

jalmond

unread,
Feb 13, 2008, 4:31:26 PM2/13/08
to OpenSocial - OpenSocial Application Development
One of the things I didn't count on initially when building my
opensocial app is that a user who doesn't have the app installed can
view a user's canvas page who does have the app. I want to catch this
case and present the user with the option of adding the app.

Unfortunately I don't see an opensocial/gadget function to check if
they have the app installed. Obviously I can check if
viewer.isOwner(), but what I'm really interested is something like a
viewer.hasApp().

I'm just wondering what other people are doing for this...?

Pedro Teixeira

unread,
Feb 15, 2008, 7:22:15 AM2/15/08
to OpenSocial - OpenSocial Application Development

check the HAS_APP filter:
http://code.google.com/apis/opensocial/docs/0.7/reference/opensocial.DataRequest.FilterType.html

perhaps, you can use to verify it..

[]'s
Pedro

Arne Roomann-Kurrik

unread,
Feb 15, 2008, 5:24:58 PM2/15/08
to opensoc...@googlegroups.com
There's been a request filed for the feature jalmond described.  Please star the issue at http://code.google.com/p/opensocial-resources/issues/detail?id=27 if you wish to see this feature brought into the OpenSocial API.

Thanks,
~Arne

Keaka

unread,
Feb 16, 2008, 10:41:33 PM2/16/08
to OpenSocial - OpenSocial Application Development
I was under the impression that you couldn't even get viewer data
unless the viewer has your app installed. Thus, if you have a viewer
object, you know the viewer has the app installed. If attempting to
grab the viewer fails, they don't have the app. A viewer.hasApp()
function might not help much... if you had a viewer object and were
able to call that method, you would already know the answer before
calling hasApp()!

Jesse Stay

unread,
Feb 16, 2008, 10:55:46 PM2/16/08
to opensoc...@googlegroups.com
One hack around this is to look for data that isn't available unless the user has installed the app.  The CURRENT_LOCATION key is one of those (although I would love them to at least make the zip code available), and I just check to see that it doesn't return null on getField for that value.  This is clearly a hack though - having this function would be very much appreciated.

Jesse
--
Jesse Stay
The Social Media Guru

Partner, CSO: http://www.SocialOptimize.com
Co-Author:       I'm on Facebook -- Now What???
                         http://FacebookAdvice.com
Author: O'Reilly's FBML Essentials
Blogger:           http://www.jessestay.com
                         http://www.socialoptimize.com/blog

Phone: (801) 853-8339

Jesse Stay

unread,
Feb 16, 2008, 11:30:30 PM2/16/08
to opensoc...@googlegroups.com
Actually, try this (as mentioned earlier):

req.add(req.newFetchPeopleRequest('VIEWER_FRIENDS',{ filter: opensocial.DataRequest.FilterType.HAS_APP }), 'viewerFriends');

Jesse
Reply all
Reply to author
Forward
0 new messages