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
149 views
in Technique[技术] by (71.8m points)

ios - Toggling Privacy settings will kill the app

I have an app that uses the iPhone's contacts. With iOS 6, the user will be prompted for Contact access on the first try. At this point, the user can hit 'Allow' or 'Don't Allow'. The problem is when the user backgrounds the app, and then navigates to Settings->Privacy->Contacts to toggle the Contact privacy setting for my app. Once it is toggled, I can see on the console that my app:

Application 'UIKitApplication:com.myApp' exited abnormally with signal 9: Killed: 9

I can't find any information on this in Apple's documentation. Does anyone know a way to prevent this? Is this as designed? Or is this an Apple bug?

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

the OS sends a SIGKILL which is not a crash - Apple session on privacy in iOS6 says:

  • If permissions changes, app is quit.
  • Background task expiration handler is called, if registered
  • iOS then kills the application.

WWDC 2012 Session Videos: Privacy Support in iOS and OS X

Expiration handler: beginBackgroundTaskWithExpirationHandler

There is no way around this I can see.


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

...