我正在将SDK HEYZAP集成在iOS应用程序上。
i可以fetch()并显示()诱因。
,但我无法使用回调委托函数。
这三种方式对我不起作用(通知,完成(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与Swift 2.3
感谢您帮助我
heyzap 10.2.1确实有回调问题。我们将其释放后迅速将其从网站上取出,并且将有10.2.2。今天出去替换它。抱歉给您带来不便!
来源:我在heyzap
heyzap向我发送了一条消息,我使用的SDK版本(10.2.1)在回调上遇到了问题。
现在很好。