Skip to main content

Native integration

Remotely

Starting the installation

  pod init

Our SDK can be imported using CocoaPods.

SDKCurrent version
ZaigIosDeviceScanpod 'ZaigIosDeviceScan', '~> 5.0.1'
iOS Minimum Deployment Target

15.5

To start the installation, run the command shown above in the root folder of your project.

Adding the source to the Podfile

   source 'https://github.com/ZaigCoding/iOS.git'

The next step is to add QI Tech’s source to the Podfile.

Adding the pod to the Podfile

  pod 'ZaigIosDeviceScan', '~> <version>'

Finally, add the pod name following the format above.

Attention:

Architecture change (v5.0.0+) Starting from version 5.0.0, the SDK started being distributed exclusively in static form. In your Podfile, you must use the configuration :linkage => :static.

Podfile example (Version 5.0.0 or higher)

  source 'https://github.com/ZaigCoding/iOS.git'
target 'ExampleApp' do
use_frameworks! :linkage => :static
pod 'ZaigIosDeviceScan', '~> 5.0.0'
end

post_install do |installer|
installer.pods_project.targets.each do |target|
if ['DatadogCore', 'DatadogInternal', 'DatadogCrashReporting', 'DatadogLogs'].include?(target.name)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.5'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
end

Podfile example (Previous versions)

  source 'https://github.com/ZaigCoding/iOS.git'
target 'ExampleApp' do
use_frameworks!
pod 'ZaigIosDeviceScan', '~> 2.0.0'
end

post_install do |installer|
installer.pods_project.targets.each do |target|
if ['DatadogCore', 'DatadogInternal', 'DatadogCrashReporting', 'DatadogLogs'].include?(target.name)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.5'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
end
Attention

You must enable module stability for the Datadog monitoring dependency to avoid potential compilation issues across different Swift versions. Therefore, add the block described in the post_install section of your Podfile (or include it in the existing post_install block if you already have one).

Attention

When integrating dependencies on iOS, you may need to use static linkage for some libraries and dynamic linkage for others. This setup is relevant to ensure compatibility, avoid build errors, and optimize project performance.

Hybrid linkage of dependencies (if needed)

The need for hybrid linkage arises because some libraries have specific requirements: some need static linkage to avoid internal conflicts and symbol duplication, while other dependencies may need dynamic linkage because they are designed for modularity and sharing across projects.

Differences between static and dynamic linkage

  • Static (static_framework): The library code is embedded directly into the final binary, reducing runtime loading time and eliminating external dependencies at execution time.
  • Dynamic (dynamic_framework): The library is loaded at runtime as a separate file. This reduces the final binary size and makes independent updates/modifications easier.

Configuring hybrid linkage in the Podfile

...

use_frameworks! :linkage => :dynamic # SETTING THE DEFAULT LINKAGE MODE TO DYNAMIC

...

static_frameworks = ['framework_1', 'framework_2', ...] # INCLUDE ALL DEPENDENCIES THAT MUST BE LINKED STATICALY
pre_install do |installer|
installer.pod_targets.each do |pod|
if static_frameworks.include?(pod.name)
def pod.static_framework?;
true
end
def pod.build_type;
Pod::BuildType.static_framework
end
end
end
end

Installing dependencies

  pod install

Finally, run pod install to download and install the dependencies.