How to correctly access and handle background operations on IOS

Hello, aspiring programmer here.

I am developing a StepCounter APP, which keeps track of how many steps I have taken and sends to an MQTT server. I am trying to make this happen even while the app is not in focus, but so far I have not been able to get this working.

First tried with silent background music, which seemed pretty inconsistent and inpractical, since I usually play youtube videoes while walking, making the app stop with its silent audio. Then tried GPS, which didnt really do anything (could be implementation problem).

Has anyone made background processing work for their apps?

Start reading here: iOS Background Execution Limits.

How to correctly access and handle background operations on IOS
 
 
Q