NinthDecimal iOS Integration Guide


This guide will walk you through adding NinthDecimal Rewards to your iOS application. Once you’re done, navigate over to the SDK Docs for extra, optional information.

Note: Due to GDPR regulations, NinthDecimal is now blocking all ad requests from the affected EEA regions.

Getting Started

First, make sure you’re registered for a developer account at Adding an app to your developer account will issue an app key and secret necessary to integrate the NinthDecimal SDK.

Download the NinthDecimal SDK

The latest NinthDecimal SDK is always downloadable from the downloads page.

Add Yourself as a Test Device

There are two ways to set Test Mode using the NinthDecimal SDK.

1. Setting Test Mode at the build level

This Test Mode method requires NinthDecimal SDK 2.3.0 or higher. To set Test Mode at the build level requires including the following flag:

@property (assign, nonatomic) BOOL testMode

The default value for this flag is NO.

2. Setting Test Mode at the device level

If using this method, we recommend adding a test device to your app before getting started with integrating NinthDecimal. However, you can add a test device in the NinthDecimal dashboard at any time.

To add a test device to an iOS app, click the Test Devices button at the bottom of the desired application page on the NinthDecimal Dashboard. Define a unique name for the device and the device’s Advertising ID. You can retrieve your Advertising ID by downloading The Identifiers app.

For pre-iOS 7 devices, substitute the device’s MAC address for Advertising ID.

test device ios

Note: The iOS Simulator will always be recognized as a test device.

Common Testing Questions

What if I’m not in the US? How do I see a NinthDecimal reward? When testing from outside the US it is recommended to use a US-based VPN connection when requesting rewards. Test rewards fill 100% of the time, whereas with live/production rewards it is expected that not every request will be filled with a reward. It is important that you add the correct device identifier inside the Test Devices section of the NinthDecimal dashboard.

A null poptart? No test reward? Some devices work but others don’t!

If you’re getting a null poptart, don’t worry. This means you have correctly saved a moment through the SDK, but we didn’t recognize your device as a test device. Try the following steps:

  • Ensure limited ad tracking is disabled in Settings.
  • Ensure you copied and pasted the advertising identifier correctly (with dashes).

Integrate NinthDecimal

Using Cocoapods

If you’re using Cocoapods, you can integrate the NinthDecimal SDK using a Podfile. If you’re not using Cocoapods, skip this section.

If creating your first Podfile, uncomment these two lines of code (or add them).

platform :ios, '9.0'


In your Podfile, add the following pod command.

pod 'KiipSDK'

Navigate to your project folder in a terminal window, and run the following command:

pod install

Open up “YOUR_PROJECT_NAME”.xcworkspace and click on your project and go to the “Build Setting.” Under Build Option, there is a field called “Always Embed Swift Standard Libraries.” Mark this as “Yes.”

For more information about using CocoaPods with your app, see the CocoaPods Getting Started Guide. Make sure you have the CocoaPods gem installed on your machine before attempting to install any KiipSDK pods.

Add the Necessary Frameworks

If you’re not using Cocoapods, use the following methods to integrate NinthDecimal. Before NinthDecimal can load within your app, you’ll need to verify you can link the following frameworks below.

  1. Drag-drop KiipSDK.framework, and KiipSDKResources.bundle into your XCode project.

  2. Depending on the NinthDecimal SDK version you may need to include the following Framework as well.

  • XIDLibrary.framework (SDK version 3.0.0 - 3.0.2)
  • KIIPMoatMobileAppKit.framework (SDK version 2.3.2 - 3.0.3)
  • OMSDK_Kiipme.framework(SDK version 3.1.0)
  1. In Build Phases, verify that KiipSDK.framework, OMSDK_Kiipme.framework are in the Link Binary with Libraries and the KiipSDKResources.bundle is in Copy Bundle Resources section.

  2. Open your projects Build Phases section and add in the following frameworks:

    • CoreTelephony.framework
    • QuartzCore.framework
    • SystemConfiguration.framework
    • AdSupport.framework
    • WebKit.framework SDK version 2.3.2 and above
    • CoreGraphics.framework
    • MediaPlayer.framework SDK version 2.0.8 and above

Note: NinthDecimal iOS SDK 2.3.2 and above are enabled with MOAT or Open Measurement to measure impressions. If you want a non MOAT NinthDecimal SDK, download NinthDecimal iOS SDK 2.3.1

Note: NinthDecimal iOS SDK 2.3.0 and above requires XCode 7 becuase of bitcode support. They are not compatible with XCode 6 or below. If you are using XCode 6 or below, download Kiip iOS SDK 2.1.1

Linking dependent libraries (SDK version between 3.0.0 and 3.0.2)

  1. Those using NinthDecimal iOS SDK 3.0.0, 3.0.1, or 3.0.2 will need to link the XIDLibrary.framework. Failure to do so will result in a crash.

  2. Go to app settings and click the Build Settings tab.
    • Navigate to Build Options and change ‘Always Embed Swift Standard Libraries’ to Yes.
  3. Go to app settings and click the General tab.
    • Navigate to Embedded Binaries and add the XIDLibrary.framework.

Upload a new build to iTunes Connect (Only applicable if KiipSDK includes XIDLibrary)

  1. Navigate to your working project TARGET -> Build phases.

  2. Click on “+” icon and click on “New Run Script Phase”

  3. Copy script below and paste it into “New Run Script Phase”. This script will remove architectures incompatible with iTunes Connect.

echo "Target architectures: $ARCHS"


find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
echo $(lipo -info "$FRAMEWORK_EXECUTABLE_PATH")


# remove simulator's archs if location is not simulator's directory
case "${TARGET_BUILD_DIR}" in
    echo "No need to remove archs"
    if $(lipo "$FRAMEWORK_EXECUTABLE_PATH" -verify_arch "i386") ; then
    lipo -output "$FRAMEWORK_TMP_PATH" -remove "i386" "$FRAMEWORK_EXECUTABLE_PATH"
    echo "i386 architecture removed"
    if $(lipo "$FRAMEWORK_EXECUTABLE_PATH" -verify_arch "x86_64") ; then
    lipo -output "$FRAMEWORK_TMP_PATH" -remove "x86_64" "$FRAMEWORK_EXECUTABLE_PATH"
    echo "x86_64 architecture removed"

echo "Completed for executable $FRAMEWORK_EXECUTABLE_PATH"
echo $(lipo -info "$FRAMEWORK_EXECUTABLE_PATH")


Changes for iOS 9

Apple has changed its policies regarding TLS versions and only accepts TLSv1.2 SSL connections (iOS 9 and OSX 10.11). Developers will need to override this restriction by adding the following lines to the app’s Info.plist file


Initialize NinthDecimal

Once you verify you’ve successfully linked the NinthDecimal framework in your project, navigate to your AppDelegate.h. You will need the following import:

#import <KiipSDK/KiipSDK.h>

Note: You will need to import the library whenever you want to use a NinthDecimal SDK function.

Then, add an interface for the KiipDelegate in your AppDelegate.h file.

@interface AppDelegate : UIResponder <UIApplicationDelegate, KiipDelegate>

Now, you can initialize NinthDecimal in the didFinishLaunchingWithOptions method, located in AppDelegate.m.

It should look something like this:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    [Kiip initWithAppKey:@"app_key" andSecret:@"app_secret"];
    [[Kiip sharedInstance] setDelegate:self];

    return YES;

Make sure you replace your app_key and app_secret with your actual application key and secret, available on the NinthDecimal dashboard.

Call a NinthDecimal Moment

NinthDecimal moments are points in your Application where you want to reward your user. The end user is allowed to earn rewards multiple times for the same moment. If there is a reward available, the SDK will display the reward to the user.

Locate the file you want to call your NinthDecimal moment, and make sure you import NinthDecimal:

#import <KiipSDK/KiipSDK.h>

Then, when you want to give a reward to a user, call a moment:

[[Kiip sharedInstance] saveMoment:@"Finishing Level One!" withCompletionHandler:^(KPPoptart *poptart, NSError *error) {
    if (error) {
        NSLog(@"something's wrong");
        // handle with an Alert dialog.
    if (poptart) {
        NSLog(@"Successful moment save. Showing reward.");
        [poptart show];
    // handle case with no reward available.
    if (!poptart) {
        NSLog(@"Successful moment save but no reward available.");

With one call, you’ve let the SDK know that you’d like to show a reward. Through the completion handler, you can also handle other logic, such as lowering the app’s volume.

Moment Names

Something to consider is how you name each moment. When you pass a string to the saveMoment call, such as “finishing level one”, it will be displayed to the end user when your app goes live – unless you change your moment names on your dashboard. The string the reward unit provides is: “Congratulations! Here’s a reward for [your moment name]”.

You can always edit your moment titles later on in the dashboard.

Reward Virtual Currency

If your app provides virtual currency, then you can reward your users with that, as well.

First, you’ll need to enable virtual currency rewards in the dashboard, and assign values to each dollar amount.

Then, place the following listener in your AppDelegate.m in order to listen for currency rewards.

- (void) kiip:(Kiip *)kiip didReceiveContent:(NSString *)content quantity:(int)quantity transactionId:(NSString *)transactionId signature:(NSString *)signature {
    // Give the currency to the user by using your in-app currency management.

Make sure virtual currency is enabled for your app. This setting can be found on the app’s profile page in the NinthDecimal dashboard.

This listener will be called by the NinthDecimal SDK after a user redeems a reward that carries a virtual currency value. We will pass a quantity of currency into the method under the quantity parameter and the name of the currency, if there are multiple, under the content parameter. You can then handle depositing the value via your in-game currency management.

If a user chooses not to redeem currency, then the value passed down will be zero.

If a virtual currency postback endpoint is provided to kiip, you can confirm issuance of virtual currency and gain access to additional virtual currency reward opportunities.

Rewarded Video

Access more inventory, increase engagement and drive more revenue with Rewarded Video. To utilize Rewarded Video, designate and individual moments placement in the NinthDecimal dashboard.

NinthDecimal Rewarded Video Moment

Sample Application

We’ve provided a couple of sample applications for you to browse. Check out our public Github repo in case you’d like to try custom notifications, or just need to see some code-samples.

Trouble with test rewards?

If your test device is not located in the US and you’re having trouble retrieving a test reward, please use a VPN with set to a US location.

VPN Assistance

We’re aware of occurances where developers using a US-based VPN experience IP leakage which prevents them from seeing test rewards. We suggest using a service like or a similar service to detect potential IP leaks to ensure you can test NinthDecimal successfully.

Need Help?

We’re happy to answer any questions about integrating NinthDecimal. Please email us.