title: expo-background-fetch not working after reboot on newer versions of Android
body: <p>I'm having a few issues with the background fetch library. Everything works well when I tested it in Android 6, the task was running while the app was in the background, when it was terminated and when the phone rebooted, as it should. But then when I tried it on Android 10 it worked while being in the background and after being terminated but after rebooting the phone i get nothing.</p>
  <p>Maybe there is some additional step that i have to do to set up the background fetch properly on newer versions of Android.</p>
  <h3>Environment</h3>
  <p>I did a expo eject, expo diagnostics returns the following:</p>
  <pre><code>Expo CLI 3.22.0 environment info:
      System:
        OS: Windows 10 10.0.19041
      Binaries:
        Node: 14.5.0 - C:\Program Files\nodejs\node.EXE
        Yarn: 1.22.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
        npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
      IDEs:
        Android Studio: Version  3.6.0.0 AI-192.7142.36.36.6392135
      npmPackages:
        expo: ~38.0.1 =&gt; 38.0.8
        react: ~16.11.0 =&gt; 16.11.0
        react-dom: ~16.11.0 =&gt; 16.11.0
        react-native: ~0.62.2 =&gt; 0.62.2
        react-native-web: ~0.11.7 =&gt; 0.11.7
  </code></pre>
  <h3>Reproducible Demo</h3>
  <p>App.js</p>
  <pre class="lang-js prettyprint-override"><code>import { StatusBar } from 'expo-status-bar';
  import React from 'react';
  import { StyleSheet, Text, View, Button } from 'react-native';
  import PushNotificaiton from &quot;react-native-push-notification&quot;
  import * as BackgroundFetch from 'expo-background-fetch'
  import * as TaskManager from 'expo-task-manager'
  
  const TASK_NAME = &quot;task&quot;
  
  TaskManager.defineTask(TASK_NAME, () =&gt; {
    PushNotificaiton.localNotification({
      title: &quot;Background fetch test&quot;,
      message: &quot;Time: &quot; + new Date().toUTCString()
    })
  })
  
  export default function App() {
  
    return (
      &lt;View style={styles.container}&gt;
        &lt;Text&gt;Open up App.js to start working on your app!&lt;/Text&gt;
        &lt;Button title=&quot;Show notification test&quot; onPress={() =&gt; 
          PushNotificaiton.localNotification({
            title: &quot;It works&quot;,
            message: &quot;Time: &quot; + new Date().toUTCString()
          })}/&gt;
        &lt;Button title=&quot;Register background task&quot; onPress={async () =&gt;  {
          await BackgroundFetch.registerTaskAsync(TASK_NAME, { minimumInterval: parseInt(60), stopOnTerminate: false, startOnBoot: true });
          console.log(`task registered, minimumInterval: ${60}`);  
        }}/&gt;
        &lt;StatusBar style=&quot;auto&quot; /&gt;
      &lt;/View&gt;
    );
  }
  
  const styles = StyleSheet.create({
    container: {
      flex: 1,
      backgroundColor: '#fff',
      alignItems: 'center',
      justifyContent: 'center',
    },
  });
  </code></pre>
  <p>You can get the demo project from here: <a href="https://github.com/samedb/expo-background-fetch-test" rel="nofollow noreferrer">https://github.com/samedb/expo-background-fetch-test</a>
  Whenever the background task gets executed we should get a notification with the current time. The task executes every minute.</p>
  <h3>Steps to Reproduce</h3>
  <p>I created a release apk to test this, idk maybe there was a better way to do this.</p>
  <ul>
  <li>run the app and click 'Register background task'</li>
  <li>try if it works while the app is in the background (it should)</li>
  <li>try if it works when the app is terminated (it should)</li>
  <li>try if it works when you reboot the device without manually running the app (that is the problem)</li>
  </ul>
  <p>As I said it work on Android 6 but it does not work on Android 10, i have not tested it on the versions in between.</p>
  <h3>Expected Behavior vs Actual Behavior</h3>
  <p>Expected behavior: the background task should start working by itself after the reboot
  Actual behavior:  it doesn't start by itself, you have to run the app manually for the task to start</p>