iOS SDK

Integration

When setting up a new project, make sure that in Info.plist add "App Transport Security Settings", and add "Allow Arbitrary Loads" and set boolean to YES for both. This SDK depends on GoogleAds-IMA-iOS-SDK, so it wil be setup through pods.

You should add the SDK and its dependencies to your project using CocoaPods.

  • Install CocoaPods and create a Podfile.
  • At the Terminal prompt, enter $ gem install cocoapods to install CocoaPods.
  • Enter $ cd <path-to-your-project>/<your-project>/ to navigate to your project directory.
  • Enter $ pod init to create a file named Podfile. Podfile defines the dependencies for your project.
  • Edit the Podfile
  • In a text editor, open your Podfile.
  • Set the iOS version to 11.0 or greater.
  • If you are using Objective-C, you can comment out "use_frameworks!".
  • Add BridSDK as a dependency. To add a specific version of the SDK, be sure to use the proper Podfile syntax.
  • Save your Podfile and close the text editor.
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'

target 'BridProject' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for BridProject
  pod 'BridSDK'
end
Install the SDK
  • At the terminal prompt of your project directory, enter $ pod install to install the Brid SDK for iOS.
  • Open the .xcworkspace file for your project to launch Xcode.
  • You have retrieved your Brid.tv player license key and imported the Brid SDK for iOS into your project. You can now configure your project.
NOTE

After setting up and testing your app, be sure to remove x86_64 and i386 targets.

Important publishing notes

Stripping Unwanted Architectures: On project Build Phases on + (plus) sing add New Run Script Phase, and add following script after selected Shell /bin/sh:


APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
    FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
    FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
    echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"

    EXTRACTED_ARCHS=()

    for ARCH in $ARCHS
    do
        echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
        lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
        EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
    done

    echo "Merging extracted architectures: ${ARCHS}"
    lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
    rm "${EXTRACTED_ARCHS[@]}"

    echo "Replacing original executable with thinned version"
    rm "$FRAMEWORK_EXECUTABLE_PATH"
    mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"

done