views:

63

answers:

2

I have a link to a Facebook page from a website. I know I can use the URL scheme href="fb://" to open up the Facebook application from within an iPhone, but if the iPhone user does not have the native application installed, an ugly error message pops up. I would rather just send this user to the Facebook website.

There's gotta be a way to do this, but everything I've tried has had some short-coming:

Can't make a HEAD request to a different server

Can't run a try catch javascript function since the event leaves the client page

Can't seem to access information about the user's applications... or can I? I've read a bit about a cookie called "appInstalled" but can't find any real documentation about it.

Any ideas out there? Thanks a ton in advance. Denis

+1  A: 

Not a really technical answer, but you could change the user interface to give the user an option. For example, having:

Click here if you have the facebook application installed on your iPhone.
If you do not, click here to go through to the site.

Sorry that I cannot offer a "proper" solution, I'm not really that familiar with iPhone development.

bennybdbc
Thanks for that - but Facebook will be just one of many possible app/website links, so it would be a bit much to have all those possibilities on a small screen. I appreciate the suggestion though!
dwarbi
No problems. Sorry I couldn't help more.
bennybdbc
+2  A: 

Can a website determine if a device [iPhone] has certain applications installed ? I'm pretty sure that's a big NO because of privacy and security concerns.

sjobe
I understand that - so the fallback would be to trigger another event if opening the app through the URL scheme fails. This would be fine... and seems like a reasonable alternative, no?
dwarbi
Yes that would be reasonable, but where does this error actually occur/appear ? If it's still within the browser, then u can probably use javascript to gracefully notify the user.. but if actually exits the browser, tries to launch then gives you the error, then I'd say there is nothing you can do @ that point... well maybe what @bennybdbc suggested
sjobe