加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

swift – 为什么我的facebook插页式广告不会显示在我的应用中?

发布时间:2020-12-14 05:24:53 所属栏目:百科 来源:网络整理
导读:我在 Swift中,每次我调用它们委托func didFailWithError被调用.我在我的所有应用程序中使用与facebook intertial广告相同的代码,除了我创建的这个新应用程序外,它完美无缺.没有广告弹出,我在控制台中收到一条消息说: DiskCookieStorage changing policy fro
我在 Swift中,每次我调用它们委托func didFailWithError被调用.我在我的所有应用程序中使用与facebook intertial广告相同的代码,除了我创建的这个新应用程序外,它完美无缺.没有广告弹出,我在控制台中收到一条消息说:

DiskCookieStorage changing policy from 2 to 0,cookie file:
file:///private/var/mobile/Containers/Data/Application/4E5FA239-208C-4B08-87C6-E4DB1CC3CC76/Library/Cookies/Cookies.binarycookies

这是我在GameViewController中设置代码的方法:

import UIKit
import SpriteKit

let interstitialFBAD: FBInterstitialAd = FBInterstitialAd(placementID: "2320559454634478_1321860725967683")

class GameViewController: UIViewController,FBInterstitialAdDelegate {

override func viewDidLoad() {
    super.viewDidLoad()

    if let scene = GameScene(fileNamed:"GameScene") {

        loadFBInterstitialAd()

    }
}

//fbAds--------------------------------------------------------------------------------------------------------

func loadFBInterstitialAd() {
    interstitialFBAD.delegate = self
    interstitialFBAD.load()
    print("what")
}


func interstitialAdDidLoad(_ interstitialAd: FBInterstitialAd) {
    interstitialFBAD.show(fromRootViewController: self)
    print("popup")
}

func interstitialAd(_ interstitialAd: FBInterstitialAd,didFailWithError error: Error) {
    print("failed")
}

//fbAds--------------------------------------------------------------------------------------------------------
所以来自

Im in Swift and every-time I call them the delegate func didFailWithError gets called. Im using the same code I use for the facebook intersitial ads in all my apps and it works perfectly except for this new app I created. No ads pop up and I get a message in my console saying:

这似乎是我的第一个解决方案不是答案,但很明显我需要指出它:从Facebook docs开始,似乎有几个步骤来创建一个可以正确使用SDK的应用程序(即在Facebook中创建一个应用程序)并使用适当的Info.plist键等).

如果这不是正在发生的事情,但我认为它不是,那么这可能仍然是由于应用程序没有正确设置但是出于Facebook SDK以外的原因.

如果您没有看到如何在AppDelegate中初始化SDK并且没有确认,那么您尝试显示的广告缺少Info.plist键,很难说这里的问题是什么.你有没有联系Facebook支持?他们肯定也能在这里提供帮助. this page之后的某个地方我相信你可以找到适当的现场支持作为付费广告客户.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读