title: How to run a background Cloud Function and schedule a change in database?
body: <p>I'm developing an app using React Native and Firebase Realtime database. I want to do something like this.</p>
  
  <p>From the app, I set a time duration and press a button. Then, it writes data to the Firebase. Assume that I set the time duration to <code>1000000000 ms</code> and press the button. Then, the database looks like this:</p>
  
  <pre><code>schedules
    |
    |--schedule1
         |
         |--status: "Running"
         |--durationInMS: 1000000000
  </code></pre>
  
  <p>I want to run a background function that changes the above status to "TimeOver" after <code>1000000000 ms</code>. This function should be run in the background even if the app is closed:</p>
  
  <pre><code>schedules
        |
        |--schedule1
             |
             |--status: "TimeOver"
             |--durationInMS: 1000000000
  </code></pre>
  
  <p>How to do this?</p>