Requirements
- iOS 14.0 or later. Devices are arm64. The simulator slice covers both Apple silicon and Intel Macs.
- Xcode 26 to upload to the App Store. The SDK is built and tested with Xcode 26.3 and declares Swift tools 5.9.
- The values from What you need from us, and a backend that creates SDK runs.
Info.plist key and no entitlement.
Install
- Swift Package Manager
- CocoaPods
In Xcode, choose File → Add Package Dependencies and enter
https://github.com/Cr3dentials/zktls-sdk-releases. Add the product ZktlsSDK to your app target.In a Package.swift:R8287QD4F7. To check it, run codesign -dv ZktlsSDKFFI.xcframework.
Build the run’s configuration
Fetch the trust bundle and the policy bundle right before each run, and build oneTreeRunConfig from them and from the run your backend issued:
Run a verification
backend, show and message(for:) are yours. Errors has a message(for:) that covers every case.
When runTree throws, or returns with neither delivered nor handedOff, nothing reached Cr3dentials. Tell your backend so it terminates the run.
What runTree returns
Your app never sees the platform’s data. TreeSummary only tells you how the run ended:
Things to know
- The disclosure.
TreeWebViewHostshows yourTreeDisclosurebefore it opens any page. If the user declines, nothing opens. Write it in your own words and translate it. - Where the page may go. The WebView stays on the platform’s domains and on the third-party sign-in providers the pack lists. If the user follows a link anywhere else, the run ends with
SdkError.Policy("navigation_refused: <host>"). - Your app’s web data. Each run has its own non-persistent data store, so your own WebViews and cookies are untouched.
- Background time. Begin
ZkTlsLifecyclewhen theattestingphase starts, and letlifecycle.end()run on every path. iOS usually grants about 30 seconds in the background. The hand-off takes seconds and at most 120 seconds. If iOS ends the time first,onExpirycancels the run, and the user starts again. - Cancelling.
cancel()endsrunTreewithSdkError.Cancelledand closes the page. Cancelling theTaskdoes the same, and so does the user closing the page. - Threads.
runTreeruns on the SDK’s own threads, so call it from any task.onProgresscalls you on an SDK thread. Hop to the main actor for UI, and don’t block in the callback. - Logging. Log error cases and their text only. Never log the run’s
accessToken, cookies or your app credential.
