Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/121.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在iOS 13 Xcode 11中全屏显示间隙广告_Ios_Objective C_Xcode_Admob_Interstitial - Fatal编程技术网

在iOS 13 Xcode 11中全屏显示间隙广告

在iOS 13 Xcode 11中全屏显示间隙广告,ios,objective-c,xcode,admob,interstitial,Ios,Objective C,Xcode,Admob,Interstitial,我刚刚将Xcode更新为11,并尝试在iOS 13设备上运行我的应用程序。我发现视图控制器没有全屏显示,但我可以通过以下问题解决此问题: 但我也有一个问题,Admob的插播广告没有全屏呈现。我会附上一个截图来演示,你会看到顶部不在顶部 这就是我如何呈现填隙的方式: if (self.interstitial.isReady) { [self.interstitial presentFromRootViewController:self]; } 将演示模式更改为: 对不起,我是用Sw

我刚刚将Xcode更新为11,并尝试在iOS 13设备上运行我的应用程序。我发现视图控制器没有全屏显示,但我可以通过以下问题解决此问题:

但我也有一个问题,Admob的插播广告没有全屏呈现。我会附上一个截图来演示,你会看到顶部不在顶部

这就是我如何呈现填隙的方式:

if (self.interstitial.isReady) {

    [self.interstitial presentFromRootViewController:self];

}

将演示模式更改为:

对不起,我是用Swift写的,虽然这在Objective-C中应该是类似的

viewController.modalPresentationStyle = .fullScreen


在iOS 13上,我注意到默认的
modalPresentationStyle
.overCurrentContext
.currentContext
,这会生成一个奇怪的动画,并最小化显示的视图控制器的帧。

将显示模式更改为:

对不起,我是用Swift写的,虽然这在Objective-C中应该是类似的

viewController.modalPresentationStyle = .fullScreen


在iOS 13上,我注意到默认的
modalPresentationStyle
.overCurrentContext
.currentContext
,它制作了一个奇怪的动画并最小化了显示的视图控制器的帧。

我认为有一个简单的解决方案,您需要更新Google Mobile Ads SDK(pod更新或迦太基更新)。
ADSSDK:7.50.0,iOS 13支持的官方版本。

我认为有一个简单的解决方案,你需要更新谷歌移动ADSSDK(pod更新或迦太基更新)。
Ads SDK:7.50.0,iOS 13支持的官方发行版。

这是一个用于插入式广告的基本帮助类,它不依赖于任何“我的视图”或“模式”实现。它只在rootViewController上显示广告,即使在横向模式下也可以为我工作。这也可以用于SwiftUI。如果没有,请尝试

import Foundation
import GoogleMobileAds
import UIKit
    
final class InterstitialAd : NSObject, GADInterstitialDelegate {
    var interstitial: GADInterstitial? = nil
    
    func LoadInterstitial() {
        interstitial = GADInterstitial(adUnitID: Constants.interstitialAdCode)
        let req = GADRequest()
        interstitial!.load(req)
        interstitial!.delegate = self
    }
    
    func showAd() {
        if let ad = self.interstitial, ad.isReady {
           let root = UIApplication.shared.windows.first?.rootViewController
           ad.present(fromRootViewController: root!)
        }
    }
}

这是一个用于插入式广告的基本帮助类,它不依赖于我的任何视图或模式实现。它只会在rootViewController上显示广告,即使在横向模式下也适用于我。这也可用于SwiftUI。如果没有,请尝试此方法

import Foundation
import GoogleMobileAds
import UIKit
    
final class InterstitialAd : NSObject, GADInterstitialDelegate {
    var interstitial: GADInterstitial? = nil
    
    func LoadInterstitial() {
        interstitial = GADInterstitial(adUnitID: Constants.interstitialAdCode)
        let req = GADRequest()
        interstitial!.load(req)
        interstitial!.delegate = self
    }
    
    func showAd() {
        if let ad = self.interstitial, ad.isReady {
           let root = UIApplication.shared.windows.first?.rootViewController
           ad.present(fromRootViewController: root!)
        }
    }
}

但我不是在展示一个视图控制器,只是一个间隙广告。但广告是以某种方式呈现的,对吗?它是一个添加到当前视图的UIView?它是一个视图控制器?但我不是在展示一个视图控制器,只是一个间隙广告。但广告是以某种方式呈现的,对吗?它是一个添加到当前视图的UIView?它是一个视图控制器?你是否有机会找到解决方案?@VadimF.Nope,我的应用程序仍然是这样,我尝试过几次更新Google Mobile Ads SDK,也是最近,但仍然没有运气…你有机会找到解决方案吗?@VadimF.Nope,我的应用程序仍然是这样,我尝试过几次更新Google Mobile Ads SDK时代,也是最近,但仍然没有运气。。。