Install Skillz via Cocoapods

Cocoapods is a great Ruby utility that lets developers painlessly add frameworks to their XCode project. This guide will help you include the Skillz SDK in your Xcode project using Cocoapods, and adjust your project settings to work with it. If you need additional help, submit a help request.

This guide assumes you are already using Cocoapods in your project. If this is not the case, then it would be simpler to follow our manual integration steps.

Before you can integrate the Skillz SDK into your game, you must first properly add it to your Xcode project. For this and all future articles, we require the use of Xcode 7.

 

Step 1: Add Skillz SDK to your Podfile

Inside your game’s build target in the Podfile, add a new pod command, pod 'Skillz'. Don’t forget to run pod install, and always use the “.xcworkspace” file to open the project when using Cocoapods.

At the top of your Podfile, ensure that there are entries for both platform :ios, '8.0' and use_frameworks!.

Note: You must be using Cocoapods v0.39. As of 11.29.15 this is still the prerelease version. Instructions for installing this version can be found here

 

Step 2: Add the Skillz run script

The final configuration step is to add a Skillz-specific script to the Build Phases of your project.

Go into your project target in XCode. Select the Build Phases section and click the + sign to add a New Run Script Phase.

Confirm the shell is set to /bin/sh and paste the following into the box:

if [ -e "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Skillz.framework/postprocess.sh" ]; then
    /bin/sh "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Skillz.framework/postprocess.sh"
fi

Ensure that this script is the last item in Build Phases.

This script will add a standard NSLocationWhenInUseUsageDescription property to your project’s Info.plist if it isn’t already present. If this property already exists, we recommend updating the description string to reflect that cash gameplay requires location information for legal reasons.

 

Next steps

After completing these steps, the Skillz SDK should be properly included in your project, and you should be able to compile your game without errors.

The next step is to perform the actual integration!