Permalink
Browse files

Expose `openURLForRatingApp` to jump the user to the app store to rate

  • Loading branch information...
1 parent f5c39d8 commit 822c5b32893d912a46225dfc6352677ab912e753 @kgn committed Jan 22, 2013
@@ -109,4 +109,9 @@
*/
- (IBAction)showRatingDialog:(id)sender;
#endif
+
+/*!
+ Call if you want to take the user to the app store directly.
+ */
+- (void)openURLForRatingApp;
@end
@@ -49,7 +49,6 @@ - (void)postNotification:(NSString *)name;
- (void)postNotification:(NSString *)name forButton:(int)button;
- (NSString *)appName;
- (NSURL *)URLForRatingApp;
-- (void)openURLForRatingApp;
- (BOOL)requirementsToShowDialogMet;
- (BOOL)shouldShowDialog;
/*! Returns YES if a dialog was shown. */
@@ -304,6 +303,20 @@ - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)
}
}
#endif
+
+- (void)openURLForRatingApp {
+ NSURL *url = [self URLForRatingApp];
+ [self setRatedApp];
+#if TARGET_OS_IPHONE
+ if (![[UIApplication sharedApplication] canOpenURL:url]) {
+ NSLog(@"No application can open the URL: %@", url);
+ }
+ [[UIApplication sharedApplication] openURL:url];
+#elif TARGET_OS_MAC
+ [[NSWorkspace sharedWorkspace] openURL:url];
+#endif
+}
+
@end
@@ -358,20 +371,6 @@ - (NSURL *)URLForRatingApp {
return [NSURL URLWithString:URLString];
}
-- (void)openURLForRatingApp {
- NSURL *url = [self URLForRatingApp];
- [self setRatedApp];
-#if TARGET_OS_IPHONE
- if (![[UIApplication sharedApplication] canOpenURL:url]) {
- NSLog(@"No application can open the URL: %@", url);
- }
- [[UIApplication sharedApplication] openURL:url];
-#elif TARGET_OS_MAC
- [[NSWorkspace sharedWorkspace] openURL:url];
-#endif
-}
-
-
- (BOOL)requirementsToShowDialogMet {
BOOL result = NO;

0 comments on commit 822c5b3

Please sign in to comment.