App Store Review Button

有些话、适合烂在心里 提交于 2019-11-30 06:16:17

问题


How can we make the "please leave us a review in the app store" functional PopUp in an iOS app?


回答1:


I personally used this one. I think it works really well. http://arashpayan.com/blog/2009/09/07/presenting-appirater/




回答2:


It's quite easy. Create an action rateGame and change the id 409954448 to your app id.

- (IBAction)rateGame {
    [[UIApplication sharedApplication] 
     openURL:[NSURL URLWithString:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=409954448"]];         
}

This will launch the AppStore app and take the user directly to the page where s/he can rate and review your app. If you want this to happen after, say, 20 times the user loads your app, then you can add an alert in viewDidLoad of your main page:

- (void)viewDidLoad {
    [super viewDidLoad];

    NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
    NSInteger launchCount = [prefs integerForKey:@"launchCount"];
    if (launchCount == 20) {
        launchCount++;
        [prefs setInteger:launchCount forKey:@"launchCount"];
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"LIKE MY APP?" 
                                                        message:@"Please rate it on the App Store!"
                                                       delegate:self 
                                              cancelButtonTitle:@"NO THANKS" 
                                              otherButtonTitles:@"RATE NOW", nil];
        [alert show];
        [alert release];                
    }

}

This assumes you've set up the launchCount in the AppDelegate:

- (BOOL)application:(UIApplication *)application 
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

    NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
    NSInteger launchCount = [prefs integerForKey:@"launchCount"];
    launchCount++;
    [prefs setInteger:launchCount  forKey:@"launchCount"];  

// YOUR CODE HERE

}



回答3:


There is code missing if you want user to review your app after 20 times. The missing part is

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (buttonIndex == 0)
    {
        // user hit dismiss so don't do anything
    }
    else if (buttonIndex == 1) //review the app
    {

        [[UIApplication sharedApplication] 
     openURL:[NSURL URLWithString:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=409954448"]]; 

    }
}



回答4:


Well, here's one.

These are usually done as simple UIAlertViews with three buttons (Review Now, Later, Never) with preferences stored in NSUserDefaults to indicate whether the user has already done so, whether they never wish to be asked again, etc.




回答5:


iRate is also another good library to present "rate this app" dialog boxes.




回答6:


Since iOS 10.3 iOS provides a feature for this.

import StoreKit
SKStoreReviewController.requestReview()

A complete class how to request Appstore Reviews can be found on my GitHubAccount.

Cheers!



来源:https://stackoverflow.com/questions/6237156/app-store-review-button

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