Permalink
Browse files

Fixed auto-filling of vendor ID (+ better error message if it fails)

  • Loading branch information...
1 parent 11cc282 commit 4cc218abc2152d008bc35233fd56e960f1a991d8 Ole Zorn committed Jun 21, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 Classes/AccountsViewController+VendorID.m
View
5 Classes/AccountsViewController+VendorID.m
@@ -99,8 +99,7 @@ - (void)findVendorIDsWithLogin:(NSDictionary *)loginInfo
[self dataFromSynchronousPostRequestWithURL:[NSURL URLWithString:@"https://reportingitc.apple.com/vendor_default.faces"] bodyDictionary:reportPostData response:NULL];
NSString *salesPage = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"https://reportingitc.apple.com/sales.faces"] usedEncoding:NULL error:NULL];
-
- NSString *defaultVendorID = [salesPage stringByMatching:@">.*?\\s(8[0-9]{7})" capture:1];
+ NSString *defaultVendorID = [salesPage stringByMatching:@">.*?\\s?(8[0-9]{7})" capture:1];
if (!defaultVendorID) {
[self performSelectorOnMainThread:@selector(failedToLoadVendorIDs) withObject:nil waitUntilDone:YES];
} else {
@@ -127,7 +126,7 @@ - (void)finishedLoadingVendorID:(NSString *)vendorID
- (void)failedToLoadVendorIDs
{
- [[[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"The vendor ID could not be filled automatically. Please check your username and password or enter your vendor ID manually.", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil] autorelease] show];
+ [[[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"The vendor ID could not be filled automatically. Please check your username and password or enter your vendor ID manually. You'll find it at the top of the Sales and Trends module on itunesconnect.apple.com.", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil] autorelease] show];
}
- (NSString *)stringFromSynchronousPostRequestWithURL:(NSURL *)URL bodyDictionary:(NSDictionary *)bodyDictionary

0 comments on commit 4cc218a

Please sign in to comment.