Clarification on Opening Main App from Share Extension and App Store Submission

Hello,

In our application, we have implemented an app extension to allow users to open the main app directly from the share activity window. To achieve this, we used the openURL(:) method from the NSExtensionContext class, as documented here: openURL(:).

However, we received one post from Apple stating that opening the main app directly is typically only supported in extensions such as Today widgets or iMessage apps. They also mentioned that this approach may require an additional review during the App Store submission process. Link: https://developer.apple.com/documentation/foundation/nsextensioncontext/1416791-openurl

Could someone clarify:

If using openURL(_:) in a share extension to open the main app would lead to potential issues during App Store submission? Are there specific guidelines or alternative approaches we should follow to ensure compliance? Any insights or recommendations would be greatly appreciated.

Thank you!

Answered by Engineer in 822968022

There's no supported way for you to launch your app directly from App Extensions, except Today and Widgets (which requires OpenURLIntent and is available to processes that can use App Intents). with the APIs currently available. If you'd like us to consider adding the necessary functionality, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here. If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?

My recollection from a few years ago is that calling this from the wrong sort of extension doesn’t work on iOS, i.e. it does nothing or there is a run-time error or something. Does it actually work for you?

You can find code that achieves this in some indirect way, i.e. by traversing the view hierarchy to find some object with a “normal” openURL method. This could result in app review issues - if they discovered it. There are apps on the store that do this.

There's no supported way for you to launch your app directly from App Extensions, except Today and Widgets (which requires OpenURLIntent and is available to processes that can use App Intents). with the APIs currently available. If you'd like us to consider adding the necessary functionality, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here. If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?

Clarification on Opening Main App from Share Extension and App Store Submission
 
 
Q