Step1. Installation

    Step1. Installation


    Article summary

    Select one of the following methods to install the Shoplive iOS SDK.

    Do not install duplicates

    Shoplive iOS SDK must be installed using only one method: CocoaPods or Swift Package Manager.


    Install with CocoaPods

    1. Configure the CocoaPods.

    # In project home directory 
    cd ~/projects/PlayShopLive
    
    # If you don't have CocoaPods
    sudo gem install cocoapods
    
    # If your project didn't have CocoaPods initialized
    pod init

    2. Add the following line to your currently-used Podfile:
    1092

    source 'https://github.com/CocoaPods/Specs.git'
    
        # Set it to the same minimum supported version as configured in your project.
        # The Shoplive iOS SDK supports iOS 11.0 and above. It cannot be configured for versions below iOS 11.0.
        platform :ios, '11.0'
        use_frameworks!
    
        # Please configure the Project Target for installing the Shoplive iOS SDK.
        target 'PlayShopLive' do
            pod 'ShopLive', '1.5.8'
            pod 'ShopliveSDKCommon', '1.5.8'
        end

    3. Install the CocoaPods.

    # Run the installation command in the Project home directory. 
    # Include the update command to ensure that the changes from the pod repository are reflected.
    
    # Method 1. pod repo update and, pod install sequentially
    pod repo update
    pod install
    
    # Method 2. pod repo update and pod install together
    pod install --repo-update

    If installation does not work on Apple M1, run the following command.

    sudo arch -x86_64 gem install ffi
    arch -x86_64 pod install

    4. When installation is completed, check the files created from Project - Finder

    1092

    5. Open the xcworkspace file to check the project.


    Install with Swift Package Manager

    1. Go to the Package Dependencies tab in your Xcode project.

    2.  Add the following to the Package Dependencies.

    dependencies: [
        .package(url: "https://github.com/shoplive/ios-sdk", .exact(from: "1.5.8")),
        .package(url: "https://github.com/shoplive/common-ios", .exact(from: "1.5.8"))
    ]

    If installation fails, clear the cache.

    3. Select a target to apply the Shoplive iOS SDK package.

    4. Check the Shoplive iOS SDK from the Package Dependencies.