Fix RC Codable to handle arrays and dictionaries from plist defaults (#10046)

This commit is contained in:
Paul Beusterien authored and GitHub committed 2022-07-29 11:07:20 -07:00
1 parent cbaa7ce706
commit bc2bc6b9f2
9 files changed
+118 -5

No files matched your search

@@ -40,9 +40,15 @@ struct FirebaseRemoteConfigValueDecoderHelper: FirebaseRemoteConfigValueDecoding
return value.dataValue
}
func jsonValue() -> [String: AnyHashable]? {
func arrayValue() -> [AnyHashable]? {
guard let value = value.jsonValue as? [AnyHashable] else {
return nil
}
return value
}
func dictionaryValue() -> [String: AnyHashable]? {
guard let value = value.jsonValue as? [String: AnyHashable] else {
// nil is the historical behavior for failing to extract JSON.
return nil
}
return value