iOS上的WKWebView中可以使用AdMob广告吗?

输出显示:致命错误:在解包可选值时线程意外发现为零线程1:EXC_BAD_INSTRUCTION(code = EXC_I386_INVOP,subcode = 0x0)

谢谢!

@IBOutlet弱无线JCBannerView:GADBannerView! var JCwebView:WKWebView! 重写func loadView(){让webConfiguration = WKWebViewConfiguration()JCwebView = WKWebView(frame:.zero,配置:webConfiguration)JCwebView.uiDelegate = self view = JCwebView}

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
    print("Google Mobile Ads SDK version: (GADRequest.sdkVersion())")
    JCBannerView.adUnitID = "ca-app-pub-5648681agsga2/9390sgdsgasd596"
    JCBannerView.rootViewController = self
    JCBannerView.load(GADRequest())

    let myURL = URL(string: "https://google.com")
    let myRequest = URLRequest(url: myURL!)
    JCwebView.load(myRequest)
}
链接地址: http://www.djcxy.com/p/87749.html

上一篇: Is it possible to use AdMob ads in WKWebView on iOS?

下一篇: What does "fatal error: unexpectedly found nil while unwrapping an Optional value" mean?