0

New iOS 14 StoreKit deprecate using as SKStoreReviewController.requestReview() Ok I create method to request feedback for iOS 14

func rateApp() {
        var ud = UserDefaults.standard.integer(forKey: "rew")
         NSLog("rew show count is %d", ud)

        if(ud >= 1)
        {
            
                if #available(iOS 14.0, *) {
                    if let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene  {
                    SKStoreReviewController.requestReview(in: scene)
                    NSLog("rateappios14")
                    }
                } else {
                    // Fallback on earlier versions
                    SKStoreReviewController.requestReview()
                    NSLog("rateappotherios")
                }
            
            
        }
        ud = ud + 1
        UserDefaults.standard.setValue(ud, forKey: "rew")
        UserDefaults.standard.synchronize()
    }

I tested it on device deployed from Xcode, and on simulator all is fine. But then I upload to App Store and download it, then review request not working completely. Also not works in TestFlight.

Dmitriy Pushkarev
  • 390
  • 2
  • 5
  • 26
  • How do you know it isn't working? Released code doesn't show the review request every time as it does in debug – Paulw11 Feb 16 '21 at 00:05
  • this method call every app run. I download it from App Store and open close app twice – Dmitriy Pushkarev Feb 16 '21 at 00:23
  • SKStoreReviewController.requestReview(in: scene) is a void method – Dmitriy Pushkarev Feb 16 '21 at 00:44
  • Yes, but just because you request a review, it doesn't mean the alert will be shown [*"this method may or may not present an alert"*](https://developer.apple.com/documentation/storekit/skstorereviewcontroller/2851536-requestreview). The method doesn't provide any feedback as to whether a request was shown. – Paulw11 Feb 16 '21 at 00:47
  • Like Paulw11 said, you won't necessarily see the review request every time. Also, the request can be only made 3 times a year for the same version if I recall correctly. You can take a look at this question to get an idea of how to ask for reviews when some key event happens: https://stackoverflow.com/questions/43177249/skstorereviewcontroller-how-to-use-it-in-a-correct-way/66065365#66065365 – Parth Feb 16 '21 at 06:55
  • I know about request limitation. But, when I upload on appstore, and download on another iPad(never installed on this ipad before), open and close app 2 times I don't see request – Dmitriy Pushkarev Mar 03 '21 at 15:48
  • As per Apple documentation linked previously and mentioned by @Paulw11 "...the actual display of a rating/review request view is governed by App Store policy" – ghr Jun 28 '21 at 03:46

1 Answers1

0
if #available(iOS 14.0, *) {
  if let scene = UIApplication.shared.connectedScenes.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene {
     SKStoreReviewController.requestReview(in: scene) 
   }
      } else {
         SKStoreReviewController.requestReview()
             }
Timchang Wuyep
  • 629
  • 7
  • 10