Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aparajita
Forked from patrikengborg/AppDelegate.js
Created September 12, 2019 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aparajita/0bcf6e74ad0883474219eda37bd1f8ab to your computer and use it in GitHub Desktop.
Save aparajita/0bcf6e74ad0883474219eda37bd1f8ab to your computer and use it in GitHub Desktop.
export default class AppDelegate extends UIResponder { // eslint-disable-line
applicationPerformFetchWithCompletionHandler(application, completionHandler) {
console.log('App is running in background')
// Check for new data
const newData = true
// If new data exists, initiate a local notification
if (newData) {
// Let the OS know that there were new data and complete the task
completionHandler(true)
} else {
// Otherwise, let the OS know there is no new data and complete the task
completionHandler(false)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment