---
title: "exportedAssetID(for:)"
framework: photos
role: symbol
role_heading: Instance Method
path: "photos/phassetresourcemanager/exportedassetid(for:)"
---

# exportedAssetID(for:)

Returns the exported asset ID for the specified asset resource.

## Declaration

```swift
func exportedAssetID(for resource: PHAssetResource) async throws -> CKAsset.ExportedAssetID
```

## Parameters

- `resource`: The asset resource to get an exported asset ID for.

## Return Value

Return Value The exported asset ID for the resource.

## Discussion

Discussion The returned CKAsset.ExportedAssetID can be used to create a CKAsset that references the asset resource data without copying it. Network access is required; the request will fail if the resource cannot be resolved in CloudKit. Only resources belonging to PHAssetResource.TypeGroup.coreComponents are valid. The photo library must be cloud-enabled; requests against a local-only library will fail with PHPhotosError.requestNotSupportedForAsset. This method supports task cancellation. If the calling task is cancelled, the underlying network request is cancelled and this method throws CancellationError. note: CancellationError if the task is cancelled, or another error if the request fails.
