As per Apple's documentation this API has no effect in testflight
and you should never link this API to any user action
because Apple reserves the right to show or not the prompt even when you call this API, also the prompt will only be displayed to a user a maximum of three times
within a 365-day period
Note
When you call this method while your app is in development mode, a
rating and review request view is always displayed so you can test the
user interface and experience. However, this method has no effect when
you call it in an app that you distribute using TestFlight.
If you need to call manually on any user action please use the code below:
@IBAction func requestReviewManually() {
// Note: Replace the XXXXXXXXXX below with the App Store ID for your app
// You can find the App Store ID in your app's product URL
guard let writeReviewURL = URL(string: "https://apps.apple.com/app/idXXXXXXXXXX?action=write-review")
else { fatalError("Expected a valid URL") }
UIApplication.shared.open(writeReviewURL, options: [:], completionHandler: nil)
}
Please find more details about the API here:
https://developer.apple.com/documentation/storekit/skstorereviewcontroller/3566727-requestreview
and also the best practice for using it here:
https://developer.apple.com/documentation/storekit/requesting_app_store_reviews