Sample application to show the integration of D1 SDK in to an iOS application. This serves not only as a guide but also as a ready made solution if code needs to be transferred 1:1 to client applications.
Note: Thales SDK support team will supply all config files directly via email.
The following files need to be added to the project:
.
D1
├── D1Configuration.plist
└── D1 SDK Binaries
The D1Configuration.plist
file which holds the D1 backend configuration needs to be added to the project.
Core/D1Configuration.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>D1_SERVICE_URL</key>
<string></string>
<key>ISSUER_ID</key>
<string></string>
<key>D1_SERVICE_RSA_EXPONENT</key>
<string></string>
<key>D1_SERVICE_RSA_MODULUS</key>
<string></string>
<key>DIGITAL_CARD_URL</key>
<string></string>
<key>CONSUMER_ID</key>
<string></string>
<key>CARD_ID</key>
<string></string>
<key>SANDBOX_JWT_URL</key>
<string></string>
<key>SANDBOX_JWT_USER</key>
<string></string>
<key>SANDBOX_JWT_PASSWORD</key>
<string></string>
</dict>
</plist>
The D1Configuration.plist
file is not kept under version control to prevent it from being overwritten during repository update.
For more details, please refer to the D1 SDK Setup section of the D1 Developer Portal.
This sample application was tested with D1 SDK version 4.0.0. D1 SDK binaries need to be placed in to the following location.
Libs/
├── d1-libs-debug
│ ├── D1.xcframework
│ ├── D1Core.xcframework
│ ├── SecureLogAPI.xcframework
│ ├── TPCSDKSwift.xcframework
│ ├── d1-libs-debug.podspec
│ └── package.json
│
└── d1-libs-release
├── D1.xcframework
├── D1Core.xcframework
├── SecureLogAPI.xcframework
├── TPCSDKSwift.xcframework
├── d1-libs-release.podspec
└── package.json
The D1 SDK binaries are wrapped in to Pods to differentiate between the Debug and Release version of the SDK.
Podfile
target 'Templates' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Templates
pod 'd1-libs-debug', :path => './Libs/d1-libs-debug', :configurations => ['Debug']
pod 'd1-libs-release', :path => './Libs/d1-libs-release', :configurations => ['Release']
end
For more details, please refer to the D1 SDK Integration section of the D1 Developer Portal.
To receive access to all D1 services, the user needs to authenticate with D1. This authentication is done using a JSON Web Token (JWT). For the sandbox environment a web service is used to fetch the JWT. The JWT configuration is part of the D1Configuration.plist
file.
For more details, please refer to the D1 SDK Login section of the D1 Developer Portal.
Install CocoaPods:
>> pod install
After all of the configurations have been updated, the generated xcworkspace can be opened and build using Xcode.
The sample application is divided in to multiple modules.
.
├── Core
├── Features
│ ├── Push
│ └── VirtualCard
├── Libs
│ ├── d1-libs-debug
│ └── d1-libs-release
├── Templates.xcodeproj
├── WalletExtension
└── WalletExtensionUI
- Core - Common classes and components for all modules.
- Features/Push - D1-Push use cases.
- Features/VirtualCard - Virtual Card use cases.
- Libs - D1 SDK binaries.
- Templates.xcodeproj - Main application project.
- WalletExtension - Non-UI Extension for Apple Wallet Extension.
- WalletExtensionUI - UI Extension for Apple Wallet Extension.
If you are interested in contributing to the D1 SDK Sample iOS application, start by reading the Contributing guide.