---
title: "subscriptions(for:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/ckdatabase/subscriptions(for:)"
---

# subscriptions(for:)

Fetches the specified subscriptions and returns them to an awaiting caller.

## Declaration

```swift
func subscriptions(for ids: [CKSubscription.ID]) async throws -> [CKSubscription.ID : Result<CKSubscription, any Error>]
```

## Parameters

- `ids`: The identifiers of the subscriptions to fetch.

## Return Value

Return Value A dictionary that contains the fetched subscriptions. The dictionary uses the identifiers you specify in ids as its keys. The value of each key is a Result that contains either the corresponding fetched subscription, or an error that describes why CloudKit can’t provide that subscription.

## Discussion

Discussion This method throws an error if the request fails, such as when the network is unavailable or the device doesn’t have an active iCloud account; otherwise, the returned dictionary includes any individual subscription errors. For information on a more configurable way to fetch specific subscriptions, see CKFetchSubscriptionsOperation.

## See Also

### Fetching Subscriptions

- [fetch(withSubscriptionIDs:completionHandler:)](cloudkit/ckdatabase/fetch(withsubscriptionids:completionhandler:).md)
- [subscription(for:)](cloudkit/ckdatabase/subscription(for:).md)
- [fetch(withSubscriptionID:completionHandler:)](cloudkit/ckdatabase/fetch(withsubscriptionid:completionhandler:).md)
- [fetchAllSubscriptions(completionHandler:)](cloudkit/ckdatabase/fetchallsubscriptions(completionhandler:).md)
