gpt4 book ai didi

objective-c - Admob 关闭按钮位于 iPhone 12 安全区域的上方

转载 作者:行者123 更新时间:2023-12-04 15:13:04 24 4
gpt4 key购买 nike

使用 Google-Mobile-Ads-SDK 7.68,用户无法关闭 GADInterstitial,关闭按钮位于安全区域上方(此处不允许用户交互):
enter image description here
至少在 iPhone 12 pro 和 iPhone 12 pro max 上会发生这种情况。
我试过的:

GADInterstitial *interstitial = [[GADInterstitial alloc] initWithAdUnitID:@"xxx"];
GADRequest *request = [GADRequest request];
[interstitial loadRequest:request];

最佳答案

隐藏状态栏让用户点击关闭按钮。丑陋的弃用方法,但它现在有效。

/// Tells the delegate that an interstitial will be presented.
- (void)interstitialWillPresentScreen:(GADInterstitial *)ad {
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}

/// Tells the delegate an ad request failed.
- (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADRequestError *)error {
[[UIApplication sharedApplication] setStatusBarHidden:NO];
}

/// Tells the delegate the interstitial is to be animated off the screen.
- (void)interstitialWillDismissScreen:(GADInterstitial *)ad {
[[UIApplication sharedApplication] setStatusBarHidden:NO];
}

/// Tells the delegate that a user click will open another app
/// (such as the App Store), backgrounding the current app.
- (void)interstitialWillLeaveApplication:(GADInterstitial *)ad {
[[UIApplication sharedApplication] setStatusBarHidden:NO];
}
enter image description here

关于objective-c - Admob 关闭按钮位于 iPhone 12 安全区域的上方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64862272/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com