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

# Flutter Installation

MetaKeep Flutter SDK is a thin and lightweight wrapper around MetaKeep Android and iOS SDKs. You can find an end-to-end working code sample [here](https://github.com/PassbirdCo/MetaKeepCodeSamples/tree/main/other-platforms/flutter/demo_app).

# Requirements

The SDK requires a minimum **Android API version 26** (Android 8.0) or higher and **Java 8** or higher on Android.

This is how `android/app/build.gradle` file should look like:

```groovy build.gradle
android {
    defaultConfig {
        //...
      
        //---> Specify minimum API version
        minSdkVersion = 26
        //<---
      
        //...
    }
}
```

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

This is how `ios/Flutter/AppframeworkInfo.plist` file should look like:

```ruby Podfile
# ....
  <key>MinimumOSVersion</key>
  <string>14.0</string>
# ....
```

Also, update the minimum iOS version in your `ios/Podfile` file:

```ruby
# ....
platform :ios, '14.0'
# ....

```

# Installation

Copy the MetaKeep Flutter SDK package from [here](https://github.com/PassbirdCo/MetaKeepCodeSamples/tree/main/other-platforms/flutter/metakeep_flutter_sdk) and copy it next to your project's folder.

Then, add the following line to the dependencies in your `pubspec.yaml` file:

```yaml
dependencies:
  metakeep_flutter_sdk:
    path: ../metakeep_flutter_sdk
```

Then, run `flutter pub get` to resolve the dependencies.

Also, make sure to run `pod install` after installing the SDK in the `ios` folder of your project.

# Configure Callback

## Android

Define the manifest placeholders for the MetaKeep Domain and Scheme. MetaKeep uses this to register an `intent-filter` for your app and send data back to your app after the user operation.

Define the following placeholders in your `android/app/build.gradle` file:

* **metakeepDomain**: This should be `<app_id>.auth.metakeep.xyz` where `<app_id>` is your app's ID which you can find in the developer console.
* **metakeepScheme**: This should be your app's package name.

This is how your app's updated  `android/app/build.gradle` file should look like:

```groovy Define manifest placeholders
android {
  compileSdkVersion 30
  defaultConfig {
    //...

    //---> Configure MetaKeep Domain and Scheme
    // metakeepDomain: Replace <app_id> with your app's id which you can find in the developer console
    // metakeepScheme: Replace com.domain.app with your app's package name
    manifestPlaceholders += [metakeepDomain: "<app_id>.auth.metakeep.xyz", metakeepScheme: "com.domain.app"]
    //<---
  }
  //...
}
```

## iOS

MetaKeep uses a custom URL scheme to send data back to your iOS 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>

Then, 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 to your `ios/Runner/AppDelegate.swift` file:

```objectivec AppDelegate.swift
import MetaKeep  // import MetaKeep SDK

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  //.............
  
  // Setup MetaKeep callback handler
  override func application(
    _ application: UIApplication,
    open url: URL,
    options: [UIApplication.OpenURLOptionsKey: Any] = [:]
  ) -> Bool {
    // Handle the URL that was passed to the app
    MetaKeep.companion.resume(url: url.description)  // Send callback to MetaKeep SDK
    return true
  }
  
  //............
}
```

© Copyright 2024, Passbird Research Inc.