Asynchronous APIs on D1 SDK 4.5.0
Asynchronous APIs on D1 SDK 4.5.0
Overview
D1 SDK 4.5.0 introduces asynchronous API updates for iOS.
The updated APIs support Swift concurrency.
Use this guide to review the affected APIs and update your issuer application.
What changed
The previous API surface is deprecated in D1 SDK 4.5.0.
If your issuer application uses asynchronous calls, replace completion handlers with Swift concurrency APIs.
This page lists the APIs changed in 4.5.0.
Migrate to digitalCardService
Review your current integration
Identify the deprecated D1 SDK APIs used by your issuer application.
Focus on the APIs now exposed through digitalCardService.
Initialize digitalCardService
Initialize digitalCardService from d1Task before calling the updated APIs.
Replace completion handlers
Replace each completion-handler API with the corresponding async throws API.
Validate the migrated flows
Build and test your issuer application after the migration.
Validate the updated digital card flows.
Update asynchronous handling
Use the Swift concurrency APIs if your issuer application uses Swift concurrency.
This makes asynchronous code easier to read and maintain.
digitalCardService calls now use async throws instead of completion handlers.
API changes in 4.5.0
Use this section to review the APIs changed in D1 SDK 4.5.0.
Initialize the service from d1Task before calling the APIs.
digitalCardService
activateDigitalCard(withDigitalCardID:)
Before:
Now:
activateDigitalCard(_:)
Before:
Now:
digitalCardList(_:)
Before:
Now:
updateDigitalCard(_:digitalCard:action:)
Before:
Now:
Last updated
Was this helpful?