Facebook原生广告无法点击,无反应
Posted
技术标签:
【中文标题】Facebook原生广告无法点击,无反应【英文标题】:Facebook native ad can't click,no reaction 【发布时间】:2015-02-28 02:09:02 【问题描述】:我在ios app中添加了facebook原生广告,广告展示,但是点击广告时没有反应,没有详细弹出广告内容,是什么问题?
FBNativeAd *nativeAd = [[FBNativeAd alloc] initWithPlacementID:fanID];
nativeAd.delegate = self;
[nativeAd loadAd];
- (void)nativeAdDidLoad:(FBNativeAd *)nativeAd
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^
NSData *iconImageData = [NSData dataWithContentsOfURL:nativeAd.icon.url];
NSData *coverImageData = [NSData dataWithContentsOfURL:nativeAd.coverImage.url];
dispatch_async(dispatch_get_main_queue(), ^
int adViewCount = (int32_t)[_nativeAdViewArr count];
[self genAdScrollView];
PCNativeAdView *adView = [PCNativeAdView initWithNib];
CGRect rect = adView.frame;
rect.origin.x = (rect.size.width + 10)*adViewCount;
adView.frame = rect;
[_adScrollView addSubview:adView];
[_nativeAdViewArr addObject:adView];
[_adScrollView setContentSize:CGSizeMake((rect.size.width + 10)*(adViewCount + 1), 189)];
adView.adIconImageView.image = [UIImage imageWithData:iconImageData];
adView.adCoverImageView.image = [UIImage imageWithData:coverImageData];
adView.adTitleLabel.text = nativeAd.title;
adView.adBodyLabel.text = nativeAd.body;
adView.adSocialContextLabel.text = nativeAd.socialContext;
NSLog(@"Register UIView for impression and click...");
[nativeAd registerViewForInteraction:adView
withViewController:self];
if ([_nativeAdViewArr count] == 3)
[self reloadSubViewRect:-1];
);
);
需要保留 FBNativeAd 实例,我用一个 NSMutableArray 保存
【问题讨论】:
【参考方案1】:需要保留FBNativeAd实例,我用一个NSMutableArray保存了该实例。
【讨论】:
以上是关于Facebook原生广告无法点击,无反应的主要内容,如果未能解决你的问题,请参考以下文章
Recyclerview - Facebook 原生广告 - 不可点击
如何在 android 中获取 facebook NativeAdsManager 广告点击监听器