I want to migrate from existing firebase project to a new firebase project Issue is that I have a lot of remote config keys and values in my existing project Now I want to export all remote config keys and values then import to the new firebase project rather than writing everything over again in new project.
Is there any easy way to do it?.
Getting started Run the sample on an Android device or emulator. Change one or more parameter values in the Firebase Console (the value of welcome_message , welcome_message_caps , or both). Tap Fetch Remote Config in the app to fetch new parameter values and see the resulting change in the app.
Firebase Remote Config is part of the Firebase platform and is available for free on both iOS and Android.
You cannot do it from the Firebase console, but you can write a simple script which uses the Remote Config REST API - https://firebase.google.com/docs/remote-config/use-config-rest
So essentially you can download remote config from one project and then upload that into the new project - programmatically.
Cheers!
You can get the remote config keys and values as follows (Swift 4.2):
let remoteConfig = RemoteConfig.remoteConfig()
let ns = NamespaceGoogleMobilePlatform // Oddly evaluates to: "configns:firebase" including spelling mistake
let remoteKeys = remoteConfig.allKeys(from: .remote, namespace: ns)
let remoteDict = Dictionary(uniqueKeysWithValues: remoteKeys.map { ($0, remoteConfig[$0].stringValue) })
let defaultKeys = remoteConfig.allKeys(from: .default, namespace: ns)
let defaultDict = Dictionary(uniqueKeysWithValues: defaultKeys.map { ($0, remoteConfig[$0].stringValue) })
let staticKeys = remoteConfig.allKeys(from: .static, namespace: ns)
let staticDict = Dictionary(uniqueKeysWithValues: staticKeys.map { ($0, remoteConfig[$0].stringValue) })
In my brief searching, I couldn't get the flattened remoteConfig keys and values (i.e. what gets returned when using the subscript: remoteConfig[key]
). I'm guessing you'd just need to overlay the remote values over the default values?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With