---
title: "importResources(at:request:)"
framework: appmigrationkit
role: symbol
role_heading: Instance Method
path: "appmigrationkit/resourcesimporting/importresources(at:request:)"
---

# importResources(at:request:)

Imports resources to the app, in response to a request from the migration system.

## Declaration

```swift
func importResources(at url: URL, request: ResourcesImportRequest) async throws
```

## Parameters

- `url`: A URL that refers to a directory containing the resources to import.
- `request`: A request object that describes the source of the migration.

## Discussion

Discussion Implement this method in your app extension to import files to your app from the source device. You can accomplish this task by moving all files from the directory indicated by url to an appropriate location for your app, such as the documents directory. important: AppMigrationKit coerces any error thrown from this method into an NSError instance. The framework persists this error so it can provide it to your app on its first launch. If your error can’t convert to an NSError, AppMigrationKit provides a generic error to the app instead.

## See Also

### Importing resources

- [ResourcesImportRequest](appmigrationkit/resourcesimportrequest.md)
