how to call an iphone application from different application
is it any 开发者_开发问答possibilities to invoke/call iphone application from different application, if so means, whats the snippet for that..
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/
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.
精彩评论