我尝试将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
}
}