Contents

getStateOfContentBlocker(withIdentifier:completionHandler:)

Determines the state of your content blocker.

Declaration

class func getStateOfContentBlocker(withIdentifier identifier: String, completionHandler: @escaping  @Sendable (SFContentBlockerState?, (any Error)?) -> Void)
class func stateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState

Parameters

  • identifier:

    The bundle identifier of your content blocker extension.

  • completionHandler:

    The code block to invoke with the state of the content blocker.

Discussion

The state parameter of the completion handler’s SFContentBlockerState contains the isEnabled property. If the content blocker is enabled, state.isEnabled is true; otherwise it’s false. See SFContentBlockerState.