You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

iPadOS 15点击Rate and Review弹窗Cancel后App冻住问题解决方案求助

可行解决方案

以下方案均仅针对iPadOS 15版本生效,该Bug已在iPadOS 16及后续系统版本被官方修复。

方案1:主动清除残留遮罩层

该问题确为系统评分弹窗关闭后,私有类的遮罩窗口没有被正常释放导致。调用弹窗后延迟1-2秒遍历当前场景的所有窗口,移除异常残留的系统窗口即可解决:

DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
    if #available(iOS 15.0, *), UIDevice.current.userInterfaceIdiom == .pad {
        guard let activeScene = UIApplication.shared.connectedScenes.first(where: { 
            $0.activationState == .foregroundActive 
        }) as? UIWindowScene else { return }
        for window in activeScene.windows {
            let windowClassName = NSStringFromClass(type(of: window))
            // 匹配评分弹窗残留的私有窗口类
            if windowClassName.contains("SKStoreReviewPresentationWindow") || 
               windowClassName.contains("UITextEffectsWindow") {
                window.isHidden = true
                window.removeFromSuperview()
            }
        }
    }
}

方案2:降级使用旧版API

iPadOS 15上SKStoreReviewController.requestReview(in: scene)方法存在兼容问题,针对该系统版本的iPad设备强制调用旧版无参API即可规避:
修改你原有的弹窗代码为:

// 仅非iPad设备、或者iPad系统不是15版本时,才调用新版带scene参数的API
if #available(iOS 14.0, *), UIDevice.current.userInterfaceIdiom != .pad || ProcessInfo().operatingSystemVersion.majorVersion != 15 {
    if let scene = UIApplication.shared.connectedScenes.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene {
        SKStoreReviewController.requestReview(in: scene)
    }
} else {
    SKStoreReviewController.requestReview()
}

方案3:重置响应链

如果不需要清除窗口,也可以直接重置当前App的主窗口响应状态,恢复触摸响应:

DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
    guard let keyWindow = UIApplication.shared.connectedScenes
        .filter({$0.activationState == .foregroundActive})
        .map({$0 as? UIWindowScene})
        .compactMap({$0})
        .first?.windows
        .first(where: \.isKeyWindow) else { return }
    keyWindow.makeKeyAndVisible()
}

内容的提问来源于stack exchange,提问作者Maxvale

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.03 11:39:03