Manage Sudos
Create Sudos
To create a new Sudo:
do {
let sudoInput = SudoCreateInput(
title: "Mr.",
firstName: "John",
lastName: "Smith",
label: "Shopping",
notes: "Used for shopping.",
avatar: .fileUrl(avatarUrl)
)
let sudo = try await client.createSudo(input: sudoInput)
// Create successful
} catch {
// Handle error. An error may be thrown if the backend is unable
// to create the Sudo due to availability, security or entitlement issues or
// due to unrecoverable circumstances arising from programmatic error or
// configuration error. For example, if the keychain access entitlement
// is not set up correctly, the client is not signed in,
// or basic system resources are unavailable.
}val sudo = Sudo()
sudo.title = "Mr."
sudo.firstName = "John"
sudo.lastName = "Smith"
sudo.label = "Shopping"
sudo.notes = "Used for shopping."
sudo.avatar = avatarUri
CoroutineScope(Dispatchers.IO).launch {
try {
client.createSudo(sudo)
// Sudo created successfully.
} catch (e: SudoProfileException) {
// Handle error.
}
}List Sudos
To list Sudos:
Modify Sudos
To update an existing Sudo:
Subscribe to Changes
To subscribe to a specific Sudo change notification:
To subscribe to Sudo change notification of all types:
Delete Sudos
To delete an existing Sudo:
Get Ownership Proof
Many Sudo Platform services require the user to present a proof that they own a particular Sudo so that a provisioned resource can be associated with a Sudo. Sudo Profiles SDK provides an API to generate a cryptographic proof of Sudo ownership so it can be used in provisioning APIs of other SDKs such as Email SDK.
To obtain a Sudo ownership proof for provisioning a resource tied to a Sudo.
Resetting Client State
You can reset the internal state information maintained by SudoProfilesClient by calling reset API.
Resetting the client state will cause all persistent data to be lost including any cached Sudos and encryption keys. Unless you are intending to import the encryption keys from an external source, e.g. key backup, you should call generateEncryptionKey API to create a new encryption key before using SudoProfileClient again.
Last updated