tags:

views:

134

answers:

1

Hi,

I have a query regarding launching a native application from a link of website on iPhone.

I will explain. Generally a web based application is used to work online without using any feature of iPhone device (such as GPS, Camera, Accelerometer etc.)

I have a iPhone specific website which performs many tasks online.

Now while keeping all the functionality same, I want to add a feature of taking a picture from iPhone in-built camera. i.e. when user clicks a button on website "Take Picture", my native application should be launched, which will take a picture and do specific tasks..

How to capture a event of button click which is performed on website? Should I use UIWebView or Safari?

I know that using URL Scheme we can launch Safari from native application. But how to achieve the opposite as explained above?

All other functionality works great on website, so I don't want to convert the whole website into native application. (Otherwise I will have to deal with web services). Only this functionality needs to be added.

So please help in this regard.

Thanks in advance.

+4  A: 

Register a URL Handler, then have a link on your site to myapphandle://some.parameters.here/

A la: http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html

Kenny Winker
Thank you for your reply.It worked great.I have another one query.What if I want to load my custom view on click of a link of webView?I will explain.I want my native app to have a webview (which will show a webSite) and on one of the clicks of website, I want to come back to my native application and load another view.As per earlier question, current application will quit and new will be launched. I want the control to be in the same application?Is there any way that we can acheive it?Can we get current address of webview and use that? please help.
Roger_iPhone
Amitkumar, look into the shouldStartLoadWithRequest delegate method.
Kenny Winker
Thanks Kenny !!!
Roger_iPhone