2

I want to pull data from the firebase in the background. However, after 3 minutes the background application does not work in the background. How can I withdraw data from firebase with the timer in the background? Or is there a scheduled tasks feature in the firebase?

I want to make changes to the database at a specific time. For example, I want to change a data in the firebase after 10 minutes in the background.

@objc func updateStateNew(){

        let ref = Database.database().reference()
        ref.child("\(chip1InfoString1!)/states/\("self.ekle2.text!")").setValue(true)

        ref.child("\(chipFieldText.text!)/states/\("001")").setValue(true)
    }
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

1 Answers1

0

The way to do that(that is acceptable by Apple reviews) is using silent push. So that you can trigger a background task any time you want(with some OS limits) For more details see that answer here

If you don't need to run your background code on a specific time/interval, i recommend you to use background fetch

Or, the best tool but only for iOS 13+: BackgroundTasks

Romulo BM
  • 671
  • 8
  • 16