omz / AppSales-Mobile

App Sales allows iPhone and Mac App Store developers to download and analyze their daily and weekly sales reports from iTunes Connect.
http://omz-software.com
1.89k stars 406 forks source link

Not downloading Daily reports from MacAppStore #279

Open Lymes opened 8 years ago

Lymes commented 8 years ago

ReportDownloadOperation.m, -(void)main

NSData *reportData = [NSURLConnection sendSynchronousRequest:reportDownloadRequest returningResponse:&response error:NULL];
NSString *errorMessage = [[response allHeaderFields] objectForKey:@"Errormsg"];
if ( errorMessage )
{
        NSLog( @"  %@", errorMessage );
}
else if ( reportData )

After 5 November 2015 always prints the following error message:

AppSalesMobile[29627:925630] Daily reports are only available for past 365 days. Please enter a new date.

Before that date the app worked fine. I've checked out the query params

NSString *reportDownloadBodyString = [NSString stringWithFormat:@"USERNAME=%@&PASSWORD=%@&VNDNUMBER=%@&TYPEOFREPORT=%@&DATETYPE=%@&REPORTTYPE=%@&REPORTDATE=%@",
                                                  escapedUsername, escapedPassword, vendorID, @"Sales", dateType, @"Summary", reportDateString]; 

and the params seem to be correct.

ddaddy commented 8 years ago

Reports since 5th November are not available. See iTC reports section for the notice.

Reports for 5th were actually released but then removed. So if you have a 5th report you should delete it until Apple release a corrected one.

Lymes commented 8 years ago

Oh man, thank you. BTW, I've forked your repository, great job!

ddaddy commented 8 years ago

👍🏼 Apple also say reports between 26th Oct - 2nd Nov are also wrong and will eventually be reissued.

Morpheus2002 commented 8 years ago

@ddaddy stupid question: how do I redownload old reports in ITC? I don't see any option for that. Now, that reports between 26th Oct - 2nd Nov are corrected I would like to replace the wrong ones.

ddaddy commented 8 years ago

You just delete the ones you have. Press and hold on a bar to delete.

dave256 commented 8 years ago

I think we'll also need to edit the file: ReportDownloadOperation.m and edit the line: NSInteger maxNumberOfAvailableReports = [dateType isEqualToString:@"Daily"] ? 14 : 13;

You'll want to change the 14 to about 28-30 to make it look for the earlier dates. I haven't done this yet, but plan to try it later today.

ddaddy commented 8 years ago

I'm not sure if that's different in my fork, but mine downloaded them no problem.

dave256 commented 8 years ago

@ddaddy yes, it is set to 30 in your fork. As I suspected, it did not work with 14, but changing it to 30 allowed me to re-download the new reports after deleting them.

Morpheus2002 commented 8 years ago

Thank you guys! It worked for AppSales. But still don't see the option for manual report download in ITC.

ddaddy commented 8 years ago

In iTC it's slightly hidden. Go to the Sales and Trends page, then press at the top left where it says Top Content and you can change it to reports.

Morpheus2002 commented 8 years ago

@ddaddy you are the best! 😊