Co-Epi / mobile-app

Initial ReactNative code for CoEpi app for both iOS and Android - this repo is no longer being used, please see app-ios and app-android repo's for latest native code versions
MIT License
25 stars 9 forks source link

App crashes on launch #5

Open scottleibrand opened 4 years ago

scottleibrand commented 4 years ago

2020-03-11 23:00:22.653615-0700 CoEpi[2200:721528] Can't end BackgroundTask: no background task exists with identifier 15 (0xf), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.

ivnsch commented 4 years ago

The output is just a warning. It seems unrelated with the crash. Maybe an iOS 13 bug (what is your iOS version?) https://forums.developer.apple.com/thread/121990

I was able to reproduce the crash when starting the app after putting it in the background. The cause is this:

Termination Reason: TCC, This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothAlwaysUsageDescription key with a string value explaining to the user how the app uses this data.

Which is weird, since we added NSBluetoothAlwaysUsageDescription to the info.plist (this is the "TODO explain user how the app uses bluetooth" dialog message).

After reinstalling the app I was not able to reproduce it.

I found that we need to add NSBluetoothPeripheralUsageDescription as well, for iOS versions older than 13. I added it in https://github.com/Co-Epi/mobile-app/pull/6. I don't think it's related though, as at least my device has iOS 13.

Let's observe it. It could be a React Native bug that prevents parsing the info.plist correctly / overrides it sometimes. Maybe it goes away with the MVP migration.