gpt4 book ai didi

ios - HeyZap (SDK 10.2.1) 未调用 IOS 委托(delegate)函数

转载 作者:行者123 更新时间:2023-11-28 16:01:19 26 4
gpt4 key购买 nike

我正在将 SDK HeyZap 集成到 iOS 应用程序中。

我可以 fetch() 和 show() 一个激励广告。

但是我不能使用回调委托(delegate)函数。

这三种方式对我不起作用(通知、在 (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 确实存在回调问题。我们在发布后 swift 将其从网站上撤下,并将发布 10.2.2。今天出来更换它。抱歉给您带来不便!

来源:我在 Heyzap 工作

关于ios - HeyZap (SDK 10.2.1) 未调用 IOS 委托(delegate)函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41026051/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com