Permalink
Browse files

Added option to force Appirater always to open App Store (instead of …

…SKStoreProductViewController in iOS 6)

Sometime you don't want use SKStoreProductViewController, e.g., due autorotation issues.
  • Loading branch information...
1 parent c8de953 commit 8669605308095d55db1e05e3feccb57e214d0116 @amjaliks amjaliks committed Mar 16, 2013
Showing with 10 additions and 1 deletion.
  1. +5 −0 Appirater.h
  2. +5 −1 Appirater.m
View
@@ -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
View
@@ -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;
@@ -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;
}
@@ -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];

0 comments on commit 8669605

Please sign in to comment.