I developed a Share Extension for my App. Using the following code in the extension, I am unable to invoke the main App; however, I noticed that the Bing App can be invoked normally. Therefore, I have two questions;
Is there a bug in the invocation code? I used the extensionContext?.open method to invoke, and the callback flag always returns false; the scheme can be invoked normally in Safari How does the Bing App do it?
this my code:
extensionContext?.open(URL(string: “myappscheme://”)!, completionHandler: { succ in // print(“open (succ)”) // })
Environment:
- Mac OS: 15.0 Beta (24A5279h)
- iPad OS : 18 Beta 1 "
Share Extensions are not allowed to open apps and you should use completeRequest and not openURL (which is only available to Today Extensions).
https://developer.apple.com/documentation/foundation/nsextensioncontext/1411301-completerequest
Rico
WWDR - Software Engineer