SDK Installation

Important: Before you begin to install Real-time CDP SDK, ensure that you are on macOS High Sierra and App deployment version iOS 10.0 and later.

To install Real-time CDP SDK for iOS app:

  1. Download and install Apple Xcode IDE.

    Download Xcode from the Mac App Store and install it on your Mac.

  2. Add the framework to the project.

    Add the Real-time CDP SDK source code to your Xcode project by dragging the file into your Project Navigator.

  3. Add the script to strip the simulator content.

    Add the following script under the build phase and run it to strip the simulator content when archiving.

    Copy
    # Signs a framework with the provided identity
    code_sign() {
    # Use the current code_sign_identitiy
    echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
    echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1"
    /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
    }


    echo "Stripping frameworks"
    cd "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}"


    for file in $(find . -type f -perm +111); do
    # Skip non-dynamic libraries
    if ! [[ "$(file "$file")" == *"dynamically linked shared library"* ]]; then
    continue
    fi
    # Get architectures for current file
    archs="$(lipo -info "${file}" | rev | cut -d ':' -f1 | rev)"
    stripped=""
    for arch in $archs; do
    if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
    # Strip non-valid architectures in-place
    lipo -remove "$arch" -output "$file" "$file" || exit 1
    stripped="$stripped $arch"
    fi
    done
    if [[ "$stripped" != "" ]]; then
    echo "Stripped $file of architectures:$stripped"
    if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then
    code_sign "${file}"
    fi
    fi
    done