我在我的 iOS 应用程序中使用 Google 互动媒体广告。它运行良好,现在我想在我的 tvOS 应用程序中使用它们。当我为 Google 互动媒体广告添加代码时,我遇到了以下问题:
由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[NSConcreteNotification imaMessage]:无法识别的选择器发送到实例 0x7fe4d9e0cb20”
我正在使用此代码播放广告:
- (void)requestAdsPre:(NSString *)url {
self.adPlayerLayer = nil;
//[self.contentPlayer.view removeFromSuperview];
[self setupAdsLoader];
[self setUpAdDisplayContainer];
// Create an ad request with our ad tag, display container, and optional user context.
IMAAdsRequest *request =
[[IMAAdsRequest alloc] initWithAdTagUrl:url
adDisplayContainer:self.adDisplayContainer
userContext:nil];
[self.adsLoader requestAdsWithRequest:request];
}
#pragma mark SDK Setup
- (void)setupAdsLoader {
self.adsLoader = [[IMAAdsLoader alloc] initWithSettings:nil];
self.adsLoader.delegate = self;
}
- (void)setUpAdDisplayContainer {
self.adDisplayContainer =
[[IMAAdDisplayContainer alloc] initWithAdContainer:self.videoView companionSlots:nil];
}
谁能告诉我如何在 tvOS 上使用 Google 互动媒体广告?Google 互动媒体广告适用于 iOS 和 tvOS 应用。