locked
IOS Background Task RRS feed

  • Question

  • User385588 posted

    how to run a code every 5 minutes(for example) in Xamarin.IOS ? i mean, even if the app is completely closed.

    i need to check a server data and then display a notification if(data==true)

    Observation: in Xamarin.Android i used BroadCast with AlarmManager and it did the job.

    Wednesday, May 15, 2019 12:22 PM

Answers

  • User369978 posted

    @NRayan said: But what about the Alarm apps from AppleStore ? can't even treat my app like one of them ? instead of vibrate and play some sound, just run a simple code ?

    That alarm apps are all using local notification and keep them under background . Refer https://stackoverflow.com/a/43539458/8187800

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, May 17, 2019 5:36 AM

All replies

  • User369978 posted

    how to run a code every 5 minutes(for example) in Xamarin.IOS ? i mean, even if the app is completely closed.

    Short answer : Impossible.

    1. App is in background - some tasks are allowed to do refer Background Execution , iOS Backgrounding with Tasks.

    2. App terminated - Nothing can do (except receiving remote notification).

    Thursday, May 16, 2019 6:49 AM
  • User385588 posted

    But what about the Alarm apps from AppleStore ? can't even treat my app like one of them ? instead of vibrate and play some sound, just run a simple code ?

    Thursday, May 16, 2019 3:06 PM
  • User369978 posted

    @NRayan said: But what about the Alarm apps from AppleStore ? can't even treat my app like one of them ? instead of vibrate and play some sound, just run a simple code ?

    That alarm apps are all using local notification and keep them under background . Refer https://stackoverflow.com/a/43539458/8187800

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, May 17, 2019 5:36 AM