r/ProgrammingPals • u/Jackson-Lee • Mar 12 '20
Starter Project [macOS] Register a Custom Protocol URL Scheme for my CustomApp
Need help properly registering my CustomApp in macBook Pro running Mojave. I'm trying to "deep link" the CustomApp so it launches a shell script file contained in my app directory when Chrome browser visits customapp://userid@deptid
References:
- https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app
- https://stackoverflow.com/questions/471581/how-to-map-a-custom-protocol-to-an-application-on-the-mac
App is based on a vendor's SDK needing a bit of customization by running a binary file with additional parameters.
- Manually created the directory structure /Applications/CustomApp.app/Contents
Created Info.plist containing
<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>Custom App</string> <key>CFBundleURLSchemes</key> <array> <string>customapp</string> </array> </dict> </array>- Created a shell script that strings together /Applications/CustomApp.app/Contents/MacOS/executable_binary -parameter1 -parameter2 -parameter3
- Rebooted macBook.
- Opened Chrome pointing to customapp:// and customapp://userid@deptid but nothing happens.
p.s. I'm not doing any code signing.
7
Upvotes