开发者

Open other installed apps from within my app

开发者 https://www.devze.com 2023-03-06 19:35 出处:网络
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?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号