You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I just discovered a strange issue when setting a default config with a Codable containing a Date attribute to Firebase Remote Config on iOS.
What I thing its happening is: since Remote Config uses its own JSONEncoder internally it takes the Date and parses it using a unix format (ex: 666140400) while in Firebase Remote Config dashboard the dates in the JSON are in iso8601 format. So when my app tries to fetch the config from Firebase, if for some reason it fails or doesn't manage to retrieve the one online and has to resort to the default one, my code will fail to parse the returned data because im trying to decode an iso8601 date in my Codable, and the returned one is unix only in this particular case, even though the configs I set both locally and online have iso8601 dates.
I think a possible way of solving this would be if we could configure manually the encoding/decoding strategy that Firebase uses internally, to guarantee that the data format is consistent.
Meanwhile my workaround has been to transform my default config Codable to a Dictionary, using my own encoder configured for iso8601, and use the setDefaults method that accepts dictionaries as parameter instead.
Hope I managed to explain the issue clearly.
Thank you.
Reproducing the issue
No response
Firebase SDK Version
11.7.0
Xcode Version
16.2
Installation Method
Swift Package Manager
Firebase Product(s)
Remote Config
Targeted Platforms
iOS
Relevant Log Output
If using Swift Package Manager, the project's Package.resolved
Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
Expand Podfile.lock snippet
Replace this line with the contents of your Podfile.lock!
The text was updated successfully, but these errors were encountered:
Description
Hi,
I just discovered a strange issue when setting a default config with a Codable containing a Date attribute to Firebase Remote Config on iOS.
What I thing its happening is: since Remote Config uses its own JSONEncoder internally it takes the Date and parses it using a unix format (ex: 666140400) while in Firebase Remote Config dashboard the dates in the JSON are in iso8601 format. So when my app tries to fetch the config from Firebase, if for some reason it fails or doesn't manage to retrieve the one online and has to resort to the default one, my code will fail to parse the returned data because im trying to decode an iso8601 date in my Codable, and the returned one is unix only in this particular case, even though the configs I set both locally and online have iso8601 dates.
I think a possible way of solving this would be if we could configure manually the encoding/decoding strategy that Firebase uses internally, to guarantee that the data format is consistent.
Meanwhile my workaround has been to transform my default config Codable to a Dictionary, using my own encoder configured for iso8601, and use the setDefaults method that accepts dictionaries as parameter instead.
Hope I managed to explain the issue clearly.
Thank you.
Reproducing the issue
No response
Firebase SDK Version
11.7.0
Xcode Version
16.2
Installation Method
Swift Package Manager
Firebase Product(s)
Remote Config
Targeted Platforms
iOS
Relevant Log Output
If using Swift Package Manager, the project's Package.resolved
Expand
Package.resolved
snippetReplace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
Expand
Podfile.lock
snippetReplace this line with the contents of your Podfile.lock!
The text was updated successfully, but these errors were encountered: