Methods and parameters

This document provides a detailed reference for the parameters, objects, and methods available in the Revolut ID iOS SDK.

Info

For detailed instructions on how to install and integrate the SDK, see: Revolut ID SDK for iOS: Integration guide.

Methods and parameters

RevolutIdKit.configure method

The RevolutIdKit.configure method sets up the SDK with the required configuration. This must be called before any other SDK usage — typically on app launch in AppDelegate.

RevolutIdKit.configure(
with: RevolutIdKit.Configuration(
environment: .production,
logLevel: .none
)
)
ParameterDescriptionFormatRequired
configurationThe SDK configuration containing environment and log level settings.RevolutIdKit.ConfigurationYes

RevolutIdKit.shared property

The shared singleton instance of RevolutIdKit. Use this to call instance methods after the SDK has been configured.

let kit = RevolutIdKit.shared

RevolutIdKit.authorise method

Redirects the user to the Revolut app (if installed) or the Revolut web app to authorise the requested scopes. On completion, returns either credentials for token exchange, a failure reason, or a cancellation signal.

RevolutIdKit.shared.authorise(
scope: [String],
completion: @escaping (RevolutIdKit.AuthorisationResult) -> Void
)
ParameterDescriptionFormatRequired
scopeAn array of OAuth scopes to request. Available scopes are listed in scopes_supported at the OpenID configuration endpoint.[String]Yes
completionA closure called when the authorisation flow finishes. Returns an AuthorisationResult with credentials on success, a failure reason on error, or .cancelled if the user dismissed the flow.ClosureYes

RevolutIdKit.handle(url:) method

Processes the redirect URL returned by the Revolut app or web app after authorisation. Returns true if the URL was recognised and handled by the SDK.

Call this method in your app's URL handling delegate:

  • Modern apps (iOS 13+): In UISceneDelegate.scene(_:openURLContexts:)
  • Legacy apps: In AppDelegate.application(_:open:options:)
RevolutIdKit.shared.handle(url: URL) -> Bool
ParameterDescriptionFormatRequired
urlThe URL received from the system when your app is opened via the custom URL scheme registered for the SDK.URLYes

RevolutIdKit.revolutLogoIcon24 property

A UIImage of the Revolut logo at 24pt, provided for constructing a sign-in button that meets Revolut brand guidelines.

let image = RevolutIdKit.shared.revolutLogoIcon24

Helper objects and types

RevolutIdKit.Configuration object

Configuration structure used to initialise the SDK. Pass an instance to RevolutIdKit.configure(with:).

public init(
environment: Environment,
logLevel: LogLevel = .none
)
ParameterDescriptionFormatRequired
environmentThe environment the SDK operates in.RevolutIdKit.EnvironmentYes
logLevelControls the verbosity of SDK logs. Defaults to .none.RevolutIdKit.LogLevelNo

RevolutIdKit.Environment enumeration

Specifies whether the SDK targets the production or sandbox Revolut environment.

public enum Environment {
case production
case sandbox
}
CaseDescription
.productionFor live use. Must be paired with a production client ID.
.sandboxFor development and testing. Must be paired with a sandbox client ID. Note: the Revolut mobile app does not support sandbox mode — the user is redirected to the Revolut web app instead.
Info

The sandbox OpenID configuration is available at https://sandbox-sso.revolut.com/.well-known/openid-configuration.

RevolutIdKit.LogLevel enumeration

Controls how much diagnostic output the SDK emits to the console.

public enum LogLevel {
case none
case warning
case error
}
CaseDescription
.noneNo SDK logs are emitted. Recommended for production.
.warningLogs potential issues that do not prevent operation.
.errorLogs only errors that affect SDK functionality.

Callbacks and results

RevolutIdKit.AuthorisationResult enumeration

Returned in the completion closure of authorise(scope:completion:). Represents the final outcome of the authorisation flow.

public enum AuthorisationResult {
case success(Credentials)
case failure(FailureReason)
case cancelled
}
CaseDescription
.success(Credentials)Authorisation succeeded. The associated Credentials value contains the code and codeVerifier needed for backend token exchange.
.failure(FailureReason)Authorisation failed. The associated FailureReason value describes the cause.
.cancelledThe user dismissed the authorisation flow without completing it or explicitly cancels the authorisation flow.

RevolutIdKit.Credentials object

Contains the values your backend requires to exchange for an access token via the token endpoint.

PropertyDescriptionFormat
codeThe authorisation code received from Revolut.String
codeVerifierThe PKCE code verifier generated by the SDK. Must be sent alongside code to complete the token exchange securely.String

Errors

RevolutIdKit.FailureReason enumeration

Describes why an authorisation flow ended in failure. Returned as the associated value of .failure in AuthorisationResult.

public enum FailureReason {
case missingConfiguration
case authorisationNotAvailable
case timeout
case interrupted
case unknown(details: String?)
}
CaseDescription
missingConfigurationRevolutIdKit.configure(with:) was not called before attempting authorisation.
authorisationNotAvailableThe user is not eligible to perform authorisation (for example, they do not have a qualifying Revolut account).
timeoutThe authorisation flow timed out before the user completed it.
interruptedThe authorisation flow was interrupted, for example by the app moving to the background.
unknown(details:)An unexpected error occurred. The optional details string may contain additional context for debugging.
Was this page helpful?