alexander-albers / tripkit

Swift library for querying data from public transport providers.
MIT License
78 stars 8 forks source link

iOS 16 new lock screen widget #76

Closed alexanderwallau closed 1 year ago

alexanderwallau commented 2 years ago

In the current release the app supports the new lock screen widgets. The problem is with "nearest stop" which requires constant GPS access; the static version where one sets a stop i.e. Berlin Hbf works flawlessly but the "nearest stop" option returns an empty widget (for trubleshooting relevant: still works as a shortcut to the app). Also the colorsheme is broke but that seems like a minor issue.

Testing done so far:

alexanderwallau commented 2 years ago

Update it also doesn’t work in the „normal“ Homescreen, bit there the colours work, so the colouring is just something the locksreen-widget-api sets

alexander-albers commented 1 year ago

Hi Alexander, I am still trying to work out the runtime restrictions of the lock screen widgets. It seems like even a basic network request might already cause the widget to timeout on its first try. So location requests may definitely cause the widget to timeout way more often.

In my testing (pre iOS 16), the nearby location widget did work fairly reliably, so I will have to check whether iOS 16 changed something in this regard. More long term, I want to update the location-based widgets using geofencing or significant location change updates. This, however, isn't trivial as iOS only allows up to 20 locations being monitored at a given time.

Regarding the color scheme, the lock screen widgets only allow the "vibrant" color scheme, which blends into the selected wallpaper. Colors aren't allowed for lock screen widgets. The color scheme setting appears for lock screen widgets nevertheless, because they share the same configuration file with the regular widgets.

I will continue to track this issue on Trello as TripKit is only responsible for communicating with the respective transit providers.