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

Added more delegate methods And respect setOpenInAppStore value set by user #277

Open
wants to merge 2 commits 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
10 changes: 8 additions & 2 deletions Appirater.m
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,12 @@ - (void)showRatingAlert:(BOOL)displayRateLaterButton {

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
if (NSStringFromClass([SKStoreReviewController class]) != nil) {
if (![Appirater sharedInstance].openInAppStore && NSStringFromClass([SKStoreReviewController class]) != nil) {
#pragma clang diagnostic pop
[Appirater rateApp];
if (delegate && [delegate respondsToSelector:@selector(appiraterDidDisplayStoreKitAlert:)]) {
[delegate appiraterDidDisplayStoreKitAlert:self];
}
} else {
// Otherwise show a custom Alert
NSMutableArray *buttons = [[NSMutableArray alloc] initWithObjects:self.alertRateTitle, nil];
Expand Down Expand Up @@ -326,6 +329,9 @@ - (void)showRatingAlert:(BOOL)displayRateLaterButton {
[alertView show];
#pragma clang diagnostic pop
}
if (delegate && [delegate respondsToSelector:@selector(appiraterDidDisplayAppiraterAlert:)]) {
[delegate appiraterDidDisplayAppiraterAlert:self];
}
}

if (delegate && [delegate respondsToSelector:@selector(appiraterDidDisplayAlert:)]) {
Expand Down Expand Up @@ -675,7 +681,7 @@ + (void)rateApp {
// Use the built SKStoreReviewController if available (available from iOS 10.3 upwards)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
if (NSStringFromClass([SKStoreReviewController class]) != nil) {
if (![Appirater sharedInstance].openInAppStore && NSStringFromClass([SKStoreReviewController class]) != nil) {
[SKStoreReviewController requestReview];
#pragma clang diagnostic pop
return;
Expand Down
2 changes: 2 additions & 0 deletions AppiraterDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
@optional
-(BOOL)appiraterShouldDisplayAlert:(Appirater *)appirater;
-(void)appiraterDidDisplayAlert:(Appirater *)appirater;
-(void)appiraterDidDisplayAppiraterAlert:(Appirater *)appirater;
-(void)appiraterDidDisplayStoreKitAlert:(Appirater *)appirater;
-(void)appiraterDidDeclineToRate:(Appirater *)appirater;
-(void)appiraterDidOptToRate:(Appirater *)appirater;
-(void)appiraterDidOptToRemindLater:(Appirater *)appirater;
Expand Down