How to launch a parent iOS App from its App Extension

loganathan picture loganathan · Sep 8, 2014 · Viewed 12.2k times · Source

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.

Answer

Karl Monaghan picture Karl Monaghan · Sep 11, 2014

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];