Migration guide from versions < 2.x.x
How to integrate KwizzadSDK Kwizzad supports Swift and ObjectiveC, and provides packages for CocoaPods and 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 example 2.0.0
.
Run carthage checkout
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:
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
$ pod install
KwizzadSDK.setup(apiKey: "YOUR_API_TOKEN_HERE"")```
[KwizzadSDK setupWithApiKey:@"YOUR_API_TOKEN_HERE"];
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;
}
with swift
KwizzadSDK.instance.requestAd(placementId: YOUR_PLACEMENT)
with objective-c
[KwizzadSDK.instance requestAdWithPlacementId:YOUR_PLACEMENT onAdAvailable:nil];
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"
link |
Stars: 1 |
Last commit: 4 years ago |
[FIXED] crash happened sometimes when close dialog is shown
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics