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

# Installation

> Install Junction Mobile SDKs on iOS and Android with platform-specific requirements, minimum OS versions, and dependency configuration.

## Project requirements

### iOS

<Info>Applies also to Flutter and React Native projects.</Info>

| Parameter                 | Requirement |
| ------------------------- | ----------- |
| Minimum deployment target | iOS 15.1    |

<Note>
  If you are integrating on React Native or Flutter, or integrating on Native iOS via CocoaPods,
  make sure you have updated the minimum iOS deployment target in:

  * your `Podfile`; and
  * your iOS App Target.

  ```diff Podfile theme={null}
  # e.g., React Native default
  -platform :ios, min_ios_version_supported

  # Set minimum deployment target to be iOS 15.1.
  +platform :ios, '15.1'
  ```
</Note>

### Android

<Info>Applies also to Flutter, React Native and Expo projects.</Info>

| Parameter                     | Requirement                              |
| ----------------------------- | ---------------------------------------- |
| Minimum SDK Level             | 26 (Health Connect), 29 (Samsung Health) |
| Compile SDK Level             | 36                                       |
| Kotlin compiler version       | 2.1.20 or above                          |
| Android Gradle Plugin version | 8.9.1 or above                           |
| Gradle version                | 8.11.1 or above                          |

### Flutter

| Parameter   | Requirement   |
| ----------- | ------------- |
| Flutter SDK | 3.13 or above |

### React Native

#### Expo

| Parameter | Requirement |
| --------- | ----------- |
| Expo      | 53 or above |

#### Bare React Native projects

| Parameter         | Requirement     |
| ----------------- | --------------- |
| React Native Core | 0.72.0 or above |
| Node.js           | 20.0 or above   |

## Set up package dependencies

### iOS

Junction Mobile SDKs are available through both Swift Package Manager and CocoaPods.

#### Swift Package Manager

Add the vital-ios package (`https://github.com/tryVital/vital-ios`) as a dependency of your project.

Link `VitalHealthKit` and `VitalDevices` as appropriate. Note that `VitalCore` is mandatory.

<iframe src="https://www.loom.com/embed/fa091653aab24feeb52253a584c69512" frameborder="0" allowfullscreen="true" width="100%" height="533" loading="lazy">
  {" "}
</iframe>

#### CocoaPods

Add the following declarations to your app target in your Podfile:

```ruby theme={null}
pod 'VitalCore'
pod 'VitalDevices'
pod 'VitalHealthKit'
```

### Android

Make sure Maven Central is included in the list of repositories in your `build.gradle`.

```groovy theme={null}
repositories {
  mavenCentral()
}
```

Then include our Android SDK artifacts as dependencies of your modules as needed:

```groovy theme={null}
def vital_version = '3.2.1'

implementation 'io.tryvital:vital-client:$vital_version'
implementation 'io.tryvital:vital-health-connect:$vital_version'
implementation 'io.tryvital:vital-samsung-health:$vital_version'
implementation 'io.tryvital:vital-devices:$vital_version'
```

<Note>
  Samsung Health also requires the downloaded Samsung Health Data SDK AAR to be wired into your Android root project via
  `samsungHealthAarPath` (Native Android / bare React Native) or `samsungHealth.aarPath` (Expo config plugin). Check out the
  [Samsung Health guide](/wearables/guides/samsung-health#samsung-health-project-setup) for more details.
</Note>

### React Native

#### Expo projects

##### Installation

<Info>
  Only [Expo Prebuild](https://docs.expo.dev/guides/adopting-prebuild/) is supported.
  Expo Go is incompatible, since it supports neither native library binaries, nor [Expo Config Plugin](https://docs.expo.io/guides/config-plugins/).
</Info>

First install the package with [`npx expo install`](https://docs.expo.dev/more/expo-cli/#installation).

```sh theme={null}
npx expo install @tryvital/vital-core-react-native
npx expo install @tryvital/vital-health-react-native
```

After installing the Junction React Native SDK packages, add the bundled Junction Expo Config Plugins to the [`plugins`](https://docs.expo.io/versions/latest/config/app/#plugins) array of your Expo app configuration file (`app.json` or `app.config.js`):

```json app.json/app.config.js theme={null}
{
  "expo": {
    "plugins": [
      "@tryvital/vital-core-react-native",
      "@tryvital/vital-health-react-native"
    ]
  }
}
```

##### Android specific configuration

In your Expo app configuration file (`app.json` or `app.config.js`), use the `expo-build-properties` config plugin to customize the minimum, target and compile Android SDK version:

```json app.json/app.config.js theme={null}
{
  "expo": {
    // ...
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "compileSdkVersion": 34,
            "targetSdkVersion": 34,
            "minSdkVersion": 26
          }
        }
      ],
      // ...
    ]
  }
}
```

<Note>
  Refer to [Project Requirements > Android](#android) for the constraints on these SDK version levers.
</Note>

Next, rebuild your app as described in the ["Adding custom native code"](https://docs.expo.dev/workflow/customizing/) guide.

##### Customizations

You can customize the integration by passing additional properties to the Expo config plugin:

| Key                                | Value                                                                                                                                         |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `healthSharePermission` (*string*) | Sets the iOS `NSHealthShareUsageDescription` permission message to the `Info.plist`. Defaults to `Allow $(PRODUCT_NAME) to check health info` |
| `samsungHealth.aarPath` (*string*) | Path to the downloaded Samsung Health Data SDK AAR. Required when enabling Samsung Health on Android through Expo.                            |

```json app.json/app.config.js theme={null}
{
  "expo": {
    "plugins": [
      "@tryvital/vital-core-react-native",
      [
        "@tryvital/vital-health-react-native",
        {
          "healthSharePermission": "Custom health share permission",
          "samsungHealth": {
            "aarPath": "../vendor/samsung-health-data-api-1.0.0.aar"
          }
        }
      ]
    ]
  }
}
```

<Info>
  After making changes to your Config Plugin settings, you must re-run Expo Prebuild to re-generate your iOS and Android projects.
</Info>

#### Bare React Native projects

Install Junction SDK packages through NPM or Yarn:

```commandline theme={null}
npm install @tryvital/vital-core-react-native
npm install @tryvital/vital-health-react-native
npm install @tryvital/vital-devices-react-native
```

Pull all dependencies for your React Native iOS project:

```commandline theme={null}
cd ios
pod install
```

<Info>
  `pod install` on your iOS project might error due to version lock conflicts on the Junction iOS libraries.
  This usually happens after you have bumped the React Native SDK package versions.

  Use `pod update` to resolve the conflict:

  ```commandline theme={null}
  pod update VitalCore VitalDevices VitalHealthKit VitalLogging --repo-update
  ```
</Info>

### Flutter

Add Junction SDK packages to your `pubspec.yaml`:

```yaml theme={null}
dependencies:
  vital_core: ^3.1.1
  vital_health: ^3.1.1
  vital_devices: ^3.1.1
```

<Info>
  `pod install` on your iOS project might error due to version lock conflicts on the Junction iOS libraries.
  This usually happens after you have bumped the Flutter SDK package versions.

  Use `pod update` to resolve the conflict:

  ```commandline theme={null}
  pod update VitalCore VitalDevices VitalHealthKit --repo-update
  ```
</Info>
