Function

LSCopyAllHandlersForURLScheme(_:)

Locates application bundle identifiers for applications capable of handling the specified URL scheme.

Declaration

func LSCopyAllHandlersForURLScheme(_ inURLScheme: CFString) -> Unmanaged<CFArray>?

Parameters

inURLScheme

The URL scheme for which the application bundle identifiers are to be returned.

Return Value

An array containing the application bundle identifiers for applications capable of handling the URL scheme specified by inURLScheme, or NULL if no handlers are available.

In macOS 10.15 and later, the returned array is sorted so that the first element contains the best available application for opening the specified URL scheme. Prior to macOS 10.15, the order of elements in the array was undefined.

Discussion

This function returns all of the application bundle identifiers that are capable of handling the specified URL scheme.

URL handling capability is determined according to the value of the CFBundleURLTypes key in an application’s Info.plist.

Version Notes

Thread-safe since macOS 10.4.

See Also

Working With Role Handlers

func LSCopyAllRoleHandlersForContentType(CFString, LSRolesMask) -> Unmanaged<CFArray>?

Locates an array of application bundle identifiers for applications capable of handling a specified content type with the specified roles.

func LSCopyDefaultRoleHandlerForContentType(CFString, LSRolesMask) -> Unmanaged<CFString>?

Returns the application bundle identifier of the user’s preferred default handler for the specified content type with the specified role.

func LSSetDefaultRoleHandlerForContentType(CFString, LSRolesMask, CFString) -> OSStatus

Sets the user’s preferred default handler for the specified content type in the specified roles.

func LSGetHandlerOptionsForContentType(CFString!) -> LSHandlerOptions

Gets the handler options for the specified content type.

Deprecated
func LSSetHandlerOptionsForContentType(CFString!, LSHandlerOptions) -> OSStatus

Sets the handler option for the specified content type.

Deprecated
func LSCopyDefaultHandlerForURLScheme(CFString) -> Unmanaged<CFString>?

Returns the application bundle identifier of the user’s preferred default handler for the specified URL scheme.

Deprecated
func LSSetDefaultHandlerForURLScheme(CFString, CFString) -> OSStatus

Sets the user’s preferred default handler for the specified URL scheme.