4

How would app users with iOS version lower than iOS 11 be able to rate an app?

Do I have to write conditional code something like this

if (iOS11) {
    [SKStoreReviewController requestReview];
} else {
    //show custom review prompt and redirect to app store
}

Will Apple allow this or reject the app? If Apple won't allow this then what should be done for other users? Thanks in advance.

nathan
  • 9,329
  • 4
  • 37
  • 51
Dan
  • 53
  • 3
  • Possible duplicate of [Check OS version in Swift?](https://stackoverflow.com/questions/24503001/check-os-version-in-swift) – JustinM Sep 06 '17 at 14:39
  • checking os version is expected if you support below I think 10.2 and below for thats controller (so check for at least 10.3 and above) - adding this wont get you rejected, not adding the check would let your app crash and then it would be rejected. – solenoid Sep 06 '17 at 14:50
  • @JustinM The code posted by Dan is ObjectiveC. – nathan Sep 06 '17 at 15:10
  • See https://stackoverflow.com/questions/3339722/how-to-check-ios-version/3339787#3339787. You need to check for iOS 10.3 instead of iOS 11 since SKStoreReviewController was introduced in that version. – nathan Sep 06 '17 at 15:11
  • @JustinM thanks for the answer, but I am not worried of version checking but wants to know if it would be allowed by apple to redirect old version users to app store for accepting ratings? – Dan Sep 06 '17 at 15:22
  • @nathan Xcode 9 brings that functionality to objective-c. Being that Dan is using ios 11, I assume that is the case. Although the syntax is slightly different. – JustinM Sep 06 '17 at 15:27
  • 1
    Yeah, my point was about the different syntax in ObjC: `if (@available(iOS 10.3, *)) {}` instead of Swift's `if #available(iOS 10.3, *) {}` – nathan Sep 06 '17 at 15:30
  • @Dan I assume the requirement only applies to users who have updated to the necessary version, but you never really know with Apple. – JustinM Sep 06 '17 at 15:34

1 Answers1

0

Working and Tested Solution

if (NSClassFromString(@"SKStoreReviewController")) {

            [SKStoreReviewController requestReview];
        }
        else{
             //redirect user to AppStore
        }
Dan
  • 53
  • 3