---
title: "getIdentifierForUserVisibleFile(at:completionHandler:)"
framework: fileprovider
role: symbol
role_heading: Type Method
path: "fileprovider/nsfileprovidermanager/getidentifierforuservisiblefile(at:completionhandler:)"
---

# getIdentifierForUserVisibleFile(at:completionHandler:)

Returns the identifier and domain for a user-visible URL.

## Declaration

```swift
class func getIdentifierForUserVisibleFile(at url: URL, completionHandler: @escaping @Sendable (NSFileProviderItemIdentifier?, NSFileProviderDomainIdentifier?, (any Error)?) -> Void)
```

```swift
class func identifierForUserVisibleFile(at url: URL) async throws -> (NSFileProviderItemIdentifier, NSFileProviderDomainIdentifier)
```

## Parameters

- `url`: The URL of the item.
- `completionHandler`: A block that the system calls after it gets the items identifier. It has the following parameters:

## Discussion

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: class func identifierForUserVisibleFile(at url: URL) async throws -> (NSFileProviderItemIdentifier, NSFileProviderDomainIdentifier) For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously. If the URL doesn’t refer to an item managed by your File Provider extension, the system returns a NSFileNoSuchFileError error.

## See Also

### Translating user-visible URLs

- [getUserVisibleURL(for:completionHandler:)](fileprovider/nsfileprovidermanager/getuservisibleurl(for:completionhandler:).md)
