As SKStoreReviewController.requestReview is deprecated in ios14
You can use SKStoreReviewController.requestReview(in: scene) from ios14
Sample code is below
if #available(iOS 14.0, *) {
if let scene = UIApplication.shared.connectedScenes.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene {
SKStoreReviewController.requestReview(in: scene)
}
} else if #available(iOS 10.3, *) {
SKStoreReviewController.requestReview()
}
I made a small wrapper over SKStoreReviewController that saves the headache of supporting different versions of ios. Also it works for macOS.
// Review after 3 launches
AppReview.requestIf(launches: 3)
// Review after 5 days
AppReview.requestIf(days: 5)
// Review after 3 launches and 5 days
AppReview.requestIf(launches: 3, days: 5)