我正在iOS SDK上集成SDK HeyZap。HeyZap(SDK 10.2.1)IOS代理函數不叫
我可以獲取()和顯示()一個IncentivizedAd。
但我不能使用回調委託功能。
的三種方式不適合我(工作的通知,對(HZIncentivizedAd.ShowWithOptions),並與HZAdsDelegate完成,HZIncentivizedAdDelegate在我的類中聲明。
class GridLigueController: MyViewController, UITableViewDataSource, HZAdsDelegate, HZIncentivizedAdDelegate {
func didShowAdNotificationHandler() {
print("didShowAdNotificationHandler")
}
// Configure with NSNotification Listener
// function called on viewDidLoad
func configureRewardVideo() {
HZIncentivizedAd.setDelegate(self)
NSNotificationCenter.defaultCenter().addObserver(self, selector:#selector(didShowAdNotificationHandler), name:HZMediationDidShowAdNotification, object:nil)
if adRequestInProgress == false && HZIncentivizedAd.isAvailable() == false {
HZIncentivizedAd.fetch()
adRequestInProgress = true
print("[Debug] - adRequestInProgress...")
} else {
print("[Debug] - Reward video not ready : \(adRequestInProgress)")
}
// Completion on showWithOptions
func completion(success: Bool, error: NSError!) -> Void {
if success {
print("success showing an ad")
} else {
print("error showing an ad; error was %@",error)
}
}
func showAd() {
if HZIncentivizedAd.isAvailable() {
let options = HZShowOptions()
options.viewController = self
options.completion = self.completion
HZIncentivizedAd.showWithOptions(options)
print("[Debug] - HZIncentivizedAd video is ready, should be shown")
} else { // show an alert }
}
// Normal Delegate function
func didReceiveAdWithTag(tag: String!) {
print("didReceiveAdWithTag")
}
func didShowAdWithTag(tag: String!) {
print("didShowAdWithTag")
}
func didFailToCompleteAdWithTag(tag: String!) {
print("didFailToCompleteAdWithTag")
}
func didCompleteAdWithTag(tag: String!) {
print("didCompleteAdWithTag")
}
}
難道我忘了什麼東西來初始化? 我使用的Xcode 7.3.1與雨燕2.3
謝謝你幫我