iOS Swift Integration Guide
Follow this guide to integrate our SDK into your Swift environment.
Note: Due to GDPR regulations, NinthDecimal is now blocking all ad requests from the affected EEA regions.
First, make sure you’re registered for a developer account at app.kiip.me. Adding an app to your developer account will issue an app key and secret necessary to integrate the NinthDecimal SDK.
If you don’t have a bridging header, make sure to create one.
Mix and Match
Make it look something like this:
Add the Necessary Frameworks
If you’re not using Cocoapods, use the following methods to integrate NinthDecimal. Before you compile and build, do the following:
Drag in the
KiipSDK.frameworkfrom the NinthDecimal SDK folder to your frameworks section.
Drag in the
KiipSDKResources.bundleto your resources section. This is located inside the
Link the following frameworks inside your
Now that you can compile this without any NinthDecimal code, let’s initialize the NinthDecimal singleton inside your
AppDelegate.swift file. Navigate to the didFinishLaunchingWithOptions method. It should look like the following:
Build and voila! You’ve successfully integrated Kiip into your Swift application.
Call a Kiip Moment
Now that the hard part is done, the next step is figuring out where you want to reward users. In test mode (the iOS Simulator is always test mode), you will receive a test reward for every moment call. It’s better to place more reward moments in your code now as you can control whether or not they are rewardable later without having to submit an update.
Find a good place to reward a user and try the following:
Rewarding Virtual Currency
In case you’d like to give users your virtual currency as a reward, we’d recommend the following callback method inside where your KiipDelegate is set.
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.
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.
In case you’d like to see code example projects, we have that as well. Navigate to our Github repo and check out our Swift examples.
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.
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 IPleak.net or a similar service to detect potential IP leaks to ensure you can test NinthDecimal successfully.
We’re happy to answer any questions about integrating NinthDecimal. Please email us.