Class AppleHandlers

    • Method Detail

      • setUrlType

        public static void setUrlType​(String s,
                                      String bundleId)
        Sets the user’s preferred default handler for the specified URL scheme. URL handling capability is determined according to the value of the CFBundleURLTypes key in an application’s Info.plist. For information on the CFBundleURLTypes key, see the section “CFBundleURLTypes” in OS X Runtime Configuration Guidelines. Browser will open your app, when uses clicks on the web page url (magnet url for example).
        Parameters:
        s - - URL scheme, ex: "magnet" for "magnet://some_magnet_link"
        bundleId - - bundle id
      • setFileType

        public static void setFileType​(String s,
                                       String bundleId)
        Sets the user’s preferred default handler for the specified content type in the specified roles. Call LSCopyDefaultRoleHandlerForContentType to get the current setting of the user’s preferred default handler for a specified content type. It helps browser to show proper download dialog which asks user which App to use to open this file you are downloading.
        Parameters:
        s - contenet handler. ex: "org.bittorrent.torrent", "torrent"
        bundleId - - bundle ID
      • isAvailable

        public static boolean isAvailable()
      • getAppleHandlers

        public static AppleHandlers getAppleHandlers()