Closed saurabh1939 closed 6 years ago
Hi @saurabh1939, I feel the issue you have here is about reusable cell. Would you be able to provide us a sample code which could reproduce the issue. Thanks.
i followed mentioned tutorial link : https://friendlyublog.com/implementing-native-facebook-ads-for-ios-apps-9dc4174ae1a3
If you are interested in how to use FBNativeAdsManager, you might want to check out our AdUnitsSample. You can get the sample app with from our SDK download link, https://developers.facebook.com/docs/audience-network/download#ios. It should have the most updated implementation.
Above sample is in Objective C, Can i get it in Swift ?
Unfortunately, we only have sample in ObjC. If you look at TableViewController, it is not so hard to do it in Swift.
I have implemented facebook native Ads in UITableView, for first 1-2 times it clickable but when I scroll tableview and come again back to the same cell, now Ads are not clicking, I am using swift 3.2 Below is the cell implementation.
let ad = adsManager.nextNativeAd let cell = self.tableHome.dequeueReusableCell(withIdentifier: "HomeAdsTableViewCell", for: indexPath) as! HomeAdsTableViewCell cell.message.text = ad?.body cell.title.text = ad?.title cell.callToActionButton.setTitle(ad?.callToAction, for: .normal)
if let pic = ad?.coverImage { cell.postImage.setImageWithIndicator(imageUrl:pic.url.absoluteString) }
ad?.registerView(forInteraction: cell.postView, with: self) cell.selectionStyle=UITableViewCellSelectionStyle.none
return cell