Skip to content

iOS

Modify the Podfile in the Xcode project directory to add the Hive SDK functionality as frameworks. Here, we guide you through using only Google authentication and Apple AppStore payment as an example.

Select feature to use

Add the Google authentication and Apple AppStore payment frameworks to the Podfile in the project directory.

pod 'HiveAuthV4ProviderGoogle', $HIVE_SDK_VERSION # Use Google IdP login for authentication (authv4)
pod 'HiveIAPV4', $HIVE_SDK_VERSION # Use appstore in-app purchases for payment (iapv4)

Below is the entire example of the Podfile, including the installation of the Hive SDK, when the above frameworks are added. For more detailed information, refer to the Podfile.lock file generated after the framework installation.

source 'https://github.com/CocoaPods/Specs.git'
# Add 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
   pod 'HiveAuthV4ProviderGoogle', $HIVE_SDK_VERSION # Use Google IdP login for authentication (authv4)
   pod 'HiveIAPV4', $HIVE_SDK_VERSION # Use appstore in-app purchases for payment (iapv4)
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
     # Address xcode 15 TOOLCHAIN_DIR related compile error issue
     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

After saving the Podfile with the added frameworks as above, run the following command to install the frameworks in the project.

pod install

Additional settings

This is the guide for additional settings required to install the Hive SDK features.

Google IdP settings

This is the guide for setting up Google IdP. Follow the instructions below to enter the Reversed Client ID in the Xcode project.

  1. Select your project in the project navigator of the Xcode project window.
  2. Select your app from the TARGETS list.
  3. Click the Info tab.
  4. Click the URL Types section in the Info tab, then click the + icon to create an additional URL type property.
  5. Under the additional URL type properties, leave the Identifier field blank and enter the reversed client ID in the URL Schemes field.
Info

For detailed information on each Hive SDK feature (authentication, billing, notification, etc.), please refer to the respective feature guides.