<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKDatabase/fetch(withSubscriptionIDs:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "s:So10CKDatabaseC8CloudKitE5fetch19withSubscriptionIDs17completionHandlerySaySSG_ys6ResultOySDySSAIySo14CKSubscriptionCs5Error_pGGsAL_pGctF"
  },
  "title" : "fetch(withSubscriptionIDs:completionHandler:)"
}
-->

# fetch(withSubscriptionIDs:completionHandler:)

Fetches the specified subscriptions and delivers them to a completion handler.

```
@preconcurrency func fetch(withSubscriptionIDs subscriptionIDs: [CKSubscription.ID], completionHandler: @escaping @Sendable (Result<[CKSubscription.ID : Result<CKSubscription, any Error>], any Error>) -> Void)
```

## Parameters

`subscriptionIDs`

The identifiers of the subscriptions to fetch.

`completionHandler`

The closure to execute with the fetch results.

## Discussion

The completion handler takes the following parameters:

- A <doc://com.apple.documentation/documentation/Swift/Result> that contains either a dictionary of fetched subscriptions, or an error if the request fails, such as when the network is unavailable or the device doesn’t have an active iCloud account. When present, the dictionary uses the identifiers you specify in `subscriptionIDs` as its keys. The value of each key is a <doc://com.apple.documentation/documentation/Swift/Result> that contains either the corresponding fetched subscription, or an error that describes why CloudKit can’t provide that subscription.

For information on a more configurable way to fetch specific subscriptions, see [`CKFetchSubscriptionsOperation`](/documentation/CloudKit/CKFetchSubscriptionsOperation).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)