Visitar URL original
fix(remote_config,ios): emit onConfigUpdated events on the platform t… · firebase/flutterfire@17c7049 · GitHub
Skip to content

Commit 17c7049

Browse files
authored
fix(remote_config,ios): emit onConfigUpdated events on the platform thread (#18673)
Firebase's config-update listener is not guaranteed to run on the main queue, and Flutter rejects platform-channel messages from other threads.
1 parent 3da9b8d commit 17c7049

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/firebase_remote_config/firebase_remote_config/ios/firebase_remote_config/Sources/firebase_remote_config/FirebaseRemoteConfigPlugin.swift‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ public class FirebaseRemoteConfigPlugin: NSObject, FlutterPlugin, FlutterStreamH
211211
return
212212
}
213213
if let update {
214-
events(Array(update.updatedKeys))
214+
let updatedKeys = Array(update.updatedKeys)
215+
DispatchQueue.main.async {
216+
events(updatedKeys)
217+
}
215218
}
216219
}
217220
return nil

0 commit comments

Comments
 (0)