Search…
Integrate the Relay SDK
Integrate the Relay SDK into your application

Prerequisites

Get Started

Integrate the iOS SDK

Add this line to your Podfile:
1
pod 'SudoDIRelay'
Copied!
Install pod dependencies by running the following command in your project directory:
1
pod install --repo-update
Copied!
This will update the local CocoaPods repository and install the latest version of the Relay SDK.
In order to instantiate a Relay client, make sure you have followed instructions for Getting Started, User SDK and Sudo Profiles SDK (see Prerequisites above).
To instantiate the relay client in your application, add the following:
Swift
1
import SudoDIRelay
2
3
let userClient = // ... see "Users" docs
4
let relayClient = try DefaultSudoDIRelayClient(
5
sudoUserClient: sudoUserClient
6
)
Copied!
You only need one DefaultSudoDIRelayClient 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 Relay 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:sudodirelay:$latest_version'
3
}
Copied!
The latest version of the SDK can be found at SDK Releases.
In order to instantiate a Relay client, make sure you have followed instructions for Getting Started, User SDK and Sudo Profiles SDK (see Prerequisites above).

Client Initialization

To instantiate a client in your application add the following:
Kotlin
1
// val appContext: Context // The Android application context
2
val userClient = // ... see "Users" docs
3
4
val relayClient = SudoDIRelayClient.builder()
5
.setContext(appContext)
6
.setSudoUserClient(userClient)
7
.build()
Copied!
You only need one SudoDIRelayClient 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 Decentralized Identity Relay SDK into your app as quickly and seamlessly as possible.