遇到了与此处描述的相同的问题:链接到我发现的问题
我同时使用
func presentInterstitialAd(fromRootViewController viewController: UIViewController)
和func presentRewardedAd(fromRootViewController viewController: UIViewController)
。
理想情况下,这应该适用于奖励广告和插页式广告:
// MARK: - GADFullScreenContentDelegate Methods
public func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error)
{
print("Ad did fail to present full screen content with error: \(error.localizedDescription)")
}
public func adWillPresentFullScreenContent(_ ad: GADFullScreenPresentingAd)
{
print("Ad will present full screen content.")
}
public func adDidDismissFullScreenContent(_ ad: GADFullScreenPresentingAd)
{
print("Ad did dismiss full screen content.")
}
我注意到,在呈现rewardedAd后,
adDidDismissFullScreenContent
不会被触发。
解决方法我用它来使用
override func viewWillDisappear(_ animated: Bool)
(在广告展示前触发),override func viewWillAppear(_ animated: Bool)
在添加关闭后触发。