Kwizzad SDK for iOS
Showcase
Prerequisites
- You already have your own KWIZZAD API KEY and PLACEMENT ID. If not, please contact TVSMILES per E-Mail and we will register your APP.
- Apps integrating KWIZZAD SDK require at least iOS 8.0.
- A fully working examples (objective-c and swift) can be found at: Examples
Migration
Migration guide from versions < 2.x.x
Installation
How to integrate KwizzadSDK Kwizzad supports Swift and ObjectiveC, and provides packages for CocoaPods and Carthage.
Carthage
Carthage is a dependency manager for Cocoa. To install Carthage, please consult the documentation.
To load the Kwizzad SDK over Carthage:
-
Put a
Cartfile
into your project. Contents:github "kwizzad/kwizzad-ios" "master"
You can replace
master
by a specific version number you want to stick to, for example2.0.0
. -
Run
carthage checkout
CocoaPods
CocoaPods is also a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To load the Kwizzad SDK over CocoaPods:
- Integrate KwizzadSDK into your Xcode project using CocoaPods by specifying this in your
Podfile
:source 'https://github.com/CocoaPods/Specs.git' use_frameworks! target '<Your Target Name>' do pod 'KwizzadSDK' # Alternatively, if you want to stick to a specific Kwizzad SDK version: # pod 'KwizzadSDK', '<version number goes here>' end
- Run the following command in your terminal, in the root directory of your project:
$ pod install
Usage:
step 1 : Initializing the SDK
- with swift
KwizzadSDK.setup(apiKey: "YOUR_API_TOKEN_HERE"")```
- with objective-c
[KwizzadSDK setupWithApiKey:@"YOUR_API_TOKEN_HERE"];
step 2 : Assigning Kwizzad Delegate protocol
-
with swift
import KwizzadSDK class ViewController: UIViewController, KwizzadSDKDelegate { override func viewDidLoad() { KwizzadSDK.instance.delegate = self } }
-
with objective-c
@interface ViewController () <KwizzadSDKDelegate> @end @implementation ViewController - (void)viewDidLoad { KwizzadSDK.instance.delegate = self; }
step 3 : Requesting Ad
-
with swift
KwizzadSDK.instance.requestAd(placementId: YOUR_PLACEMENT)
-
with objective-c
[KwizzadSDK.instance requestAdWithPlacementId:YOUR_PLACEMENT onAdAvailable:nil];
step 4 : Implement the delegate functions
Please have a look at the KwizzadExample app project. There are two build schemes, one for Swift, one for objective-c, to implement the delegate functions.
-
with swift
DebugViewController.swift
contains an exemplary integration of an ad placement in a view controller. -
with objective-c
DebugViewController.m
contains an exemplary integration of an ad placement in a view controller.
using the delegate pattern
Mandatory callbacks :
- kwizzadDidRequestAd:placementId
- kwizzadOnAdAvailable:placementId:potentialRewards:adResponse
- kwizzadOnAdReady:placementId
- kwizzadDidShowAd:placementId
- kwizzadGotOpenTransactions:openTransactions
- kwizzadDidDismissAd:placementId
- kwizzadOnNoFill:placementId
Optionals Callbacks :
- kwizzadOnErrorOccured:placementId:reason
- kwizzadWillPresentAd:placementId
- kwizzadOnGoalReached:placementId
- kwizzadCallToActionClicked:placementId
For better targeting, please set your user data :
let userData = kwizzad.userDataModel;
userData.userId = "12345"
userData.gender = Gender.Female
userData.userName = "Francesca Rossi"
userData.facebookUserId = "1234abc"