I’m kinda new on programming UIAlertView’s. What i had in mind was to do a Popup that shows on launch of the application with two more buttons besides the default dismiss button.
One of the buttons would be a link to the appstore and the other would be to dismiss that popup forever.
I’ve already done everything besides the last button.
Any help?
Thank You!
- (void)viewDidLoad {
alert = [[UIAlertView alloc] initWithTitle:@"Rate!" message:@"Your rate is much apreciated" delegate:self cancelButtonTitle:@"Not Now" otherButtonTitles:@"Okay! ", @"No, Thanks!", nil ];
[alert show];
[alert release];
}
-(void)alertView:(UIAlertView *) alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 0) {
}
if (buttonIndex == 1) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.apple.com/pt/app/designertools/id444778173?mt=8#" ]];
}
}
You seem to be doing an alert to rate your app in the app store, instead of answering your direct (technical) question, I’ll try to solve the larger issue. You should consider an existing Open Source solution to handle prompting users for reviews, you can control features like how many launches/days later to prompt them.
I can recommend Appirater by Arash Pyan. What it does is handle the rating portion of the app automatically. It take users right into your App’s review page and its very customizable. The best solution for a new developer! It’s available on GitHub.
iRate by demosthenese is a similar solution but is cleaner and supports fast app switching.
Use these “off the shelf” solutions instead! It should work out better rather than handle it yourself! They include documentation and samples on how to customize the features.
As an aside, I think Apple doesn’t recommend using AlertViews for getting users to rate applications. Use the tools mentioned responsibly. Don’t prompt users too quickly, and make sure that you include a dismiss forever button!
If you’re here for a technical solution to the issue (ie on Prompt on launch with a dismiss forever button), here’s an overview of what you should do: