swift3 admob仅在模拟器中工作。不适用于真正的iPhone

时间:2017-10-24 05:44:21

标签: iphone swift3 admob simulator

我尝试将admob放入我的swift3项目中,它在模拟器中运行良好,但全屏副本在真正的iPhone设备中无效。请帮助解决这个问题。

import UIKit
import GoogleMobileAds

class AutoGADViewController: UIViewController, GADInterstitialDelegate {

var fullScreenads : GADInterstitial!

override func viewDidLoad() {
    super.viewDidLoad()

self.fullScreenads = CreatAndLoadInterstitial()

}



func  CreatAndLoadInterstitial() -> GADInterstitial {
    fullScreenads = GADInterstitial(adUnitID: "ca-app-pub-2552245081934602/3265493331")

    guard (fullScreenads) != nil else {
        return fullScreenads
    }

    let request = GADRequest()
    request.testDevices = [kGADSimulatorID]
    fullScreenads.load(request)
    fullScreenads.delegate = self

    return fullScreenads

   }
}

0 个答案:

没有答案
相关问题