Files
react-native-firebase/packages/remote-config/type-test.ts
Russell Wheatley 256b6a47e5 feat(remote-config)!: API update to match web SDK (#3537)
* feat(remote-config): API update to match web SDK

* feat(remote-config): reset API for android

* tests(remote-config): update assertions

* tests(remote-config): update to match api

* chore(remote-config): update

* chore(remote-config): update tests/API

* tests(remote-config): update tests

* feat(remtoe-config): PR comment updates

* Apply suggestions from code review

Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>

* chore(remote-config): Pr comment updates

* fix(remote-config): revert back mocha config

* Apply suggestions from code review

Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>

* chore(remote-config): rename array

* chore(remote-config): PR updates

* chore(remote-config): lint disable

* chore(remote-config): update types

* docs(remote-config): update docs

* docs(remote-config): note

* docs(remote-config): update

* docs(remote-config): further updates

* fix(ml-vision): cancel tests

* docs(*): RNFB not part of spelling list

* chore(*) update spelling list

* docs(*): update ts.json docs

* docs(*): update ts docs

* Apply suggestions from code review

Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>

* chore(remote-config): release updates

* chore(remote-config): types

* chore(remote-config): 'fetchTimeMillis' api

* docs(remote-config): update docs

* chore(remote-config): api update

* Update packages/remote-config/type-test.ts

* chore(remote-config): further changes

Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>
2020-07-16 12:32:58 +01:00

52 lines
1.3 KiB
TypeScript

import firebase from '@react-native-firebase/app';
import * as config from '@react-native-firebase/remote-config';
console.log(config.default().app);
// checks module exists at root
console.log(firebase.remoteConfig().app.name);
// checks module exists at app level
console.log(firebase.app().remoteConfig().app.name);
// checks statics exist
console.log(firebase.remoteConfig.SDK_VERSION);
// checks statics exist on defaultExport
console.log(firebase.SDK_VERSION);
// checks root exists
console.log(firebase.SDK_VERSION);
// checks firebase named export exists on module
console.log(config.firebase.SDK_VERSION);
console.log(firebase.remoteConfig().lastFetchStatus);
console.log(firebase.remoteConfig().fetchTimeMillis);
const value = firebase.remoteConfig().getValue('example');
// checks methods exist on RemoteConfigValue
console.log(value.asBoolean());
console.log(value.asNumber());
console.log(value.asString());
console.log(value.getSource());
firebase
.remoteConfig()
.fetch()
.then();
firebase
.remoteConfig()
.fetch(123)
.then();
firebase.remoteConfig().getAll();
firebase.remoteConfig().reset().then;
firebase.remoteConfig().activate().then;
firebase.remoteConfig().fetchAndActivate().then;
firebase.remoteConfig().setConfigSettings({}).then;
firebase.remoteConfig().ensureInitialized().then;
firebase.remoteConfig().setDefaults({}).then;