Skip to main content
This document describes how to implement custom protocol handler. When the DirectGVR client first starts it is possible to get the url using app.getCommandFieldByName("schema-url"). If the client is already running when the user initiates the schema request, it will be sent through to the client through the SkinApp.NewCommandLine notification.

Windows

Custom protocol handlers are registered in Windows by creating specific registry keys in HKEY_CLASSES_ROOT. The following workflow tasks create a custom protocol handler called myhandler:// for an application called My Application. These are written in YAML but they can also be written in JSON depending on what your workflow uses.
When the DirectGVR client first starts it is possible to get the url using app.getCommandFieldByName("open"). If the client is already running when the user initiates the schema request, it will be sent through to the client through the SkinApp.NewCommandLine notification.

macOS

Custom protocol handlers are registered in macOS in the application bundle’s Info.plist. The operating system can choose at any time to recognize the custom protocol handler of an application bundle on disk. It can be recognized by the operating system when copying the application bundle into the Applications folder or be recognized when opening a DMG. However, the operating system will ignore the application bundle if it is located in certain directories such as the temp directory. When building your skin using the Builder console in DIRECT 6.1 or higher include an Info.plist in the root directory of the skin; it will get merged with the Info.plist of the DirectGVR client. The following Info.plist creates a custom protocol handler called myhandler:// for an application called My Application.
All schema requests will be sent to the SkinApp.NewCommandLine notification. On macOS, the argument name is --open.

More resources