SKStoreProductViewController rate disabled on iOS 7

丶灬走出姿态 提交于 2019-12-22 01:41:13

问题


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



来源:https://stackoverflow.com/questions/19058069/skstoreproductviewcontroller-rate-disabled-on-ios-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!