Skip to content

Conversation

@davidz25
Copy link
Contributor

@davidz25 davidz25 commented Jan 7, 2026

This uses the W3C Digital Credentials API available in iOS 26.0 and later to implement the existing DigitalCredentials interface in Multipaz which is already implemented on Android.

This also adds a new multipaz-swift library which contains Swift and SwiftUI code for using the bindings on iOS. This is equivalent to multipaz-compose and for example contains a DocumentModel object that works with native Swift and SwiftUI mechanisms and also a Consent view which for consent prompts entirely implemented using SwiftUI. Crucially, it also contains RequestAuthorizationView which can be used to implement IdentityDocumentProvider according to Apple's guidelines for making an application an identity document provider.

Update Multipaz Test App to use all this new machinery. Since the Identity Document Provider runs as an extension, make Test App to use app groups for storage so the main app and the identity document provider extension can share data. This work includes introducing IosStorage.

Update our verifier to use ReaderAuthAll and UseCases since iOS 26.0 depends on this. Also change the default protocol to be Annex C instead of OpenID4VP 1.0.

Rename Platform to TestAppConfiguration in testapp since this is more succinct and also avoids name clash with the Platform expect/actual object in Multipaz.

Rename CredentialPresentmentModalBottomSheet in multipaz-compose to ConsentModalBottomSheet and factor out the main functionality into a Consent composable. (This work stems from an unsuccesful attempt to use Compose Multiplatform in the document provider extension. This ended up not working because the extension is limited to 120 MB of RAM usage and Compose pushes it to that limit when using the Consent composable. We ended up just implementing the consent prompt in SwiftUI instead.)

Update README.md to mention new libraries and fix existing text to match what's in the repo today.

Some work is still needed in the SwiftUI consent prompt but it's good enough for now with simple requests.

Fixes #1364.

See https://www.youtube.com/watch?v=x5gWl-sqjfo for a demo.

Test: Unit tests pass.
Test: Manually tested Test App on iOS and Android.

@davidz25 davidz25 requested a review from sorotokin January 7, 2026 15:26
@davidz25 davidz25 force-pushed the dc-api-on-ios branch 3 times, most recently from 3897ba9 to 022cbf1 Compare January 7, 2026 15:55
@davidz25 davidz25 requested a review from koukarine January 7, 2026 18:25
// DocumentProviderExtension
//
// Created by David Zeuthen on 10/8/25.
// Copyright © 2025 orgName. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Copyright © 2025 orgName" does not sound right ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@koukarine koukarine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with minor concerns noted.

)
}

override suspend fun getTable(spec: StorageTableSpec): StorageTable = sqliteStorage.getTable(spec)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not quite right, as for the table that is returned table.storage is not going to be this. Maybe just make SqliteStorage open?

May be a duplicate comment? Somehow I do not see my original one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. Fixing.

This uses the W3C Digital Credentials API available in iOS 26.0 and
later to implement the existing `DigitalCredentials` interface in
Multipaz which is already implemented on Android.

This also adds a new `multipaz-swift` library which contains Swift and
SwiftUI code for using the bindings on iOS. This is equivalent to
`multipaz-compose` and for example contains a `DocumentModel` object
that works with native Swift and SwiftUI mechanisms and also a
`Consent` view which for consent prompts entirely implemented using
SwiftUI. Crucially, it also contains `RequestAuthorizationView` which
can be used to implement [IdentityDocumentProvider](https://developer.apple.com/documentation/IdentityDocumentServices/Implenting-as-an-identity-document-provider)
according to Apple's guidelines for making an application an identity
document provider.

Update Multipaz Test App to use all this new machinery. Since the
Identity Document Provider runs as an extension, make Test App to use
[app groups](https://developer.apple.com/documentation/Xcode/configuring-app-groups)
for storage so the main app and the identity document provider
extension can share data. This work includes introducing `IosStorage`.

Update our verifier to use ReaderAuthAll and UseCases since iOS 26.0
depends on this. Also change the default protocol to be Annex C
instead of OpenID4VP 1.0.

Rename `Platform` to `TestAppConfiguration` in testapp since this is
more succinct and also avoids name clash with the `Platform`
expect/actual object in Multipaz.

Rename `CredentialPresentmentModalBottomSheet` in multipaz-compose to
`ConsentModalBottomSheet` and factor out the main functionality into a
`Consent` composable. (This work stems from an unsuccesful attempt to
use Compose Multiplatform in the document provider extension. This
ended up not working because the extension is limited to 120 MB of RAM
usage and Compose pushes it to that limit when using the `Consent`
composable. We ended up just implementing the consent prompt in
SwiftUI instead.)

Update README.md to mention new libraries and fix existing text to
match what's in the repo today.

Some work is still needed in the SwiftUI consent prompt but it's good
enough for now with simple requests.

Fixes #1364.

See https://www.youtube.com/watch?v=x5gWl-sqjfo for a demo.

Test: Unit tests pass.
Test: Manually tested Test App on iOS and Android.
Signed-off-by: David Zeuthen <zeuthen@google.com>
@davidz25 davidz25 merged commit 0174e3d into main Jan 8, 2026
3 checks passed
@davidz25 davidz25 deleted the dc-api-on-ios branch January 8, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DC API on iOS

4 participants