<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SafariServices",
  "identifier" : "/documentation/SafariServices/SFContentBlockerManager/getStateOfContentBlocker(withIdentifier:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Safari Services"
    ],
    "preciseIdentifier" : "c:objc(cs)SFContentBlockerManager(cm)getStateOfContentBlockerWithIdentifier:completionHandler:"
  },
  "title" : "getStateOfContentBlocker(withIdentifier:completionHandler:)"
}
-->

# getStateOfContentBlocker(withIdentifier:completionHandler:)

Determines the state of your content blocker.

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

## Parameters

`identifier`

The bundle identifier of your content blocker extension.

`completionHandler`

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

## Discussion

> Important:
> You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration:
> 
> ```swift
> class func stateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState
> ```
> 
> For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/Swift/calling-objective-c-apis-asynchronously>.

The `state` parameter of the completion handler’s `SFContentBlockerState` contains the [`isEnabled`](/documentation/SafariServices/SFContentBlockerState/isEnabled) property. If the content blocker is enabled, `state.isEnabled` is <doc://com.apple.documentation/documentation/Swift/true>; otherwise it’s <doc://com.apple.documentation/documentation/Swift/false>. See [`SFContentBlockerState`](/documentation/SafariServices/SFContentBlockerState).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)