Skip to main content
The iOS SDK is available in sandbox only. Production support is on the roadmap.
The iOS SDK runs in your application on the end customer’s iPhone. It never holds your API key and makes no calls to the Circle API itself. Your backend does that and passes your application only the short-lived token for one ceremony.

What you can do

  • Approve operations with a passkey: run passkey enrollment and approval for Strong Customer Authentication (SCA) in a Swift application.
  • Hold the authorization key for non-custodial accounts: the React Native SDK calls this SDK to create the end customer’s authorization key in the Secure Enclave and sign with it. You don’t call these methods yourself. To build a non-custodial account integration, use the React Native SDK.

Requirements

Passkey enrollment and approval need iOS 17.4 or later, because Circle accepts only https callback URLs, which ASWebAuthenticationSession supports from iOS 17.4. On earlier versions, or in an app built with Xcode earlier than 15.3, DaaScaConfiguration throws DaaScaConfigurationError.httpsCallbackUnavailable. If you serve end customers who need Strong Customer Authentication, check for this error and tell the end customer to update iOS before they can approve an operation.

Install

Add the package to your Package.swift, or add it in Xcode under File > Add Package Dependencies:
Then add the DaaSdk product to your application target.

Set up the callback

When a ceremony finishes, Circle’s page returns the result to your application through an app callback URI. Set it up once for each environment:
  1. Choose an https callback URL on a domain that you control, such as https://app.example.com/sca/callback. The SDK refuses a URL that includes a port or an IP address. Circle doesn’t accept custom schemes.
  2. Register every exact callback URL that you use in Circle Hub, under Settings > Digital Asset Accounts > SCA. Register separately in sandbox and production.
  3. Add a webcredentials: entry for the host to your application’s Associated Domains, and serve the matching apple-app-site-association file.
Your backend sends the same callback URL as redirectUri when it opens each passkey registration or challenge. It replaces embedOrigin, which applies only to web pages. If the value doesn’t exactly match a registered URL, Circle returns error code 420068.

Initialize

Create a DaaSca with a DaaScaConfiguration:
An invalid value throws DaaScaConfigurationError.

Methods

DaaSca runs on the main actor. Its ceremony methods are async and present Circle’s page in an ASWebAuthenticationSession sheet. Without an anchor, the SDK presents over the key window of the foreground scene. Pass an anchor when your application has more than one window, such as on iPad. One ceremony runs at a time: starting another one, or cancelling the Swift Task, cancels the open ceremony. This example approves a transfer. Your backend opens the challenge, returns only the frame token, and later sends the transfer with the assertion:
For the backend steps, see How-to: Implement Strong Customer Authentication.

Errors

The ceremony methods throw DaaScaError: message is for your logs. Don’t show it to the end customer.

Versions

The SDK follows semantic versioning. Before version 1.0.0, a minor version can include breaking changes, so pin an exact version. If you also use the React Native SDK, use the iOS SDK version that it pins.