Skip to content

cephalo-ai/cordova-plugin-firebase-config

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-firebase-config
NPM version NPM downloads

Cordova plugin for Firebase Remote Config

Installation

cordova plugin add cordova-plugin-firebase-config --save

Use variable FIREBASE_CONFIG_VERSION to override dependency version on Android.

Supported Platforms

  • iOS
  • Android

Preferences

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>
    <entry>
        <key>param2</key>
        <value>value2</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>
    <key>param2</key>
    <string>value2</string>
</dict>
</plist>

Methods

Every method call returns a promise which is optionally fulfilled with an appropriate value.

Namespace argument is optional.

update(ttlSeconds)

Fetches remote config values with appropriate TTL and then activates them.

cordova.plugins.firebase.config.update(8 * 3600).then(function() {
    // your config was updated
});

getBoolean(key, namespace)

cordova.plugins.firebase.config.getBoolean("myBool").then(function(value) {
    // use value from remote config
});

getString(key, namespace)

cordova.plugins.firebase.config.getString("myStr").then(function(value) {
    // use value from remote config
});

getNumber(key, namespace)

cordova.plugins.firebase.config.getNumber("myNumber").then(function(value) {
    // use value from remote config
});

getBytes(key, namespace)

cordova.plugins.firebase.config.getBytes("myByteArray").then(function(value) {
    // use value from remote config
});

About

Cordova plugin for Firebase Remote Config

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 45.0%
  • Java 44.6%
  • JavaScript 10.4%