SKStoreReviewController how to detect that user has turned off Rate This App (RTA) in settings or 3 times limit has reached?

后端 未结 3 757
迷失自我
迷失自我 2021-02-01 20:19

Starting iOS 10.3, Apple is limiting the review prompt (Rate This App) to 3 times a year and it can be turned off in the user\'s settings.

Q: How do we detect that the 3

3条回答
  •  再見小時候
    2021-02-01 20:48

    I am using this solution in production code - so far no rejections from Apple:

    NSUInteger windowCount = [UIApplication sharedApplication].windows.count;
    // SKStoreReviewController only available for >= 10.3, if needed check for class existence
    [SKStoreReviewController requestReview];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
        BOOL shown = windowCount < [UIApplication sharedApplication].windows.count;
        if (shown) {
            //popup was shown
        }
    };
    

提交回复
热议问题