0

recently I've released my new app on Windows Phone Store named "TimeNoti". For most of the users its working great but some of the users are complaining that it crashes on start and all these users are from Europe region like Sweden, Finland and Germany. Is there anything I'm missing? App works great on all phones from other regions but it is unable to start on same phones from Europe region.

I'm attaching a link to my app. Link: http://www.windowsphone.com/s?appid=8e998c15-9813-4411-bd7b-76f397f13fcb

Thanks in advance.

Regard, Richard George

Rich_Ric
  • 101
  • 3
  • 1
    Number formatting maybe, e.g `3.444` will be `3,444` in those countires, Im I totally blind, I cant seem to find the source code link on that website – sa_ddam213 Aug 13 '14 at 03:09
  • 1
    You can also take a look at crash report at your dashboard - there you can export stacktraces - this should give you more information what could have happened. – Romasz Aug 13 '14 at 07:04
  • Can you set your testing device to one of their localization and reproduce to catch the exception? – Chris W. Aug 13 '14 at 16:22
  • Yes I recreated the problem, I switched my phone language to Finnish from English and app is crashing on start. – Rich_Ric Aug 14 '14 at 03:42
  • @ChrisW. Okay, after debugging my app on Release configuration I found - **DateTimeZone CurrentTZ = DateTimeZoneProviders.Tzdb.GetSystemDefault();** is the culprit. It is giving exception on NON English phone language but works fine on English language. Any clues on how I can make it culture invariant? P.S. I'm using NODATIME to convert current phone time to another timezone's current time. – Rich_Ric Aug 14 '14 at 09:53

1 Answers1

0

After finding the main problem, I tried to figure out its substitution.

The problem is with the DateTimeZone CurrentTZ = DateTimeZoneProviders.Tzdb.GetSystemDefault(); giving exception when phone's language is set to non-English language (Finnish in this case). After searching a lot about this I'm unable to find a proper solution, so I created my own solution.

Solution:

Replaced

Instant Current = SystemClock.Instance.Now;
DateTimeZone CurrentTZ = DateTimeZoneProviders.Tzdb.GetSystemDefault();
ZonedDateTime ZDT = Current.InZone(CurrentTZ);     
Result = ZDT.WithZone(TargetDTZ);

With

LocalDateTime Current = LocalDateTime.FromDateTime(DateTime.UtcNow); 
DateTimeZone CurrentTZ = DateTimeZoneProviders.Tzdb["Etc/GMT"];
ZonedDateTime ZDT = Current.InZoneLeniently(CurrentTZ); 
Result = ZDT.WithZone(TargetDTZ); 

I know this is not the cleanest solution of this problem but it works. If anyone here wanna give better solution to my problem then I'm happy to accept it.

Rich_Ric
  • 101
  • 3