【问题标题】:Google Adsense Ad not loading in UIWebViewGoogle Adsense 广告未在 UIWebView 中加载
【发布时间】:2018-01-16 09:31:37
【问题描述】:

我的网站上有一个使用 Google Adsense Ads 设置的简单测验页面。

当您在 iOS 设备上的 Safari 中输入 URL 时,广告在桌面和 Safari 中都可以正常工作。

我确实设置了一个带有 UIWebView 的简单 iOS 应用程序,以将测验作为应用程序运行。

UIWebView URL 通过此代码加载:

if let url = URL(string: "http://itrafikk.net/itrafikkads/") {
            webView.loadRequest(URLRequest(url: url))
        }

 func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
    if let url = request.url, navigationType == UIWebViewNavigationType.linkClicked {
        UIApplication.shared.openURL(url)
        return false
    }
    return true
}

本来我以为是NSAppTransportSecurity/NSExceptionDomains的问题

但 Google 为其 Google 广告服务使用 SSL 证书,所以这应该不是问题。

关于可能导致此问题的任何想法?

【问题讨论】:

    标签: ios uiwebview adsense google-advertising-id


    【解决方案1】:

    问题是您不能使用 AdSense 移动应用。 它可以在移动网络浏览器中正常工作,但在移动应用程序中,该添加将被禁用或隐藏。

    在移动应用程序中使用 AdSense 广告也违反了 AdSense 服务条款/政策,因此我建议您不惜一切代价避免这样做。

    https://support.google.com/adsense/answer/3394713?hl=en&ref_topic=1250104#2

    查看第 2 部分:广告实施部分中的最后一个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-05
      • 1970-01-01
      • 2019-04-20
      • 1970-01-01
      • 1970-01-01
      • 2018-06-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多