1

I just updated my Xcode to 11 and tried to run my app on a iOS 13 device. I discovered the View Controllers wasn't being presented in fullscreen, but I was able to fix this problem with this question: Presenting modal in iOS 13 fullscreen

But I also have an issue with Admob interstitial ads not being presented in fullscreen. I will attach a screenshot to demonstrate, and you will see the top isn't located at the top.

This is how I present the interstitial:

if (self.interstitial.isReady) {

    [self.interstitial presentFromRootViewController:self];

}

enter image description here

Peter
  • 1,848
  • 4
  • 26
  • 44
  • Have you manage to find a solution by any chance? – Vadim F. Nov 28 '19 at 08:52
  • @VadimF. Nope, my app is still acting like this, I have tried to update Google Mobile Ads SDK several times, also very recently, but still no luck... – Peter Nov 28 '19 at 11:28

3 Answers3

1

this is a basic helper class for Interstitial Ad and its not dependant on any of my view or modal implementation. It will just present the Ad on rootViewController and its working for me even in Landscape mode also this can be used for SwiftUI. Try this if you haven't.

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!)
        }
    }
}
mohit kejriwal
  • 1,755
  • 1
  • 10
  • 19
0

Change the presentation mode to:

Sorry, I wrote in Swift, although this should be similar in Objective-C.

viewController.modalPresentationStyle = .fullScreen

or

viewController.modalPresentationStyle = .overFullScreen

On iOS 13 I noticed that the default modalPresentationStyle is either .overCurrentContext or .currentContext, which is making a weird animation and minimizes the frame of the presented view controller.

Starsky
  • 1,829
  • 18
  • 25
0

I think there is a simple solution, you need to update Google Mobile Ads SDK (pod update or carthage update). Ads SDK: 7.50.0, official release for iOS 13 support.

Fallstreak
  • 506
  • 7
  • 8