JunesiPhone / XenInfo

23 stars 9 forks source link

weather.moonPhase always returns "0" #20

Open Rasputin007 opened 5 years ago

Rasputin007 commented 5 years ago

It is just pass Full Moon (numerical phase 17, 18) however weather.moonPhase always return "0".

JunesiPhone commented 5 years ago

XenInfo is returning what the framework is sending on the current City. Maybe this was depreciated in iOS? I do not see any reference to a moonPhase (example weather.app) except in the headers.

Rasputin007 commented 5 years ago

I got the weather.moonPhase from the xeninfo API website. As I get a value returned I assume it exits in weather.framework otherwise it would be undefined. It still is in the runtime headers, City.h in iOS 12 from what I can see.

JunesiPhone commented 5 years ago

Yes the framework is returning 0. I've looked into it and that's exactly what I found. It may be depreciated as they are not updating that value as it's not used. The same thing happens with chance of rain, it was never returned as undefined either. The temp fix for that was just pull it off the forecast for the current hour.

https://github.com/JunesiPhone/XenInfo/blob/18442debb743d36400efe5efc1ad347bf14ab6ce/Tweak/Weather/XIWeather.m#L230

https://github.com/JunesiPhone/XenInfo/blob/18442debb743d36400efe5efc1ad347bf14ab6ce/Tweak/Weather/XIWeather.m#L206