I am not experienced much with Mac so any help would be appreciated.
First tried to ask here How to map a custom protocol to an application on the Mac?
Trying to add my custom protocol with the help of duti run in the post-install script of the Packages installer:
#!/bin/sh
##
## add_handlers.sh -- register UTI handlers for the MyApp
##
## Requires the duti tool
##
./duti -s MyApp myapp
The handler appears in the RCDefaultApp preference pane, but when invoked from my other application, it opens Safari with that protocol in the address bar asking "Do you want to allow this page to open “MyApp”? and when clicked Allow shows error:
Safari can’t open the specified address. Safari can’t open “myapp://” because macOS doesn’t recognise internet addresses starting with “myapp:”.
Also when trying to open from the terminal:
deploy@mini-mac-mini ~ % open myapp://
LSOpenURLsWithRole() failed with error -10810 for the URL myapp://.
The same issue when trying to add the protocol with the help of the plist file in the application's package.