Catching an exception when trying to launch a URL service from within Safari on an iPhone
Posted
by Ariel
on Stack Overflow
See other posts from Stack Overflow
or by Ariel
Published on 2010-03-21T14:44:27Z
Indexed on
2010/03/21
14:51 UTC
Read the original article
Hit count: 501
Hey guys,
I was wondering if anyone knows - if I have an iPhone app that is registered with a URL service (e.g. alocola://), which means another app can invoke it by calling its URL - is there any way to embed this URL in an HTML page, and catch the exception if the app is not installed on the user's iPhone?
Or in other words / more details: I would like to write an app that conforms to some URL invocation (like alocola:// is doing), but would like this app to be launched from a web page read by mobile Safari. However, if the app is not installed on the user's iphone, I would like to be able to display a note saying "you must have the alocola app installed on your iPhone, please download it from the app store by clicking here". Is there a way (perhaps using javascript) to have Safari indicate that the URL cannot be invoked, and catch this in order to display an intelligent message?
Thanks :-) Ariel
© Stack Overflow or respective owner