【发布时间】:2016-05-26 19:01:48
【问题描述】:
我刚刚在我的所有 swift 应用程序中实现了 Chartboost。
我奖励了插页式广告。所以我需要使用 Chartboost 给我的目标 C 函数来设置一个委托。我不知道该怎么做。这就是我通过 Swift 做 Admob 的方式。
NSNotificationCenter.defaultCenter().addObserver(self, selector: "presentInterstitial:", name: "AdMobCall", object: nil)
func presentInterstitial(sender:UIButton!) {
if let isReady = interstitial?.isReady { // _ isReady
interstitial?.presentFromRootViewController(self)
}
}
NSNotificationCenter.defaultCenter().postNotificationName("AdMobCall", object: nil)
但是给我的Objective C Chartboost函数是:
- (void)didCompleteRewardedVideo:(CBLocation)位置 withReward:(int)reward;
而且我不明白如何使用此函数创建与 Admob 相同的委托。这似乎不可能。我让 Chartboost 奖励插页式广告正常工作。但是我无法设置代理来查看他们是否观看了视频。
【问题讨论】:
标签: objective-c swift delegates chartboost