-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
[REQUIRED] Step 1: Describe your environment
- Xcode version: 12.4
- Firebase SDK version: 8.7.0
- Installation method:
CocoaPods
- Firebase Component: Remote Config
[REQUIRED] Step 2: Describe the problem
If the app is started in the background (eg a background fetch or silent notification) then the remote config database is unable to be opened and all config settings return their default value. This is due to the file protection settings in the open database call here: https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseRemoteConfig/Sources/RCNConfigDBManager.m#L217
Steps to reproduce:
Run an app that uses remote config on a real device with a passcode set, lock the device after the app has been installed and is just starting up.
Observe errors like the following in the logs:
[Firebase/RemoteConfig][I-RCN000015] Error message: authorization denied. Error code: 23.
[Firebase/RemoteConfig][I-RCN000016] Failed with SQL: SELECT bundle_identifier, namespace, key, value FROM main WHERE bundle_identifier = ?.
I have fixed this issue by changing the flag file protection flag to SQLITE_OPEN_FILEPROTECTION_COMPLETEUNTILFIRSTUSERAUTHENTICATION
but I'm unsure of the reasons this is explicitly set to SQLITE_OPEN_FILEPROTECTION_COMPLETE
currently