Skip to main content

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 14 and higher (after version 1.1.1)

Installation

Via cocoapods

Add these source lines on top of your Podfile

source "https://github.com/AmaniTechnologiesLtd/Mobile_SDK_Repo"
source "https://github.com/CocoaPods/Specs"

Add this line on your target:

pod "AmaniVideoSDK"

You'll also need to add the 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 needed if you're using xcode 15
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 != 'Socket.IO-Client-Swift'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
if target.name == 'WebRTC-lib'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
end
end

You may need to run following command before run pod install

pod repo update

Via Manual

You can check our compiled frameworks for your version from the link

https://github.com/AmaniTechnologiesLtd/Public-IOS-SDK/raw/main/Carthage/v3.0.0/AmaniSDK.xcframework.zip?raw=true

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 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 Microphone

<key>NSMicrophoneUsageDescription</key>
<string>This app needs to use camera for video call features</string>

For Camera

<key>NSCameraUsageDescription</key>
<string>This application requires access to your camera for scanning and uploading the document.</string>

Required background modes

You need to add Background Modes on the Signing and Capabilities section on your project.

Required background modes:

  • Audio, AirPlay and Picture in Picture
  • Voice over IP

Alternatively you can add the block below on your info.plist file

<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>voip</string>
</array>