Replacement for LSSetDefaultHandlerForURLScheme?

LSSetDefaultHandlerForURLScheme is flagged as deprecated, but it isn't clear to me (very much not a frequent macOS developer) what the alternative is.

Can anyone point me in the right direction?

Thanks.

Answered by DTS Engineer in 829039022

Sorry for the long delay. I suspect I was out of the office when you originally posted this.

There is no recommended replacement for LSSetDefaultHandlerForURLScheme. In some cases this functionality has been subsumed by the system. In some cases this functionality is no longer available to your app [1]. In some cases there’s no replacement because we favour Universal Links over URL schemes.

If you have a use case that’s not covered by the above, you should feel free to file an enhancement request with detailed information about what you need to do. You can then continue using LSSetDefaultHandlerForURLScheme in the interim.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Specifically, for apps on the Mac App Store, where such requests are blocked by the App Sandbox.

Sorry for the long delay. I suspect I was out of the office when you originally posted this.

There is no recommended replacement for LSSetDefaultHandlerForURLScheme. In some cases this functionality has been subsumed by the system. In some cases this functionality is no longer available to your app [1]. In some cases there’s no replacement because we favour Universal Links over URL schemes.

If you have a use case that’s not covered by the above, you should feel free to file an enhancement request with detailed information about what you need to do. You can then continue using LSSetDefaultHandlerForURLScheme in the interim.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Specifically, for apps on the Mac App Store, where such requests are blocked by the App Sandbox.

Hey, thanks, I really appreciate you responding.

Our use case is this: we use a 3rd-party web app (Autodesk Flow Production Tracking) that uses a custom URL scheme to launch a desktop app (RV). This works fine. However, it is not uncommon for more than one version of the desktop app to be installed on any given machine for various reasons (feature requirements for different different projects, testing, troubleshooting).

In addition, the desktop app supports site-customized scripted "add-ons" that require context-dependent environment variables to work properly. So historically, we have used LSSetDefaultHandlerForURLScheme to point the custom URL scheme to an in-house app that did the environment setup work and then launched the required version of the desktop app.

Now, we are finding it hard to keep the custom URL scheme reliably pointed to our environment setup app. Since it registers the same custom URL scheme as the Autodesk desktop app, what actually gets launched is now by definition undefined.

This ends up being very confusing and frustrating for our users.

Thanks for the explanation. Sadly, there’s not much I can do about this personally. I recommend that you flesh this explanation out into a bug report. Follow the link in my previous post for hints and tips on that process.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Replacement for LSSetDefaultHandlerForURLScheme?
 
 
Q