> For the complete documentation index, see [llms.txt](https://docs.wepin.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wepin.io/en/widget-integration/compose-multiplatform-sdk/widget/installation.md).

# Installation

## **Requirements**&#x20;

* **Android**: API version <mark style="color:blue;">**21**</mark> or higher
* **iOS**: version <mark style="color:blue;">**13.0**</mark> or higher
  * Update the `platform :ios` version to <mark style="color:blue;">**13.0**</mark> in your Compose Multiplatform project's `ios/Podfile`, and verify and modify the `ios/Podfile` as needed.

{% hint style="info" %}
This package is only available for **Android** and **iOS** environments. It is not supported on **Web**, **macOS**, **Windows**, or **Linux** environments.
{% endhint %}

## Installation

The Wepin Compose Multiplatform Login Library is published on Maven Central, and you can install it by adding the following dependency in your app's build.gradle.kt

* **Add to dependencies in `build.gradle.kt`:**&#x20;

```
val commonMain by getting { 
    api("io.wepin:wepin-compose-sdk-widget-v1:0.0.2") 
}
```

**iOS**

You need to install iOS-dependent libraries using CocoaPods.

1. After adding the CocoaPods plugin to the `build.gradle` file and entering the information for the `AppAuth`, `secp256k1`, and `JFBCrypt` libraries, click "Sync Project with Gradle Files," and a `shared.podspec` file will be generated.
2. You should add a `Podfile` in the `iosApp` folder.
   1. In the `Podfile`, make sure to set the minimum iOS version to 13.0.

```gradle
//build.gradle.kt(shared)
plugins {
    kotlin("native.cocoapods")
}

kotlin {
    cocoapods {
        summary = "Some description for a Kotlin/Native module"
        homepage = "Link to a Kotlin/Native module homepage"
        ios.deploymentTarget = "13.0"
        version = "0.0.1"

        pod("AppAuth") {
            version = "~> 1.7.5"
        }

        pod("secp256k1") {
            version = "~> 0.1.0"
        }

        pod("JFBCrypt") {
            version = "~> 0.1"
        }
    }
}
```

```swift
// Podfile
post_install do |installer|
    installer.generated_projects.each do |project|
        project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
            end
        end
    end
end
```

## Configuration

### Deep Link **Configuration**

To enable OAuth login functionality (`loginWithOauthProvider`), you need to configure the Deep Link scheme.

* **Deep Link scheme format:** `wepin.` + `Wepin App ID`

**Android**

* Add `manifestPlaceholders` to the `build.gradle (app)` file to easily capture all redirects using this custom scheme with the Wepin Widget SDK

{% code title="build.gradle(app)" %}

```gradle
// Deep Link configuration => Redirect scheme format: wepin. + Wepin App ID
android.defaultConfig.manifestPlaceholders = [
  'appAuthRedirectScheme': 'wepin.{{YOUR_WEPIN_APPID}}'
]
```

{% endcode %}

```xml
AndroidManifest.xml
<activity
      android:name="com.wepin.android.loginlib.RedirectUriReceiverActivity"
      android:exported="true">
      <intent-filter>
          <action android:name="android.intent.action.VIEW" />
          <category android:name="android.intent.category.DEFAULT" />
          <category android:name="android.intent.category.BROWSABLE" />
          <data
              android:host="oauth2redirect"
              android:scheme="${appAuthRedirectScheme}" />
      </intent-filter>
</activity>
```

**iOS**

* Add the app’s URL scheme to the `Info.plist` file to redirect back to the app after the authentication process.

<pre class="language-xml" data-title="Info.plist"><code class="lang-xml"><strong>&#x3C;key>CFBundleURLTypes&#x3C;/key>
</strong>&#x3C;array>
    &#x3C;dict>
        &#x3C;key>CFBundleURLName&#x3C;/key>
        &#x3C;string>unique name&#x3C;/string>
        &#x3C;key>CFBundleURLSchemes&#x3C;/key>
        &#x3C;array>
            &#x3C;string>wepin.{{YOUR_WEPIN_APPID}}&#x3C;/string>
        &#x3C;/array>
    &#x3C;/dict>
&#x3C;/array>
</code></pre>
