Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 }
- }
Add Comment
Please, Sign In to add comment