Delay a callback in iOS and run when app goes into the background

151 Views Asked by At

How can I run a callback even if the app goes into the background in iOS? I want to delay a function and run it only once after 5 to 30 minutes (time of my choice).

Is there anyway to achieve this? My use case is, when the user postpones an event for 5 minutes, after 5 minutes I would like to call a function to resume the event.

  • I tried react native background fetch and background timer but still no good
  • I want to run my function after 5 to 30 minutes (time of my choice) even if app is in the background

Edit:

  • The specific thing we're trying to achieve is to start blocking distractions via the Managed Settings API after a certain time period. The user is able to postpone blocking for say 15 minutes and we want to reactivate it after that time
0

There are 0 best solutions below