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.
iOS Share extensions automatically employ the containing app's icon. If you provide a separate icon in your Share extension target, Xcode ignores it. For all other app extension types, you must provide an icon that matches the containing app's icon.
App extensions showcase your mobile or tablet app by showing a link to your app below your ad. Clicking this link leads you to your app's description in the app store (Google Play or the Apple App Store). Clicking on your ad's headline will still lead to your website.
App extensions let you extend custom functionality and content beyond your app and make it available to users while they're interacting with other apps or the system.
In most cases, an extension launches when a user chooses it from an app’s UI or from a presented activity view controller. An app that a user employs to choose an app extension is called a host app. A host app defines the context provided to the extension and kicks off the extension life cycle when it sends a request in response to a user action.
The extension displays its view within the context of the host app and then uses the items it received in the host app’s request to perform its task (in this example, the extension receives the selected text). In step 3 of Figure 2-1, the user performs or cancels the task in the app extension and dismisses it.
You can create an embedded framework to share code between your app extension and its containing app. For example, if you develop an image filter for use in your Photo Editing extension as well as in its containing app, put the filter’s code in a framework and embed the framework in both targets.
When your app extension starts, use the NSItemProvider class to get the results returned by the execution of the JavaScript file. In an iOS app extension, pass values to the JavaScript file if you want Safari to modify the webpage when your extension completes its task. (You use the NSItemProvider class in this step, too.)
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];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With