Я пытался внедрить промежуточную рекламу в свое приложение.но я просто получаю ошибки в моей консоли.что я делаю не так?
Вот моя консоль:
2019-04-09 18:23:41.943930+0300 Sozo[5332:159395] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/jonwilson/Library/Developer/CoreSimulator/Devices/75A98A4F-6B72-431C-985C-40DA88E34B57/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2019-04-09 18:23:41.944524+0300 Sozo[5332:159395] [MC] Reading from private effective user settings.
2019-04-09 18:23:41.960135+0300 Sozo[5332:159395] <Google> To get test ads on this device, set: request.testDevices = @[ kGADSimulatorID ];
2019-04-09 18:23:43.524904+0300 Sozo[5332:159622] ATS failed system trust
2019-04-09 18:23:43.524998+0300 Sozo[5332:159622] System Trust failed for [1:0x600002d9db00]
2019-04-09 18:23:43.525164+0300 Sozo[5332:159622] TIC SSL Trust Error [1:0x600002d9db00]: 3:0
2019-04-09 18:23:43.529783+0300 Sozo[5332:159622] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
2019-04-09 18:23:43.529941+0300 Sozo[5332:159622] Task <C47E5A3E-E77D-4D02-9AF5-A3018228B91D>.<0> HTTP load failed (error code: -1200 [3:-9802])
2019-04-09 18:23:43.530314+0300 Sozo[5332:159591] NSURLConnection finished with error - code -1200
Я пробовал смотреть различные видео на YouTube, но, похоже, моя проблема не подходит.
var interstitial: GADInterstitial!
@IBOutlet weak var startButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
//ad ID
interstitial = GADInterstitial(adUnitID: "ca-app-pub-3940256099942544/4411468910")
//request ad
let request = GADRequest()
interstitial.load(request)
interstitial = createAndLoadInterstitial()
interstitial.delegate = self
@IBAction func startButtonAd(_ sender: Any) {
if interstitial.isReady {
interstitial.present(fromRootViewController: self)
}
}
func createAndLoadInterstitial() -> GADInterstitial {
let interstitial = GADInterstitial(adUnitID: "ca-app-pub-3940256099942544/4411468910")
interstitial.delegate = self
interstitial.load(GADRequest())
return interstitial
}
func interstitialDidDismissScreen(_ ad: GADInterstitial) {
interstitial = createAndLoadInterstitial()
}