I found the article below which seems to be what one should use to request a review of one's app:
https://developer.apple.com/documentation/storekit/requesting_app_store_reviews
I implemented what's there, and it seems to work fine. However, I do get a warning in Xcode on the "await requestReview()" line:
@Environment(\.requestReview) private var requestReview
/// Presents the rating and review request view after a two-second delay.
private func presentReview() {
Task {
// Delay for two seconds to avoid interrupting the person using the app.
try await Task.sleep(for: .seconds(2))
await requestReview() // Warning here...
}
}
The warning is:
No async operations occur within the await expression
I understand it's technically because it's saying the requestReview() call isn't async, but this is apple code, so not sure if maybe there's a newer way to do this or what.
Note that I had to set the min version of the app to ios 16, it wouldn't work with 15 or older.
The
requestReviewin this demo code is async (or rather: it runs in@MainActorisolated context, henceawait:The one you are probably getting a warning about is
requestReview, which is deprecated.I'm not sure why your Xcode is getting confused. I tried with Xcode 15.2, and cannot reproduce this issue.