iOS Swift Integration Guide
Follow this guide to integrate our SDK into your Swift environment.
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 Kiip 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
Before you compile and build, do the following:
Drag in the
KiipSDK.frameworkfrom the Kiip 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 Kiip code, let’s initialize the Kiip 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 Kiip dashboard.
This listener will be called by the Kiip 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 Kiip 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.
We’re happy to answer any questions about integrating Kiip. Please email us.