HBLibOpener
@interface HBLibOpener : NSObject
The HBLibOpener class provides the ability to manually register a handler with Opener from a tweak, as well as the ability to check if a handler has been disabled by the user.
-
Returns the shared instance of the HBLibOpener class.
@returns The shared instance of the HBLibOpener class.
Declaration
Objective-C
+ (nonnull instancetype)sharedInstance;
Swift
class func sharedInstance() -> Self
-
Allows you to register a handler with libopener.
You should call this from all processes that link against the MobileCoreServices framework (
com.apple.MobileCoreServices
). See the Cydia Substrate documentation for details on filter plists.Declaration
Objective-C
- (BOOL)registerHandler:(nonnull HBLOHandler *)handler error:(NSError *_Nullable *_Nullable)error;
Swift
func register(_ handler: HBLOHandler) throws
Parameters
handler
A handler to be registered. See HBLOHandler.
error
A pointer to an error object. If an error occurs, this pointer is set to an error object containing the error information. You may specify nil for this parameter if you do not want the error information. @returns YES if the handler was registered successfully. Returns NO if an error occurred.
-
Raises an exception.
Supported in SpringBoard only. Deprecated in Opener 2.0. Removed in Opener 3.0. Use bundles or registerHandler:error: instead.
The old handler API is deprecated. Links in web views are not supported. Migrate to the new API as soon as possible.
Declaration
Objective-C
- (BOOL)registerHandlerWithName:(nonnull NSString *)name block:(nonnull id)block;
Swift
func registerHandler(withName name: String, block: Any) -> Bool
Parameters
name
Unused.
block
Unused. @returns Never returns.
-
Returns whether a handler is enabled or disabled.
Declaration
Objective-C
- (BOOL)handlerIsEnabled:(nonnull NSString *)handler;
Swift
func handlerIsEnabled(_ handler: String) -> Bool
Parameters
handler
The identifier of the handler. @returns YES if the handler is enabled, or uses a custom Preferences list controller. Returns NO if the handler has been disabled by the user in the Opener section of Settings.