Skip to content

Commit

Permalink
Merge pull request #108 from amjaliks/features/appstore
Browse files Browse the repository at this point in the history
Added option to force Appirater always to open App Store (instead of SKS...
  • Loading branch information
arashpayan committed Mar 17, 2013
2 parents c8de953 + 8669605 commit b938e6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Appirater.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ extern NSString *const kAppiraterReminderRequestDate;
*/
+ (void)setUsesAnimation:(BOOL)animation;

/*
If set to YES, Appirater will open App Store link (instead of SKStoreProductViewController on iOS 6). Default NO.
*/
+ (void)setOpenInAppStore:(BOOL)openInAppStore;

@end


Expand Down
6 changes: 5 additions & 1 deletion Appirater.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
static BOOL _debug = NO;
static id<AppiraterDelegate> _delegate;
static BOOL _usesAnimation = TRUE;
static BOOL _openInAppStore = NO;
static UIStatusBarStyle _statusBarStyle;
static BOOL _modalOpen = false;

Expand Down Expand Up @@ -105,6 +106,9 @@ + (void)setDelegate:(id<AppiraterDelegate>)delegate{
+ (void)setUsesAnimation:(BOOL)animation {
_usesAnimation = animation;
}
+ (void)setOpenInAppStore:(BOOL)openInAppStore {
_openInAppStore = openInAppStore;
}
+ (void)setStatusBarStyle:(UIStatusBarStyle)style {
_statusBarStyle = style;
}
Expand Down Expand Up @@ -420,7 +424,7 @@ + (void)rateApp {
[userDefaults synchronize];

//Use the in-app StoreKit view if available (iOS 6) and imported. This works in the simulator.
if (NSStringFromClass([SKStoreProductViewController class]) != nil) {
if (!_openInAppStore && NSStringFromClass([SKStoreProductViewController class]) != nil) {

SKStoreProductViewController *storeViewController = [[SKStoreProductViewController alloc] init];
NSNumber *appId = [NSNumber numberWithInteger:_appId.integerValue];
Expand Down

0 comments on commit b938e6e

Please sign in to comment.