views:

293

answers:

3

hi experts, is it any possibilities to invoke/call iphone application from different application, if so means, whats the snippet for that..

+2  A: 

This is a specific example, but, if you setup a protocol handler, when a url is loaded by Safari that it can't handle (yourappProtocol://) it will fire off your application to handle it.

You need to add runtime config to your Info.plist.

And then implement the delegate:

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    [viewController handleURL:url];
    return YES;
}

Read more info here: http://www.mobileorchard.com/apple-approved-iphone-inter-process-communication/

And here: http://blog.innerfence.com/2009/01/05/2-way-app-integration-on-the-iphone-how-it-works/

Mr-sk
A: 

Note that the protocol handler for your application must be unique - if more than one application installed on an iPhone respond to the same handler, there is no way of knowing which app will launch.

i.e.

tweet://... - bad.

mySuperTwitterApp://... - good.

Joshua J. McKinnon
A: 

If it is a phone call that you are looking to make, it is

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:1-408-555-5555"]];

Replace that random number with the phone number. Look into this for more details.

Deepak
hi, thanks for ur ans, is it can launch one application from other application
Apache
Yes, you can "talk" to other applications. The document that I linked to provides details on how to do that for Apple's applications. Third party applications can also engage their own protocol provided they adhere to some rules. Both @Mr-sk's and @Joshua's answer give more details on how that can be done.
Deepak