Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid showing the user multiple rating alerts #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions Appirater.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,9 @@ extern NSString *const kAppiraterReminderRequestDate;
*/
#define APPIRATER_RATE_LATER NSLocalizedStringFromTable(@"Remind me later", @"AppiraterLocalizable", nil)

@interface Appirater : NSObject <UIAlertViewDelegate, SKStoreProductViewControllerDelegate> {
@interface Appirater : NSObject <UIAlertViewDelegate, SKStoreProductViewControllerDelegate>

UIAlertView *ratingAlert;
}

@property(nonatomic, strong) UIAlertView *ratingAlert;
@property(nonatomic, weak) UIAlertView *ratingAlert;
#if __has_feature(objc_arc_weak)
@property(nonatomic, weak) NSObject <AppiraterDelegate> *delegate;
#else
Expand Down
5 changes: 2 additions & 3 deletions Appirater.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ - (void)incrementUseCount;
- (void)hideRatingAlert;
@end

@implementation Appirater

@synthesize ratingAlert;
@implementation Appirater

+ (void) setAppId:(NSString *)appId {
_appId = appId;
Expand Down Expand Up @@ -164,6 +162,7 @@ + (Appirater*)sharedInstance {
}

- (void)showRatingAlert {
if (self.ratingAlert) return; // We never want to show multiple alerts to the user
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:APPIRATER_MESSAGE_TITLE
message:APPIRATER_MESSAGE
delegate:self
Expand Down