Last active
June 24, 2018 14:10
-
-
Save elongl/2371ffbf9d234781a0941cd2745105ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import backgroundTask from 'react-native-background-task'; | |
backgroundTask.define(() => { | |
console.log('Background Task Activated!'); | |
backgroundTask.finish(); | |
}); | |
export default class App extends Component { | |
componentDidMount() { | |
backgroundTask.schedule(); | |
backgroundTask.statusAsync().then(status => console.log(status)); | |
// { available: true } | |
} | |
render() { return null } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment