# Installation

## Requirements

* iOS 13+
* Swift 5.x

{% hint style="info" %}
Note: Only relevant if you installed before v1.0.0.

The v1.0.0 update includes important changes that may affect app behavior, particularly related to local storage keys. If you’re updating from a version prior to v1.0.0, please review the following changes carefully.
{% endhint %}

#### Storage Migration Notice (from v1.0.0)

* Starting from v1.0.0, changes to the storage key system may cause previously stored data to become inaccessible.
* If the existing key is determined to be invalid, stored data will be automatically reset and a new key will be generated.
* If the key is valid, your data will remain unchanged.
* Downgrading from v1.0.0 to an earlier version may result in loss of access to previously stored data.

{% hint style="info" %}
We strongly recommend backing up important data before updating to avoid potential issues.
{% endhint %}

## Installation

WepinLogin is available through [CocoaPods](https://cocoapods.org/). To install it, simply add the following line to your Podfile:

```sh
pod 'WepinLogin'
```

> ⚠️ **Notice** - Resolution for Build Errors
>
> When building the WepinLogin library, the following error may occur:
>
> `SDK does not contain 'libarclite' at the path '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a'; try increasing the minimum deployment target`
>
> This error can be resolved by changing the "Minimum Deployment Target" setting of the secp256k1 library. Please update the "Minimum Deployment Target" setting of the secp256k1 library project to an iOS version supported by Xcode. This should resolve the build error you are encountering.

### Podfile Configuration

Build errors may occur when using Xcode 26.0.1 or later versions.&#x20;

> error Unable to find module dependency: 'bcrypt' (in target 'WepinLogin' from project 'Pods')&#x20;

If you encounter the above error, please add the following code to your Podfile.

```
post_install do |installer|
  installer.pods_project.targets.each do |target| 
    target.build_configurations.each do |config| 
      config.build_settings['SWIFT_ENABLE_EXPLICIT_MODULES'] = 'NO' 
    end 
  end 
end
```

## Import WepinLogin into your project.

```sh
import WepinLogin
```

## Setting Info.plist

You must add the app's URL scheme to the Info.plist file. This is necessary for redirection back to the app after the authentication process.

The value of the URL scheme should be `'wepin.' + your Wepin app id`.

```html
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <string>Editor</string>
  			<key>CFBundleURLName</key>
  			<string>unique name</string>
        <array>
            <string>wepin + your Wepin app id</string>
        </array>
    </dict>
</array>
```

## Release

The released package versions can be found on the GitHub repository below.

{% embed url="<https://github.com/WepinWallet/wepin-ios-sdk-login-v1/releases>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wepin.io/en/widget-integration/ios-swift-sdk/login-library/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
