Is there any equivalent of Services of Android in iOS?

前端 未结 3 493
感情败类
感情败类 2021-02-07 13:40

I want to check the database in my app every 12 hrs for rows with date column having corresponding date. This is accomplished by writing service in android. But is there any equ

3条回答
  •  我在风中等你
    2021-02-07 14:01

    No. There is no such thing in the SDK or in iPhone/iPad in general. You can only write code that will affect the eco system of the app, not the operating system. When your app is closed it's closed and no action will be taken until the user opens it/opens a push notification related to your app.

    If the user approved location based services for your app, there are a few ways to run short background process even if your app is totally closed. One of them is by using Monitoring Shape-Based Regions which basically means if the user left region X/entered region Y open the app and run a few commands before closing it again.

    The clever way (and the only way I can think of) to accomplish what you're after in iOS is to run that service on a server and pull the data from the server when the app is opened.

提交回复
热议问题