---
title: "getStateOfSafariExtension(withIdentifier:completionHandler:)"
framework: safariservices
role: symbol
role_heading: Type Method
path: "safariservices/sfsafariextensionmanager/getstateofsafariextension(withidentifier:completionhandler:)"
---

# getStateOfSafariExtension(withIdentifier:completionHandler:)

Returns the current state of a Safari extension.

## Declaration

```swift
class func getStateOfSafariExtension(withIdentifier identifier: String, completionHandler: @escaping @MainActor @Sendable (SFSafariExtensionState?, (any Error)?) -> Void)
```

```swift
class func stateOfSafariExtension(withIdentifier identifier: String) async throws -> SFSafariExtensionState
```

## Parameters

- `identifier`: The bundle identifier for the Safari extension to check.
- `completionHandler`: The completion handler the system calls with either the extension’s state or an error.

## Discussion

Discussion Use this method to check on the state of one of the Safari app or web extensions embedded inside your app.

## See Also

### Checking on the state of an extension

- [getStateOfExtension(withIdentifier:completionHandler:)](safariservices/sfsafariextensionmanager/getstateofextension(withidentifier:completionhandler:).md)
