简体   繁体   English

插页式广告在iOS13中模态显示时遇到问题

[英]Having problems with an interstitial ad displaying modally in iOS13

Since running the iOS 13 beta I am having issues with my app displaying the interstitial view controller being displayed modally, therefore allowing the user to swipe down to dismiss the ad before the timer counts down. 自从运行iOS 13 beta版以来,我的应用在显示以非正常方式显示插页式视图控制器时遇到了问题,因此允许用户向下滑动以在计时器倒数之前关闭广告。

I understand that modal views are now the default for iOS 13 and I have amended my main view controller to display full screen, however when the ad displays, this is still displayed modally and not full screen. 我了解模态视图现在是iOS 13的默认视图,并且我已经修改了主视图控制器以显示全屏,但是当广告显示时,模态视图仍以模态而非全屏显示。

I have so far tried declaring the view controller, and then requesting it be displayed in full screen, then presenting the ad using the views declaration: 到目前为止,我尝试过声明视图控制器,然后请求将其全屏显示,然后使用视图声明来展示广告:

let vc = UIViewController()
vc.modalPresentationStyle = .fullScreen
interstitial.present(fromRootViewController: vc)

if interstitial.isReady {
   if #available(iOS 13, *) {
       interstitial.present(fromRootViewController: self)
       interstitialDidDismissScreen(interstitial)
   } else {
       interstitial.present(fromRootViewController: self)
       interstitialDidDismissScreen(interstitial)
   }

Expected result is that the view for the interstitial ad is displayed full screen so that a user cannot swipe down to dismiss the view before the time runs out. 预期结果是,插页式广告的视图全屏显示,因此用户无法在时间用完之前向下滑动以关闭该视图。

This works fine in iOS 12. 在iOS 12中可以正常工作。

In case anyone else comes across this post, it was a simple solution in my case. 万一其他人遇到这篇文章,就我而言,这是一个简单的解决方案。

It appears as though Google had updated their framework but I wasn't using the latest version of it. 似乎Google已更新了其框架,但我没有使用它的最新版本。

Therefore a simple 'pod update' in Terminal updated the dependencies which in turn solved the problem. 因此,在终端中进行简单的“ pod更新”即可更新依赖关系,从而解决了问题。

I am using CocoaPods to manage my frameworks, but I'm sure for those who aren't can find the best way to update their own dependencies. 我正在使用CocoaPods来管理我的框架,但是对于那些无法找到更新自己依赖关系的最佳方法的人,我可以肯定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM