Preparation
To setup iOS SDK correctly, you must complete the steps below.
Requirements
The minimum requirements for this SDK are:
- iOS 13.0 and higher
- Xcode 13 and higher
You also need to add OpenSSL package because some of our customers wants to use this SDK as static library so we removed it from our dependencies. When you want to use AmaniSDK you need to be sure OpenSSL must be installed.
You can check this link for installing OpenSSL via package managers or you can use the helper script provided in OpenSSL repository for compiling OpenSSL on your own.
Required iOS version if you're are planning to use the NFC is 13.0 or higher
If your app will be compiled for devices that doesn't have NFC support, you must do these steps.
Installation
Via Cocoapods
Adapt your Podfile and add the Amani SDK
Add lines to first line of pod file
source "https://github.com/AmaniTechnologiesLtd/Mobile_SDK_Repo"
source "https://github.com/CocoaPods/Specs"
And then you can add the pod as shown below.
pod 'AmaniSDK', '~> 3'
Add our post install hook
post_install do |installer|
xcode_base_version = xcodebuild -version | grep 'Xcode' | awk '{print $2}' | cut -d . -f 1
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
# This block is for Xcode 15 updates
if config.base_configuration_reference && Integer(xcode_base_version) >= 15
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
end
if target.name == 'AmaniSDK'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
end
end
Via Carthage
Adapt you Cartfile and add the Amani SDK
binary "https://raw.githubusercontent.com/AmaniTechnologiesLtd/Mobile_SDK_Repo/main/AmaniSDK.json"
``` -->
### Via Manual
You can check our compiled frameworks for your version from the link
## Required Permissions
Amani SDK makes use of the device's Camera, Location and NFC. If you dont want to use location service please provide in init method. You must have the following keys in your application's Info.plist file:
:::note
You need to add all keys according to your usage.
:::
### For NFC
```xml
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A0000002471001</string>
<string>E80704007F00070302</string>
<string>A000000167455349474E</string>
<string>A0000002480100</string>
<string>A0000002480200</string>
<string>A0000002480300</string>
<string>A00000045645444C2D3031</string>
</array>
<key>NFCReaderUsageDescription</key>
<string>This application requires access to NFC to scan IDs.</string>
For Location
<key>NSLocationWhenInUseUsageDescription</key>
<string>This application requires access to your location to upload the document.</string>
<key>NSLocationUsageDescription</key>
<string>This application requires access to your location to upload the document.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This application requires access to your location to upload the document.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This application requires access to your location to upload the document.</string>
For Camera
<key>NSCameraUsageDescription</key>
<string>This application requires access to your camera for scanning and uploading the document.</string>
Grant accesss to NFC
Enable the Near Field Communication Tag Reading capability in the target Signing & Capabilities.
Supporting non-NFC devices
For non NFC supported device (like iPhone 6) there is no CoreNFC library in system and also we are using some ios crypto libraries for reading nfc data supported after iOS 13. You need to add below listed libraries as optional under Build Phases->Link Binary With Libraries menu. Even if you don't use the nfc process, you should add for compiling your app correctly.
CoreNFC.framework
CryptoTokenKit.framework
CryptoKit.framework