我正在将SDK HeyZap集成到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")
}
}我忘了初始化什么东西了吗?我在Swift 2.3中使用Xcode 7.3.1
谢谢你帮我
发布于 2016-12-08 18:24:56
Heyzap 10.2.1确实有回调的问题。在它发布后,我们很快就把它从我们的网站上删除了,并且将会有10.2.2。今天出来换掉它。很抱歉给您带来不便!
资料来源:我在海扎普工作。
发布于 2016-12-08 11:48:29
HeyZap向我发送了一条消息,我使用的SDK版本(10.2.1)出现了回调问题。
现在效果很好。
https://stackoverflow.com/questions/41026051
复制相似问题