---
updatedAt: 2025-07-26T15:11:36.000Z
agentTools:
  projectIndex: https://docs.metakeep.xyz/llms.txt
---

# iOS

# Requirements

Mobile iOS SDK requires **iOS 14.0** or higher, **Xcode 14.0** or higher, and **Swift 5.0** or higher.

> 👍 Let us know if want us to support older versions of iOS.

# Installation

Mobile iOS SDK is available as a Swift Package at the official [MetaKeep repository](https://github.com/PassbirdCo/MetaKeepSDK). To install it, add the package to your Xcode project.

Navigate to `File > Add Packages` and enter the repository URL.

<Image title="Screen Shot 2023-02-07 at 11.25.27 PM.png" alt={322} align="center" border={true} src="https://files.readme.io/18c0591-Screen_Shot_2023-02-07_at_11.25.27_PM.png">
  Add package through the File menu
</Image>

<Image title="Screen Shot 2023-02-07 at 11.25.54 PM.png" alt={2767} align="center" border={true} src="https://files.readme.io/e43146e-Screen_Shot_2023-02-07_at_11.25.54_PM.png">
  Enter repository URL
</Image>

Then, select the dependency rule as `Up to Next Major Version` and choose version `2.0.3`. Finally, click `Add Package` and the SDK will be added as a dependency to your project.

<Image title="Screen Shot 2023-02-07 at 11.26.20 PM.png" alt={2767} align="center" border={true} src="https://files.readme.io/494a21a-Screen_Shot_2023-02-07_at_11.26.20_PM.png">
  Select the dependency rule and click `Add Package`
</Image>

# Configure custom URL scheme

MetaKeep uses a custom URL scheme to send data back to your app after the user's operation.

Navigate to the `Info tab` of your app target settings in XCode. In the `URL Types` section, click the `＋` button to add a new URL. Enter the following values:

* **Identifier**: metakeep
* **URL Schemes**: $(PRODUCT\_BUNDLE\_IDENTIFIER)

<Image title="Screen Shot 2023-02-07 at 11.39.07 PM.png" alt={2767} align="center" src="https://files.readme.io/c066d83-Screen_Shot_2023-02-07_at_11.39.07_PM.png">
  Create new `URL Type`
</Image>

# Capture callback URL

Configure your app to handle the callback URL. The URL is invoked by MetaKeep after the user's operation. The URL contains the result of the operation.

To capture the callback URL, add the following code depending on the app UI lifecycle you are using:

```swift SwiftUI app lifecycle
import MetaKeep // import MetaKeep SDK

SomeView()
    .onOpenURL { url in // Add onOpenURL handler.
        MetaKeep.companion.resume(url: url.description) // Send callback to MetaKeep SDK
    }
```
```swift UIKit app lifecycle with Scenes
// SceneDelegate.swift
import MetaKeep // import MetaKeep SDK

func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
    guard let url = URLContexts.first?.url else { return }
    MetaKeep.companion.resume(url: url.description) // Send callback to MetaKeep SDK
}
```
```swift UIKit app lifecycle
// AppDelegate.swift
import MetaKeep // import MetaKeep SDK

func application(_ app: UIApplication,
                 open url: URL,
                 options: [UIApplication.OpenURLOptionsKey: Any]) -> Bool {
    MetaKeep.companion.resume(url: url.description) // Send callback to MetaKeep SDK
    return true
}
```

© Copyright 2024, Passbird Research Inc.