[macOS] Register a Custom Protocol URL Scheme for my CustomApp

Starter Project

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:

App is based on a vendor's SDK needing a bit of customization by running a binary file with additional parameters.

  1. Manually created the directory structure /Applications/CustomApp.app/Contents

  2. 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>
    
  3. Created a shell script that strings together /Applications/CustomApp.app/Contents/MacOS/executable_binary -parameter1 -parameter2 -parameter3

  4. Rebooted macBook.

  5. Opened Chrome pointing to customapp:// and customapp://userid@deptid but nothing happens.

p.s. I'm not doing any code signing.

Posted Mar 12, 2020, 6:10 AM UTC · edited

70
Loading comments…