Ios AdMob Interstitual开始时应用程序崩溃
我最近将我的应用程序上载到App Store,但发现一个错误。我的程序在每次间隙(AdMob)开始时都会崩溃,我不知道为什么。当我从Xcode运行程序时,它从不崩溃Ios AdMob Interstitual开始时应用程序崩溃,ios,swift,admob,app-store,interstitial,Ios,Swift,Admob,App Store,Interstitial,我最近将我的应用程序上载到App Store,但发现一个错误。我的程序在每次间隙(AdMob)开始时都会崩溃,我不知道为什么。当我从Xcode运行程序时,它从不崩溃 import GoogleMobileAds 首先,我当然引进了这个 也把这个加入我的课堂 GADInterstitialDelegate 在viewDidLoad()中,我添加了以下内容: interstitial = GADInterstitial(adUnitID: "AD-UNIT-ID") let re
import GoogleMobileAds
首先,我当然引进了这个
也把这个加入我的课堂
GADInterstitialDelegate
在viewDidLoad()中,我添加了以下内容:
interstitial = GADInterstitial(adUnitID: "AD-UNIT-ID")
let request = GADRequest()
request.testDevices = [ kGADSimulatorID] //Should this be removed now when the app is on App Store?
interstitial.load(request)
interstitial.delegate = self
接下来,我在“保存”按钮中添加了以下代码:
//Advertisement test
if self.interstitial.isReady
{
self.interstitial.present(fromRootViewController: self)
}
else
{
print("Advertisement is not ready!")
self.performSegue(withIdentifier: "History", sender: self)
}
最后,我要说的是:
//Advertisement will dismiss from the screen
func interstitialDidDismissScreen(_ ad: GADInterstitial)
{
self.performSegue(withIdentifier: "History", sender: self)
}
我如何解决这个问题?每次我按下“保存”按钮,屏幕就会变黑,然后砰的一声,崩溃了
所以,当我在Xcode项目中运行它时,它从未崩溃过,但当我在TestFlight和App Store中时,它每次都崩溃