> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.qonversion.io/llms.txt
> Use this file to discover all available pages before exploring further.

# watchOS/visionOS

> Install Qonversion SDK to implement in-app subscriptions, validate user receipts, get subscription analytics, and send subscription events to third-party integrations.

## Install SDK

Qonversion supports Cocoapods and Swift Package Manager to package your dependencies as a framework.

## Install via Cocoapods

Add dependency to `Podfile`.

<CodeGroup>
  ```text Podfile theme={null}
  pod 'Qonversion'
  ```
</CodeGroup>

Run `pod install` in the project directory to download the dependency.

<CodeGroup>
  ```bash Terminal theme={null}
  pod install
  ```
</CodeGroup>

## Install via Apple Swift Package Manager

Open Xcode, go to **File → Add Package Dependencies...** and enter the package URL `https://github.com/qonversion/qonversion-ios-sdk` in the search bar to import the package.

## Data sharing between iOS and watchOS

Please note that for our SDK to work correctly in the watchOS application (as well as when working with iOS Extensions), it is necessary to set up data sharing between iOS and watchOS applications so that we can identify the same user across both applications.

First, you need to enable data sharing between your app and shared extensions.

1. [Enable app groups](https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW1) for the containing app and extension via Xcode or the Developer portal. Choose your App target in Xcode. Select `Signing & Capabilities`, click `+ Capability` and select `App Groups`.
2. [Register the app group](https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html#//apple_ref/doc/uid/TP40011195-CH4-SW19) in the portal. In Xcode, add the new App Group ID.
3. Choose that App Group ID for the extension and containing app.
4. Pass user defaults instance created with a suite name to Qonversion via Qonversion.Configuration `setCustomUserDefaults()` function.

<CodeGroup>
  ```swift Swift theme={null}
  let config = Qonversion.Configuration(projectKey: "project_key", launchMode: .subscriptionManagement)
  ...
  // any other configurations
  ...
  config.setCustomUserDefaults(.init(suiteName: "app_groups_id_from_previous_step"))
  Qonversion.initWithConfig(config)
  ```

  ```objectivec Objective-C theme={null}
  QONConfiguration *configuration = [[QONConfiguration alloc] initWithProjectKey:@"project_key" launchMode:QONLaunchModeSubscriptionManagement];
  ...
  // any other configurations
  ...
  [configuration setCustomUserDefaults:[[NSUserDefaults alloc] initWithSuiteName:@"app_groups_id_from_previous_step"]];
  [Qonversion initWithConfig:configuration];
  ```
</CodeGroup>

After those steps, all content stored in the user defaults will be shared between the watchOS App and containing App.

***

[Kids Mode](kids-mode-sdk)

[Analytics Mode](analytics-mode)
