如何 增加 Facebook 粉丝 iOS 集成 Facebook 广告 Audience Network

🟨🟧🟩🟦vx: 『buyfensi』 , facebook粉丝网提供ins涨cheap粉,ins加粉,ins便宜粉丝,ins粉丝增加,instagram 如何涨cheap粉,ig粉絲的行为规律是什么等? 美国/ig真人follow粉丝关注、点赞、ins按赞、ig买buy粉赞、ig 粉丝赞、ig视频直播浏览等🟨🟧🟩🟦

Instagram 自动赞

图片来源于网络

Audience Network 由于 的原因 国内几乎没什么攻略 ,遇到的坑在此记录一下。

集成文档Audience Network 需要翻

开始集成

·使用 Cocoapod 将以下代码行添加到项目的 Podfile 文件中:pod 'FBAudienceNetwork'

运行 pod install 命令。

可是这 步就出问题了

Instagram 自动赞

我是翻 的网络 也下不了,各种查也没办法。所以改为手动集成Audience Network SDK下载 需要翻

Instagram 自动点赞

里面有SDK 和 Demo

我们把FBAudienceNetwork.framework 拖进工程

·在写代码之前 我们要在Facebook 后台查看一下 所创建广告版位的,这个版位是产品创建了,我们需要的是版位编码,

已我的理解 版位编码 是可以创建多个,不同显示类型的分别创建,比如Banner类型创建一个 ,Native类型创建一个。由于这是产品负责,以后有添加在补充。

instagram 头像 下载


·还有一步 是我们要添加测试账号

如果想要在你的测试机上显示AudienceNetwork. 广告,除了翻 ,并且要添加测试账号 ,还有你的测试机上安装Facebook应用 ,并使用管理员账号 或者 测试账号 登录Facebook ,否则无法请求成功。

If you want to display the audience network. Advertisement on your test machine, in addition to climbing over the wall and adding a test account, you also need to install a Facebook app on your test machine and log in to Facebook with an administrator account or a test account. Otherwise, the request cannot succeed.

instagram人气


总结一下必要的:

翻 的网络

版位编码

添加测试账号或管理员账号

真机上安装Facebook 并使用测试账号或管理员登录

·接下来 就是 代码了 按照demo里写的就可以

因为我是在TableView中展示 所以用的是FBNativeAdsManager

代码如下

instagram人气

- (void)loadNativeAd{

    if (!self.adsManager) {

      // 个参数是刚才申请的版位编码

      //第二个参数 请求广告的个数

        self.adsManager = [[FBNativeAdsManager alloc] initWithPlacementID:@"YOUR_PLACEMENT_ID"

                                                        forNumAdsRequested:5];

        // Set a delegate to get notified when the ads are loaded.

        self.adsManager.delegate = self;

///ConfigurenativeadmanagertowaittocallnativeAdsLoadeduntilalladadadadassetareloadetloadetloadetloadetloadetloadetloadetload。

        self.adsManager.mediaCachePolicy = FBNativeAdsCachePolicyAll;

    }

    [self.adsManager loadAds];

}

#pragma mark FBNativeAdsManagerDelegate implementation

- (void)nativeAdsLoaded{

    NSLog(@"Native ad was loaded, constructing native UI...");

}

- (void)nativeAdsFailedToLoadWithError:(NSError *)error{

    NSLog(@"Native ad failed to load with error: %@", error);

}

#pragma mark FBNativeAdDelegate

- (void)nativeAdDidClick:(FBNativeAd *)nativeAd{

    NSLog(@"Native ad was clicked.");

}

- (void)nativeAdDidFinishHandlingClick:(FBNativeAd *)nativeAd{

    NSLog(@"Native ad did finish click handling.");

}


- (void)nativeAdWillLogImpression:(FBNativeAd *)nativeAd{

    NSLog(@"Native ad impression is being captured.");

}


现在就可以进行调试了,结果我用iOS11的手机一直请求错误,下面是错误提示。

Initial request from a bundle must come from a App Admin, Developer or Tester

百度根本没有,换谷歌 终于在一位日本开发者的博客中找到了解决方案:找一个iOS10手机 在设置页面的Facebook里登录并且安装Facebook应用,重新运行程序,终于看到了请求成功的提示

Native ad was loaded, constructing native UI...

后来我在另一个应用中集成,iOS11 的手机直接就能请求成功。总结一句话:还得看运气

·UI的搭建,按照demo 写就可以

instagram人气

·还有一点 可以分享给大家 ,FBNativeAd 是原生广告的对象,包括了广告的具体参数,如果你是 在列表中展示广告TableView或CollectionView,

使用了 FBNativeAdsManager 请求多个原生广告 如TableView使用了 FBNativeAdTableViewCellProvider

#pragma mark FBNativeAdsManagerDelegate implementation


- (void)nativeAdsLoaded

{

    NSLog(@"Native ad was loaded, constructing native UI...");


[facebook便宜粉丝网] https://www.facebookin.com

    // After the native ads have loaded we create the native ad cell provider and let it take over

    FBNativeAdsManager *manager = self.adsManager;

    self.adsManager.delegate = nil;

    self.adsManager = nil;

///Thenativeadercellprovideroperatesoveraloadedadsmanagerandandandanancreatetablecellswithnative。

//ad,templatesinthemastwellashelpwithemathethatesintesintentdistributionathinatable

    FBNativeAdTableViewCellProvider *cellProvider = [[FBNativeAdTableViewCellProvider alloc] initWithManager:manager forType:FBNativeAdViewTypeGenericHeight300];

    self.cellProvider = cellProvider;

    self.cellProvider.delegate = self;



    [self.tableView reloadData];

}


#pragma mark - UITableViewDataSource


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{

//InthisexampletheadsareevenlydistributedwithinthetableeveryforAdCell-therll//thenlydistrerykr

    NSUInteger count = [self.tableViewContentArray count];

    count = [self.cellProvider adjustCount:count forStride:kRowStrideForAdCell] ?: count;

    return count;

}


-(UITableViewCell*)tableView:(UITableView*)。

{

    // For ad cells just as the ad cell provider, for normal cells do whatever you would do.

    if ([self.cellProvider isAdCellAtIndexPath:indexPath forStride:kRowStrideForAdCell]) {

        return [self.cellProvider tableView:tableView cellForRowAtIndexPath:indexPath];

    } else {

UITableViewCell*cell==[tableViewdequeueReusableCellWithIdentifier:kDefaultCellIdentifierforIndexPath:indexPath]

        // In this example we need to adjust the index back to the domain of the data.

indexPath==[self.cellProvider]adjustNonAdCellIndexPath:indexPathorStride:kRwStrideForAdCell]:indexPath;

        cell.textLabel.text = [self.tableViewContentArray objectAtIndex:indexPath.row];

        return cell;

    }

}


#pragma mark - UITableViewDelegate


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

{

    // The ad cell provider knows the height of ad cells based on its configuration

    if ([self.cellProvider isAdCellAtIndexPath:indexPath forStride:kRowStrideForAdCell]) {

        return [self.cellProvider tableView:tableView heightForRowAtIndexPath:indexPath];

    } else {

        return 80;

    }

}

会发现很卡顿 的方法虽然 都是if 判断,但某些场景下耦合度还是有点高,而且数据结构复杂的页面,经常广告和数据对不上。不想使用这个 列表的方法,可以通过以下方法拿到原生广告FBNativeAd 对象 自行搭建列表

It is too laggy to find that the official method of carton is if judgment, but the coupling degree is somewhat high in some scenes. If you don't want to use this official list method, you can get the native advertisement fbnativeadd object and build your own list through the following methods

#pragma mark FBNativeAdsManagerDelegate implementation

- (void)nativeAdsLoaded

{

    APDLog(@"Native ad was loaded, constructing native UI...");

    

    FBNativeAdsManager *manager = self.adsManager;

    self.adsManager.delegate = nil;

    self.adsManager = nil;

    NSUInteger count =manager.uniqueNativeAdCount;

    NSLog(@"广告个数count :%ld",count);

      while (count) {

            NSLog(@"广告对象NativeAd :%@",manager.nextNativeAd);

        count--;

      }

}

参考链接:

集成文档Audience Network

https://developers.facebook.com/docs/audience-network/

2.一位日本开发者 https://www.cl9.info/entry/2017/08/28/220000

swift https://disp.cc/b/11-aeBf


作者:大苏Andi

链接:https://www.jianshu.com/p/b0a9bac00d10

来源:简书

著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


❤️‍🔥

关于【 SoundCloud推广 】全部服务列表

vx: 『buyfensi』 , facebook粉丝网提供ins涨cheap粉,ins加粉,ins便宜粉丝,ins粉丝增加,instagram 如何涨cheap粉,ig粉絲的行为规律是什么等? 美国/ig真人follow粉丝关注、点赞、ins按赞、ig买buy粉赞、ig 粉丝赞、ig视频直播浏览等❤️‍🔥