Search code examples
iosobjective-cios7app-storerating

How to add "Rate 5 stars to get coins/reward"?


How do I add a rating alert view inside my app for the user to choose how many stars?

Then I want to give the user some coins/reward if he or she rated with 5 stars.

What I have tried:

SKStoreProductViewController *productViewController = [[SKStoreProductViewController alloc] init];
[productViewController loadProductWithParameters:@{ SKStoreProductParameterITunesItemIdentifier : @364709193 } // which is the iBook app id
                                 completionBlock:^(BOOL result, NSError *error) {
                                     // giving me an error:
                                     // Error Domain=SKErrorDomain Code=5 "Cannot connect to iTunes Store" UserInfo=0xa71cd90 {NSLocalizedDescription=Cannot connect to iTunes Store}
                                 }];
productViewController.delegate = self;
[self presentViewController:productViewController animated:YES completion:nil];

But it only shows a blank screen with a cancel button. Also giving me the error:

Error Domain=SKErrorDomain Code=5 "Cannot connect to iTunes Store" UserInfo=0xa71cd90 {NSLocalizedDescription=Cannot connect to iTunes Store}

EDIT:

What I wanted was something like this: enter image description here


Solution

  • According to Apple, it is forbidden to ask user to rate the app with 5 stars. You could be rejected for doing so even after being approved.

    However, You can ask the user to rate the app if he likes it. This is kind of the same thing but it's fine by Apple.

    Next thing you have to know is that you cannot know if the user have rated the app and how many stars he gave it. What you could do is assume he has rated the app with good one and give him something in return (actually just for clicking the "Rate" button inside your app) because he pushed the "Rate" button only if he likes it. Another recommendation is to do that after the user have spent some time in the app (for example played more than 5 games in a row).