Guest User

Untitled

a guest
Jun 24th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import backgroundTask from 'react-native-background-task';
  3.  
  4. backgroundTask.define(() => {
  5. console.log('Background Task Activated!');
  6. backgroundTask.finish();
  7. });
  8.  
  9. export default class App extends Component {
  10. componentDidMount() {
  11. backgroundTask.schedule();
  12. backgroundTask.statusAsync().then(status => console.log(status));
  13. // { available: true }
  14. }
  15. render() { return null }
  16. }
Add Comment
Please, Sign In to add comment