I am looking for a way to call other installed applications from within m开发者_StackOverflowy app. For example: Can a user open his Skype app from my app?
Is there a way to do this?
Take a look at -openURL:
and -canOpenURL:
.
The application in question must register CFBundleURLTypes
for it to respond to the aforementioned open method. In the case of Skype, for example, the URL protocol is skype:
.
- (void)openAppUsingPrivateAPI:(NSString *)bundleId {
Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
NSObject * workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];
BOOL isopen = [workspace performSelector:@selector(openApplicationWithBundleID:) withObject:bundleId];
}
use private method to do it
精彩评论