Search code examples
iosbackground-processuilocalnotification

Yahoo Weather app doing the undoable - iOS


6 months ago I wanted to wake my app for 30 sec from background (terminated app) to download few lines of XML and parse it, but after trying with background fetch and silent push and reading articles online I came to conclusion that what I'm trying to accomplish is not possible.

Until I found Yahoo Weather app, which allows the user to set the time of day when he/she wants to get notifications about tomorrow's weather; notifications are local, and data is downloaded in background every day. How did Yahoo manage to do that?


Solution

  • After some time I figure it out. The app doesn't use background fetch or silent push either, because they won't run if user terminates the app. App is tracking users location 24h and after location is updated the localnotification will download data and it'll be scheduled.

    Read more: Will iOS wake up the terminated app if it's registered with location for UIBackgroundModes?

    and

    https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html