Add the SDK to Your App
The recommended development environment is:
- Apple Xcode® (latest available version)
- The minimum target version supported by the SDK:
- For iOS - 15.0
- For macOS - 13.0
The HID Approve SDK for iOS/macOS distribution is available in two multi-platform binary framework (XCFramework) bundle variants designed for specific integration environments.
-
For PRODUCTION environments, use the HID_Approve_SDK.xcframework bundle which supports the following architectures:
-
iOS Production (ARM64)
-
macOS (Apple Silicon ARM64, Intel x86-64)
-
-
NON-PRODUCTION environments, use the HID_Approve_SDK_NonProd.xcframework bundle which supports the following architectures:
-
iOS Integration-Testing (ARM64)
-
iOS Simulator (Apple Silicon ARM64, Intel x86-64)
In this variant, the built-in anti-debugging and anti-swizzling defenses have been disabled to allow the use of debugging tools such as Flex and Flipper for internal integration testing.
Important: As an integrator, you are responsible for ensuring that the Non-Production version of the SDK is not deployed in production.With the disabled defenses in the non-production variant, it could potentially allow a malevolent attacker to bypass security measures and facilitate reverse engineering of sensitive algorithms or business logic.
-
In addition, the HID Approve SDK package for Apple Wallet (HID_Approve_SDK_Wallet.framework) contains the following framework binaries:
-
Framework for PRODUCTION environments (iOS)
-
Framework for internal/NON-PRODUCTION only (iOS)
-
Framework for internal/NON-PRODUCTION only (iOS Simulator (Apple Silicon ARM64, Intel x86-64))
The following are recommended XCode secure-coding compiler settings:
- Debugging symbols stripped (release binary) - build setting
- Automatic Reference Counting (ARC) memory management - build setting
- Stack Canary – buffer overflow protection
- Position Independent Executable (PIE) to enable full ASLR for binary - set Generate Position-Dependent Code to NO
- Stack smashing protection is activated with PIE and "-fstack-protector-all" (Other C Flags)
"-fstack-protector-all" (Other C Flags)
For further information, go to https://developer.apple.com/forums/thread/104048
For further information, go to https://developer.apple.com/library/archive/qa/qa1788/_index.html
The SDK does not support the Apple “sharing access to keychain items among a collection of apps” feature. Sharing access to keychain items between several apps will lead to irrecoverable errors.
For further information about the feature, go to https://developer.apple.com/documentation/security/keychain_services/keychain_items/sharing_access_to_keychain_items_among_a_collection_of_apps.
Your cross-platform framework might require disabling Bitcode on the HID Approve SDK framework.
This can be done automatically by disabling Bitcode in the Xcode build options - in the Build Settings tab, go to Build Options and set Enable Bitcode to No.
Alternatively, you can disable the functionality using the xcode strip_bitcode utility:
Sample command to disable Bitcode
xcrun bitcode_strip -r HID_Approve_SDK.xcframework/ios-arm64/HID_Approve_SDK.framework/HID_Approve_SDK -o HID_Approve_SDK.xcframework/ios-arm64/HID_Approve_SDK.framework/HID_Approve_SDK
For further information about Bitcode deprecation, refer to the Apple XCode 14 Release Notes (item 86118779).
Use the SDK in your App
The HID Approve SDK is delivered as a XCFramework bundle (HID_Approve_SDK.xcframework). It is available in the iOS/Libraries folder of the delivery package.
In order to facilitate testing during the development process, this XCFramework bundle also provides the iOS simulator binaries.
- Copy the XCFramework bundle (content of the iOS/Libraries folder) to your preferred libraries location.
- In your Xcode target, add the XCFramework bundle to your project Frameworks, Libraries and embedded contents setting.
Add Functions to your App
Integrating with the Apple® Wallet Extension
Managing Persistent Data
For iOS and macOS, the HID Approve SDK stores it's persistent data in several databases.
-
If your iOS/macOS application encounters the SDK initialization fatal error, or an application full cache cleanup is required, call the HIDDeviceFactory.reset() method to delete all the SDK databases.
-
When uninstalling the application:
-
On iOS where applications are sandboxed, all the SDK databases are deleted automatically when the application is uninstalled.
-
For macOS, the SDK databases are stored in the user's library directory (for example, Users/%username%/Library/Containers/%appbundlename%).
To locate the path, use the following APIs:
-
For Swift - FileManager.urls API with the with the directory (set to libraryDirectory) and domainMask (set to userDomainMask) parameters as described in https://developer.apple.com/documentation/foundation/filemanager.
-
For Objective-C - NSFileManager.URLsForDirectory API with the directory (set to NSLibraryDirectory) and domainMask (set to NSUserDomainMask) parameters as described in https://developer.apple.com/documentation/foundation/nsfilemanager.
Note: This directory will remain on the macOS workstation even after the application is uninstalled.As an integrator, you must make sure the SDK's persistent data is correctly removed.
-
-