Search…
Integrate the Virtual Cards SDK
Integrate the Virtual Cards SDK into your application

Prerequisites

Get Started

Integrate the iOS SDK

The iOS SDK is open source and compatible with iOS 11 and above.
Cocoapods
To use the Virtual Cards SDK in an iOS app you need to install the SudoVirtualCards pod via Cocoapods.
If your project has not already been initialized for cocoapods, run the following command from the project's root directory
1
pod init
Copied!
Open the Podfile file in a text editor and add SudoVirtualCards pod as a dependency to the application
Podfile
1
target 'YOUR-APP-NAME' do
2
use_frameworks!
3
pod 'SudoVirtualCards'
4
end
Copied!
Install pod dependencies by running the following command
1
pod install --repo-update
Copied!
This will update the local CocoaPods repository and install the latest version of the Virtual Cards SDK.
In order to instantiate a Virtual Cards client, make sure you have followed instructions for Getting Started, User SDK and Sudo SDK (see Prerequisites above)

Client Initialization

To instantiate a client in your application, add the following
Swift
1
import SudoVirtualCards
2
​
3
let userClient = // ... see "Users" docs
4
let profilesClient = // ... see "Sudos" docs
5
​
6
do {
7
let virtualCardsClient = DefaultSudoVirtualCardsClient(
8
keyNamespace: keyNamespace,
9
userClient: userClient,
10
profilesClient: profilesClient)
11
} catch {
12
// Handle initialization error. An error might be thrown due to invalid
13
// or missing confiugration file.
14
}
Copied!
You only need one client instance for a given user per device. Instantiating multiple clients with the same configuration and using them at the same time may cause unexpected runtime errors to occur.
See it in action. Be sure to take a look at the open source iOS sample app on Github that our team published as a reference for integrating the Virtual Cards SDK into your app as quickly and seamlessly as possible.

Integrate the Android SDK

The Android SDK is open source and compatible with Android 6 (API level 23) and above.
Gradle
Add this line to the dependencies section of the app module build.gradle and synchronize your project with Android Studio.
1
dependencies {
2
implementation 'com.sudoplatform:sudovirtualcards:$latest_version'
3
}
Copied!
The latest version of the SDK can be found at SDK Releases.
In order to instantiate a Virtual Cards client, make sure you have followed instructions for Getting Started, User SDK and Sudo SDK (see Prerequisities above)

Client Initialization

To instantiate a client in your application, add the following
Kotlin
1
val userClient = // ... see "Users" docs
2
val profilesClient = // ... see "Sudos" docs
3
​
4
val virtualCardsClient = SudoVirtualCardsClient.builder()
5
.setContext(appContext)
6
.setSudoUserClient(userClient)
7
.setSudoProfilesClient(profilesClient)
8
.build()
Copied!
You only need one client instance for a given user per device. Instantiating multiple clients with the same configuration and using them at the same time may cause unexpected runtime errors to occur.
See it in action. Be sure to take a look at the open source Android sample app on Github that our team published as a reference for integrating the Virtual Cards SDK into your app as quickly and seamlessly as possible.
Last modified 11mo ago