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

# getStateOfExtension(withIdentifier:completionHandler:)

Returns the current state of a Safari web extension.

## Declaration

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

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

## Parameters

- `identifier`: The bundle identifier for the Safari web 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 a Safari web extension embedded inside your app.

## See Also

### Checking on the state of an extension

- [getStateOfSafariExtension(withIdentifier:completionHandler:)](safariservices/sfsafariextensionmanager/getstateofsafariextension(withidentifier:completionhandler:).md)
