Cordova plugin for Firebase Remote Config
cordova plugin add cordova-plugin-firebase-config --save
Use variable FIREBASE_CONFIG_VERSION
to override dependency version on Android.
- iOS
- Android
You can specify FirebaseRemoteConfigDefaults
in config.xml
to define filename of a file with default values.
On Android the file is located at platforms/android/res/xml/${filename}.xml
and has a structure like below:
<?xml version="1.0" encoding="utf-8"?>
<defaultsMap>
<entry>
<key>param1</key>
<value>value1</value>
</entry>
</defaultsMap>
On iOS file the file is located at platforms/ios/<Your App Name>/${filename}.plist
and has a structure like below:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>param1</key>
<string>value1</string>
</dict>
</plist>
Every method call returns a promise which is optionally fulfilled with an appropriate value.
Namespace argument is optional.
Fetches remote config values with appropriate TTL and then activates them.
cordova.plugins.firebase.config.update(8 * 3600).then(function() {
// your config was updated
});
cordova.plugins.firebase.config.getBoolean("myBool").then(function(value) {
// use value from remote config
});
cordova.plugins.firebase.config.getString("myStr").then(function(value) {
// use value from remote config
});
cordova.plugins.firebase.config.getNumber("myNumber").then(function(value) {
// use value from remote config
});
cordova.plugins.firebase.config.getBytes("myByteArray").then(function(value) {
// use value from remote config
});