mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-16 00:00:02 +08:00
* Remove deprecated namespace parameter * Update for cordova-plugin-firebase-config@2.0.0
110 lines
2.4 KiB
TypeScript
110 lines
2.4 KiB
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
|
|
|
/**
|
|
* @beta
|
|
* @name Firebase Config
|
|
* @description
|
|
* Cordova plugin for Firebase Config
|
|
*
|
|
* @usage
|
|
* ```typescript
|
|
* import { FirebaseConfig } from '@ionic-native/firebase-config/ngx';
|
|
*
|
|
*
|
|
* constructor(private firebaseConfig: FirebaseConfig) { }
|
|
*
|
|
* ...
|
|
*
|
|
*
|
|
* this.firebaseConfig.getBoolean('my_key')
|
|
* .then((res: any) => console.log(res))
|
|
* .catch((error: any) => console.error(error));
|
|
*
|
|
* ```
|
|
*/
|
|
@Plugin({
|
|
pluginName: 'FirebaseConfig',
|
|
plugin: 'cordova-plugin-firebase-config',
|
|
pluginRef: 'cordova.plugins.firebase.config',
|
|
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-config',
|
|
platforms: ['Android', 'iOS'],
|
|
})
|
|
@Injectable()
|
|
export class FirebaseConfig extends IonicNativePlugin {
|
|
/**
|
|
* Starts fetching configs, adhering to the specified minimum fetch interval.
|
|
*
|
|
* @param {number} expirationDuration
|
|
* @returns {Promise<null>}
|
|
*/
|
|
@Cordova({ sync: true })
|
|
fetch(expirationDuration?: number): Promise<null> {
|
|
return;
|
|
}
|
|
|
|
/**
|
|
* Asynchronously activates the most recently fetched configs, so that the fetched key value pairs take effect.
|
|
*
|
|
* @returns {Promise<null>}
|
|
*/
|
|
@Cordova({ sync: true })
|
|
activate(): Promise<null> {
|
|
return;
|
|
}
|
|
|
|
/**
|
|
* Asynchronously fetches and then activates the fetched configs.
|
|
*
|
|
* @returns {Promise<null>}
|
|
*/
|
|
@Cordova({ sync: true })
|
|
fetchAndActivate(): Promise<null> {
|
|
return;
|
|
}
|
|
|
|
/**
|
|
* Fetches a boolean configuration value from RemoteConfig
|
|
*
|
|
* @param {string} key
|
|
* @returns {Promise<boolean>}
|
|
*/
|
|
@Cordova({ sync: true })
|
|
getBoolean(key: string): Promise<boolean> {
|
|
return;
|
|
}
|
|
|
|
/**
|
|
* Fetches a string configuration value from RemoteConfig
|
|
*
|
|
* @param {string} key
|
|
* @returns {Promise<boolean>}
|
|
*/
|
|
@Cordova({ sync: true })
|
|
getString(key: string): Promise<string> {
|
|
return;
|
|
}
|
|
|
|
/**
|
|
* Fetches a numeric configuration value from RemoteConfig
|
|
*
|
|
* @param {string} key
|
|
* @returns {Promise<boolean>}
|
|
*/
|
|
@Cordova({ sync: true })
|
|
getNumber(key: string): Promise<number> {
|
|
return;
|
|
}
|
|
|
|
/**
|
|
* Fetches an array of bytes configuration value from RemoteConfig
|
|
*
|
|
* @param {string} key
|
|
* @returns {Promise<boolean>}
|
|
*/
|
|
@Cordova({ sync: true })
|
|
getBytes(key: string): Promise<any[]> {
|
|
return;
|
|
}
|
|
}
|