Add the following line at the top of any Swift file where you want to use the SDK:
Initialize the SDK in AppDelegate.swift or SceneDelegate.swift, depending on your project setup.
import UIKit
import Mpc
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
var passkey: PasskeyClient? = nil
if let flutterDelegate = delegate as? FlutterAppDelegate {
passkey = PasskeyClientImpl(window: flutterDelegate.window, apiKey: "API_KEY", authServerAddress: "AUTH_SERVER_ADDRESS")
} else {
passkey = PasskeyClientImpl(window: delegate.window, apiKey: "API_KEY", authServerAddress: "AUTH_SERVER_ADDRESS")
}
let client = MpcClient(
"YOUR_SERVER_ADDRESS",
"YOUR_TOKEN",
"YOUR_MODE",
"AUTH_SERVER_ADDRESS",
"MAIN_SERVER_ADDRESS",
passkey
)
client.initClient()
}
}