Swift SDK Setup
Introduction
The Capsule SDK for Flutter allows you to easily integrate secure and scalable wallet functionalities into your mobile applications. This guide covers the installation, setup, and usage of the Capsule SDK, including handling authentication flows.
Prerequisites
An iOS Swift project.
An API key from the Capsule team. Request an API key.
Basic knowledge of iOS Swift development.
Setup
Follow these steps to properly set up the Capsule SDK in your project.
1. Add Capsule SDK as a Package Dependency
In your Xcode project. Go to Target -> MyApp -> General -> Frameworks, Libraries, and Embedded Content, and click the + symbol to add a new package dependency.
On the next screen, click Add Other -> Add Package Dependency.
Enter
https://github.com/capsule-org/swift-sdk
into the search field and select the dependency rule Up to Next Major Version. Ensure the range is0.0.1 < 1.0.0
.Add the package to the project MyApp.
Ensure Add to Target has MyApp selected, and then click Add Package.
2. Initialize the Capsule SDK
In your iOS project, import the Capsule package and initialize it in your app.
3. User and Wallet Creation
To handle user and wallet creation, use the following code snippet as a reference:
4. User Login
To handle user login, use the following code snippet:
Examples and Next Steps
While the Swift SDK may not offer the extensive customization options available in the web SDK, it still allows for effective integration in your iOS applications. We encourage you to explore the examples in the SDK repository for practical implementations and signing solutions.
urlhttps://github.com/capsule-org/swift-sdk-exampleThis example provides a comprehensive guide on how to handle user authentication, wallet creation, and signing messages using the Capsule SDK in a SwiftUI iOS application. Following this example will help you seamlessly integrate Capsule into your project.
For additional integration details, please refer to the documentation in the SDK repository.
pageβRequired CustomizationLast updated