GithubHelp home page GithubHelp logo

sample-background-refresh's Introduction

sample-background-refresh

Sample iOS 9.3 app demonstrating background app refresh along with background URL sessions and background tasks.

This sample app is meant to demonstrate using background app refresh in combination with background tasks and background url sessions. It also provides the option of using a default url session instead of a background url session to point out the differences.

The app should be run directly on a device (not in the simulator as it may produce unexpected results) and directly launches into a background app refresh not a foreground app launch.

The key workflow here is:

  • Background App Refresh calls through to application(_:performFetchWithCompletionHandler:) in the AppDelegate
  • This kicks off a background task, and then begins the download of a single feed
  • Upon completing download the single feed a subsequent 20 additional feeds are queued. This mimics a scenario in which a single feed is downloaded to instruct the app what needs to be updated which then prompts many other feed downloads.
  • Upon completing all 20 additional feeds everything completes. In a background app refresh scenario because the background task gets an expiration call back, the completion gets run before all 20 have completed resulting in the remaining feeds being downloaded on a background url session. If the app is relaunched after some time the call backs for the remaining feeds will be called.

Question? Comments? Concerns?

contact iYrke [email protected]

sample-background-refresh's People

Contributors

yorkepb avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.