The iOS SDK is available in sandbox only. Production support is on the roadmap.
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
- Swift Package Manager
- CocoaPods
Add the package to your Then add the
Package.swift, or add it in Xcode under File > Add
Package Dependencies: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:- Choose an
httpscallback URL on a domain that you control, such ashttps://app.example.com/sca/callback. The SDK refuses a URL that includes a port or an IP address. Circle doesn’t accept custom schemes. - Register every exact callback URL that you use in Circle Hub, under Settings > Digital Asset Accounts > SCA. Register separately in sandbox and production.
- Add a
webcredentials:entry for the host to your application’s Associated Domains, and serve the matchingapple-app-site-associationfile.
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 aDaaSca 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:
Errors
The ceremony methods throwDaaScaError:
message is for your logs. Don’t show it to the end customer.