How to launch a parent iOS App from its App Extension

后端 未结 7 1375
借酒劲吻你
借酒劲吻你 2021-02-07 07:22

Does any one know how to launch the parent app from the app extension\'s view controller?

I just want to launch the main app from its app extension.

7条回答
  •  -上瘾入骨i
    2021-02-07 07:39

    In the WWDC session Creating Extensions for iOS and OS X, Part 1 around the 22 minute mark the say to use the openURL:completionHandler: method from the UIViewController's extensionContext to open a custom URL scheme

    [self.extensionContext openURL:[NSURL URLWithString:@"your-app-custom-url-scheme://your-internal-url"]
                 completionHandler:nil];
    

提交回复
热议问题