iOS Question Is it possible to have a Timer that can run all the time, even when app is not in the forground.

DKnowles

Member
Licensed User
Longtime User
Hi All
I've been asked to implement a loan worker application option to our main monitoring app, the application must be tapped by the user every 30 mins, or a notification will be sent to the call centre that a employee may be having dificulties. From threads on the site from last year it appears this is not possible if its going to be listed on the app store, but similar apps are now available on Apples App store, is this still the case.

David
 

hatzisn

Expert
Licensed User
Longtime User
According to my knowledge, no.
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
iOS does not allow background code to be executed except of specific only cases.
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
Now that I think about it there is a workaround. You will have to create a B4J server that would send push notifications to the phone of the lone worker and check if they would give a response within a given time period. If yes everything is ok else the B4J server app would send the push notification to you. Of course the iPhone app should be connected to the B4J server app (which is translated as port forwarding in router and no-ip implementation) and the lone worker should be keeping their phone always with them.
 
Last edited:
Upvote 0

ilan

Expert
Licensed User
Longtime User
you don't need to run a timer in the background. just store the current time when activity goes to the background and calculate it again when you enter the app.
i attach an example in b4j but it is the same concept for b4i. now in the call center, you can trigger the last tap of a specific employee and if more than 30 minutes are passed then perform the action you want to. so the check can be done in the call center app side and no need to do that in the client-side (employee app)
 

Attachments

  • backtimer.zip
    866 bytes · Views: 173
  • backtimer.jar
    363.5 KB · Views: 157
Upvote 0
Top