So I noticed that Apple changed SKStoreProductViewController, disabling the "Write a Review" button. Is there any workaround or fix for this issue?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
SKStoreProductViewController doesn't support the 'Write a review' option anymore. Why? I really don't know. It did in iOS6.
A work around could be opening the app store with a 'itms-app://'-link.
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {
NSString *appURL = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/%@/app/id%@",
[[NSLocale preferredLanguages] objectAtIndex:0],
@"YOUR_APP_ID"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:appURL]];
} else {
// your current StoreKit code
}
回答2:
Now after iOS 10.3+
The SKStoreReviewController allows users to rate an app directly from within the app through a dialog box. The only downsite is that you can only request StoreKit to display the dialog, but can't be sure if it will.
import StoreKit
func requestToRate() {
SKStoreReviewController.requestReview()
}
https://stackoverflow.com/a/45793805/905517