Incorporating the four new regions in iTunesConnect reports

6 views
Skip to first unread message

António Nunes

unread,
Aug 17, 2011, 4:43:01 AM8/17/11
to myapp...@googlegroups.com
Hi,

I have added the new country codes to my local (and possibly not up-to-date) MyAppSales project. It looks like it is working, but since I haven't sold in all new regions since the recent changes by Apple, I can't check that they definitely all get processed and show up now. (New Zealand and Switzerland show up for me. I haven't sold in Norway and Mexico recently.) If someone has read write access to the myappsales github repo and wants to test and incorporate my changes drop me a note.

Cheers,
António

P.S.
Note that the new regions are defined in a somewhat arbitrary sequence. See below how I defined them, tagging them onto the add of the list. I won't run my changes on my real MyAppSales copy on my iPhone until I know this (or something else) is the definition that goes into the main myappsales github repo.

typedef enum {
ReportRegionUnknown = 0,
ReportRegionUSA = 1,
ReportRegionEurope = 2,
ReportRegionCanada = 3,
ReportRegionAustralia = 4,
ReportRegionUK = 5,
ReportRegionJapan = 6,
ReportRegionRestOfWorld = 7,
ReportRegionMexico = 8,
ReportRegionSwitzerland = 9,
ReportRegionNorway = 10,
ReportRegionNewZealand = 11} ReportRegion;


----------------------------------------------------
It is better to light a candle than to curse the darkness
----------------------------------------------------

Nglayton

unread,
Aug 17, 2011, 3:39:24 PM8/17/11
to MyAppSales
I have also tried this same exact thing, with NO success. It downloads
the report, but does not display it.
It will download New Zealand every time, but it never shows up in the
reports, so I think I am still missing something.

I'm still looking over the code to see what else needs to be changed
or added....??

Oliver, I know your on vacation, so no worries either way, but do you
have any hints to push in the right direction?

-neal


On Aug 17, 1:43 am, António Nunes <antonio.nunes...@googlemail.com>
wrote:

Nglayton

unread,
Aug 17, 2011, 4:17:49 PM8/17/11
to MyAppSales
Okay more info. With the addition below, I now get the downloaded
report file displayed in the reports section....It has the title of
'Invalid Region" but it downloads and displays now.

More to come....as soon as I track it all down.

You need to update the 'ItunesConnectDownloaderOperatons.m' file
with the following updates...


- (ReportRegion)regionFromCode:(NSString *)regionCode
{
ReportRegion region;
if ([regionCode isEqualToString:@"US"]) region = ReportRegionUSA;
else if ([regionCode isEqualToString:@"GB"]) region = ReportRegionUK;
else if ([regionCode isEqualToString:@"JP"]) region =
ReportRegionJapan;
else if ([regionCode isEqualToString:@"AU"]) region =
ReportRegionAustralia;
else if ([regionCode isEqualToString:@"CA"]) region =
ReportRegionCanada;
else if ([regionCode isEqualToString:@"EU"]) region =
ReportRegionEurope;
else if ([regionCode isEqualToString:@"WW"]) region =
ReportRegionRestOfWorld;
--> else if ([regionCode isEqualToString:@"MX"]) region =
ReportRegionMexico;
--> else if ([regionCode isEqualToString:@"CH"]) region =
ReportRegionSwitzerland;
--> else if ([regionCode isEqualToString:@"NO"]) region =
ReportRegionNorway;
--> else if ([regionCode isEqualToString:@"NZ"]) region =
ReportRegionNewZealand;
else region = ReportRegionUnknown;

return region;
}

- (ReportRegion)regionFromString:(NSString *)string
{
if ([string isEqualToString:@"Americas"])
{
return ReportRegionUSA;
}

if ([string isEqualToString:@"Australia"])
{
return ReportRegionAustralia;
}

if ([string isEqualToString:@"Canada"])
{
return ReportRegionCanada;
}

if ([string isEqualToString:@"Euro-Zone"])
{
return ReportRegionEurope;
}

if ([string isEqualToString:@"Japan"])
{
return ReportRegionJapan;
}

if ([string isEqualToString:@"Rest of World"])
{
return ReportRegionRestOfWorld;
}

if ([string isEqualToString:@"United Kingdom"])
{
return ReportRegionUK;
}

--> if ([string isEqualToString:@"Mexico"])
--> {
--> return ReportRegionMexico;
--> }
--> if ([string isEqualToString:@"Norway"])
--> {
--> return ReportRegionNorway;
--> }
--> if ([string isEqualToString:@"New Zealand"])
--> {
--> return ReportRegionNewZealand;
--> }
--> if ([string isEqualToString:@"Switzerland"])
--> {
--> return ReportRegionSwitzerland;
--> }

return ReportRegionUnknown;
}

Nglayton

unread,
Aug 17, 2011, 4:24:59 PM8/17/11
to MyAppSales
I believe that, 'Country v1.m' and 'Report v1.m' will also need
modified in a similar fashion...to get it all working correctly.

Nglayton

unread,
Aug 17, 2011, 5:06:17 PM8/17/11
to MyAppSales
As far as the new regions go,
I think I got it working correctly. It is at least working for me in
the simulator...I will try on actual hardware next, but I don't see
any reason it won't work, the same.

4 classes need to be changed

Country_v1.m
ItunesConnectDownloaderOperations.m
Report_v1.m
ReportTypes.h

I made the changes and created a zip file with just the changed files.

You can download it here: http://www.tlmicro.com/MAS/NewRegionsUpdate.zip

Then cut and paste or drag and drop into the latest version from
github or whatever works best for you.

Let me know if it works for you or not
-neal

PS. this does not fix the issue of no daily downloads for the last
couple of days, it only fixes the new regions.




Reply all
Reply to author
Forward
0 new messages