App Store评论按钮

Pet*_*r V 12 iphone app-store ios

我们如何在iOS应用程序中制作" 请在应用商店中留下评论 "功能性PopUp?

Pen*_*One 38

这很容易.创建操作rateGame并将ID更改409954448为您的应用ID.

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

这将启动AppStore应用程序并将用户直接带到他/她可以评级和审核您的应用程序的页面.如果您希望在用户加载应用程序20次之后发生这种情况,那么您可以在viewDidLoad主页面中添加警报:

- (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];                
    }

}
Run Code Online (Sandbox Code Playgroud)

假设您已在AppDelegate中设置launchCount:

- (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

}
Run Code Online (Sandbox Code Playgroud)


BDG*_*pps 7

我亲自使用过这个.我认为它的效果非常好.http://arashpayan.com/blog/2009/09/07/presenting-appirater/