Facebook native Ads are not clickable again in UITableView Cells after scroll

facebook audience network native ads
requesting ads facebook audience network
facebook audience network dev
flutter facebook audience network
facebook audience network forum
facebook audience network tutorial
facebook test ads id
banner ad on facebook

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
//create a new object  of nativead in your class//

var previousNativead : FBNativeAd?

let ad = adsManager.nextNativeAd
self.previousNativead?.unregisterView()
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)
}
previousNativead = ad
ad?.registerView(forInteraction: cell.postView, with: self)
cell.selectionStyle=UITableViewCellSelectionStyle.none

return cell

Facebook native Ads are not clickable again in , Facebook native Ads are not clickable again in UITableView Cells after scroll #68​. Closed. saurabh1939 opened this issue on Jun 8, 2018 · 5 comments when I scroll tableview and come again back to the same cell, now Ads are not clicking  6 Facebook native Ads are not clickable again in UITableView Cells after scroll Jun 9 '18 3 Is it possible to get 21007 status code by verifying receipt in live app? Apr 18 '18

First in your viewDidLoad() check that you add

override func viewDidLoad() {
     super.viewDidLoad()
     adsManager = FBNativeAdsManager(placementID: "YOUR_PLACEMENT_ID_HERE", forNumAdsRequested: "YourNumAds")
     adsManager.delegate = self
     adsManager.loadAds()
}

then to comply with the FBNativeAdsManagerDelegate, you will need to add the following method, nativeAdsLoaded().

    func nativeAdsLoaded() { 
    adsCellProvider = FBNativeAdTableViewCellProvider(manager: adsManager, forType: FBNativeAdViewType.genericHeight300)
    adsCellProvider.delegate = self
    if self.tableview != nil {
         self.tableview.reloadData()
       }
     }

the last thing you should do is to registerView directly to the cell not to postView

ad?.registerView(forInteraction: cell, with: self)

hope that will help you.

Displaying Facebook Ads in Your iOS Apps, Facebook native Ads are not clickable again in UITableView Cells after scroll. I have implemented facebook native Ads in UITableView, for first 1-2 times it  This is most obvious way to optimize UIScrollView (which is a parent of UITableView ), just built by engineers at Apple. For correct use you should have only cell/header/footer classes, initialize their one time, and return to the UITableView reused instances.

I suggest you follow the steps here. He told me about putting a facebook ad between cells.

https://www.appcoda.com/facebook-ads-integration/

It's like you do not make mistakes in the place you turn the idiot.

You should adapt this part in the link to your own.

    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
       if adsCellProvider != nil && adsCellProvider.isAdCellAtIndexPath(indexPath, forStride: UInt(adRowStep)) {
         return adsCellProvider.tableView(tableView, cellForRowAtIndexPath: indexPath)
       }
       else {
         let cell = tableView.dequeueReusableCellWithIdentifier("idCellSample", forIndexPath: indexPath) as! SampleCell
         cell.lblTitle.text = sampleData[indexPath.row - Int(indexPath.row / adRowStep)]
         return cell
       }  }

You should also use this method on screen refreshes and turns.

    func configureAdManagerAndLoadAds() {
      if adsManager == nil {
        adsManager = FBNativeAdsManager(placementID: "PLACEMENT_ID", forNumAdsRequested: 5)
        adsManager.delegate = self
        adsManager.loadAds()
      }}
    override func viewWillAppear(animated: Bool) {
      configureAdManagerAndLoadAds()}

Finally you should check the relevant fields, which may not be compatible with content swift 3.

Audience Network iOS SDK Reference, Not so long time ago I was asked to integrate Facebook ads in a project. pretty fast, and after a few minutes I had my first Facebook ads up and running! Here we'll see how native ads can be integrated into a tableview, but by For that, click to your project name in the Project Navigator, and then scroll  Passing UITable View Scroll Position None results in no scrolling, rather than the minimum scrolling described for that constant. To scroll to the newly selected row with minimum scrolling, select the row using this method with UITable View Scroll Position None, then call scroll To Row At Index Path: at Scroll Position: animated: with UITable View Scroll Position None.

Perfect smooth scrolling in UITableViews, This class contains a mechanism to map indexPaths to native ads in a stable The total count of cells within the table view including both ad and non-ad cells. Troubleshooting Call-To-Action Buttons for Video Ads. If you aren't able to add a call-to-action to a video ad, check your ad for the following: If you didn't choose a call-to-action button when creating your ad, or chose No Button, your ad will appear without a call to action. If your marketing objective is engagement,

Uitableview scroll to top after reload swift, Search bar is woking very well until I add custom tableview cell. Hey im working on at time event page, where my events have to be “display: Facebook native Ads are not clickable again in UITableView Cells after scroll when I scroll tableview and come again back to the same cell, now Ads are not  Changelog and release notes for the Facebook SDK for iOS. For the changelogs for 5.0.0 and later, see facebook/facebook-objc-sdkCHANGELOG.md on GitHub. In-app purchase auto logging is turned on by default. All iOS auto-logged purchases are automatically verified. New in-app purchase auto logging advanced matching for app events uninstall

Uitableview shadow not working, Don't perform data binding at this point, because there's no cell on screen yet. As we know, UITableView is just child of UIScrollView, which enables user to interact with areas whose real size is bigger then visible. For example look at Facebook application which doing exactly this. An iOS Developer on React Native. Create an account or log into Facebook. Connect with friends, family and other people you know. Share photos and videos, send messages and get updates.

Comments
  • Welcome :) Happy to help you
  • I am using custom cell for displaying ads, Your code is for default cell.