0

I am looking for a way to do a html request in the background every 120minutes

The Plan is:

  1. Request on HTML Site save the Response (HTML String local on the phone)

  2. Do it again 120min later (Intervall can be different)

  3. Compare the strings if anything has changed send a local notification

Anybody knows a good way ? Is that possible?

Snippets would be great.

Thank you for your time and help. Greetings

OneByT
  • 23
  • 1
  • 8
  • You can't do this. You can't run long term background tasks on iOS. You can use the background fetch service but you may get called less frequently than every 120 minutes; the frequency is determined by iOS. A better solution is a server and a push notification. – Paulw11 Jul 03 '17 at 21:08
  • Its okay the Intervall can be different. It was just an example . Can u give me a Code ? How does It Works .. trank you very much – OneByT Jul 03 '17 at 21:38
  • Do i need for a server push app a paid dev acc? – OneByT Jul 04 '17 at 14:58
  • Yes, you can't generate the required push certificate without a paid membership. I don't use C# so I haven't got any code for the background fetch, but if you google you might find some. You basically need to add the background mode to your project and implement the background fetch app delegate method. Here is some Swift code that might help; https://github.com/paulw11/BackgroundFetchTest/tree/master/BackgroundFetchTest – Paulw11 Jul 04 '17 at 20:49
  • Yeah i tried different codes and i activated the background fetch. When i debug it in background fetch mode it works but on the device it never get fired... I read that the os decide by hisself when the fetch gets fired. The algorithmus is a black box so it seems i need the dev acc .. ty for help – OneByT Jul 05 '17 at 09:53

0 Answers0