Is it possible to launch my iMessage app extension from the main application( developed using Swift4), by clicking a button? I have already published the app in the store, but I don't know how to do it.
2 Answers
You should be able to do this by using the same iTunes link for your app, with an added query parameter of ?app=messages
Using Starbucks as an example, their App Store URL is
https://itunes.apple.com/us/app/starbucks/id331177714
But the URL to launch iMessage, and pull up your iMessage app would be
https://itunes.apple.com/us/app/starbucks/id331177714?app=messages

- 11
- 3
Not as far as I can tell, up as late as iOS 12.1
This is long-standing as a request - you can go only go in the one direction, from extension to App.
There's a forum discussion from 2016 where the answer was that it's not possible. Another 2018 forum question got no response.
From extension to app, see the technique described in this blog, using a URL:
guard let url: URL = URL(string: "AppName://?myParam=myValue") else { return }
self.extensionContext?.open(url, completionHandler: { (success: Bool) in
})
Calling the above code will open the phone app.
You can access the URL params in your phone app’s App Delegate:
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
return true
}

- 17,578
- 6
- 88
- 115