Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
351 views
in Technique[技术] by (71.8m points)

ios - How do you constantly run in background?

Alarmy (iOS app) has a neat feature that plays alarms even when in background. This is what their FAQ says about it:

Due to Apple's technical policy, applications are not authorized to ring if they are not running in the background. To prevent this, Alarmy is by default configured to constantly run in the background, and this may consume additional battery. You can save battery by going in to our in-app battery-saving mode, but note that in this configuration, alarms will not ring when the phone is in Silent or Do Not Disturb mode!

How can I write an app that can run in the background this way?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

See the docs about iOS background modes here.

Mainly there are a few use cases when doing stuff in the background is allowed:

  • Apps that play audible content to the user while in the background, such as a music player app
  • Apps that record audio content while in the background
  • Apps that keep users informed of their location at allntimes, such as a navigation app
  • Apps that support Voice over Internet Protocol (VoIP)
  • Apps that need to download and process new content regularly
  • Apps that receive regular updates from external accessories

I suspect the app you mentioned hacks into one of those categories.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...