pull app store id from the info.plist #28

Open
wants to merge 3 commits into
from

Conversation

Projects
None yet
4 participants

This change pulls the appstore id from the info.plist, using the key "AppStoreId", rather than requiring a source change to the Appirater.h file. This makes reusing the code much easier.

Very useful addition. Thanks!

Thanks from me as well. Very useful addition. Quick approach.

@@ -339,7 +346,7 @@ + (void)rateApp {
NSLog(@"APPIRATER NOTE: iTunes App Store is not supported on the iOS simulator. Unable to open App Store page.");
#else
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
- NSString *reviewURL = [templateReviewURL stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%d", APPIRATER_APP_ID]];
+ NSString *reviewURL = [templateReviewURL stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%d", [self appStoreAppID]]];
@g-mark

g-mark Apr 2, 2012

Should be:
NSString reviewURL = [templateReviewURL stringByReplacingOccurrencesOfString:@"APP_ID" withString:[self appStoreAppID]];
since [self appStoreAppID] returns an NSString
, and not an int.

@duanefields

duanefields Apr 2, 2012

Then you don't need the string format, the code was written using the constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment