Skip to content

Commit

Permalink
Explicite prompt won't be showed, if user has declined to rate the app.
Browse files Browse the repository at this point in the history
  • Loading branch information
amjaliks committed Mar 16, 2013
1 parent b3f15ab commit 881815a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Appirater.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ extern NSString *const kAppiraterReminderRequestDate;

/*
Tells Appirater to show the prompt (a rating alert). The prompt will be showed
if there is connection available and the user hasn't rated current version.
if there is connection available, the user hasn't declined to rate
or hasn't rated current version.
You could call to show the prompt regardless Appirater settings,
e.g., in case of some special event in your app.
Expand Down
5 changes: 5 additions & 0 deletions Appirater.m
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ - (void)incrementSignificantEventAndRate:(BOOL)canPromptForRating {
}
}

- (BOOL)userHasDeclinedToRate {
return [[NSUserDefaults standardUserDefaults] boolForKey:kAppiraterDeclinedToRate];
}

- (BOOL)userHasRatedCurrentVersion {
return [[NSUserDefaults standardUserDefaults] boolForKey:kAppiraterRatedCurrentVersion];
}
Expand Down Expand Up @@ -382,6 +386,7 @@ + (void)userDidSignificantEvent:(BOOL)canPromptForRating {

+ (void)showPrompt {
if ([[Appirater sharedInstance] connectedToNetwork]
&& ![[Appirater sharedInstance] userHasDeclinedToRate]
&& ![[Appirater sharedInstance] userHasRatedCurrentVersion]) {
[[Appirater sharedInstance] showRatingAlert];
}
Expand Down

0 comments on commit 881815a

Please sign in to comment.