简体   繁体   中英

App crashes when location services set to “On”

I have an app that uses the ALAssets framework to access to the users photo library. I wrote some code that detects whether or not the app has permission to access the photo library, and if it doesn't, I display an alert message which tells the user to turn on location services for the app in settings. Problem is, when I go into settings and turn location services on or off for my app, it crashes the app (it doesn't matter what view controller the app is on, even one where ALAssets isn't loaded,it still crashes).

Does anyone know why this is happening, and what I can do to fix this?

UPDATE: here is the crash report, on this line in main:

int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");

it says Thread 1: signal SIGKILL.

Your app is being killed by iOS. This happens always privacy settings are changed that affect your app.

See: App killed by SIGKILL when changing privacy settings

In addition: requesting access to the Location services, will not grant you access to the photo library! That one is a separate privacy setting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM