Skip to content

iOS

This guide explains how to install the Hive SDK for iOS using CocoaPods.

Add Hive SDK repository

Add the Hive SDK repository as a source in the generated Podfile.

source 'https://github.com/Com2uSPlatformCorp/HiveSDK-iOS'

Add Hive SDK to the project

Modify the Podfile in your project directory to add the Hive SDK.

source 'https://github.com/CocoaPods/Specs.git'
# Add the Hive SDK repository as a source
source 'https://github.com/Com2uSPlatformCorp/HiveSDK-iOS'

platform :ios, '12.0'
use_frameworks!
inhibit_all_warnings!

$HIVE_SDK_VERSION = '24.1.0' # Hive SDK version

project 'HIVE_SDK_Sample_App.xcodeproj'

target 'HIVE_SDK_Sample_App' do
  # Add the frameworks to use here. At least one framework is required.
  # Example: Add the following framework when using Google IdP login in Hive SDK authentication
  pod 'HiveAuthV4ProviderGoogle', $HIVE_SDK_VERSION # When using Google IdP login for authentication (authv4)
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
     target.build_configurations.each do |config|
     # Change the iOS target of each framework to 12 if it is below 12
     if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 12.0
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
     end
     # Handle xcode 15 TOOLCHAIN_DIR related compile error issues
     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
  end
end