MCPcopy Create free account
hub / github.com/NativeScript/firebase / ConfigValue

Class ConfigValue

packages/firebase-remote-config/index.android.ts:34–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32const NSRemoteConfig = lazy(() => org.nativescript.firebase.remote_config.FirebaseRemoteConfig);
33
34export class ConfigValue implements IConfigValue {
35 _native: com.google.firebase.remoteconfig.FirebaseRemoteConfigValue;
36 static fromNative(value: com.google.firebase.remoteconfig.FirebaseRemoteConfigValue) {
37 if (value instanceof com.google.firebase.remoteconfig.FirebaseRemoteConfigValue) {
38 const val = new ConfigValue();
39 val._native = value;
40 return val;
41 }
42 return null;
43 }
44
45 get native() {
46 return this._native;
47 }
48
49 get android() {
50 return this.native;
51 }
52
53 asBoolean(): boolean {
54 return this.native.asBoolean();
55 }
56 asNumber(): number {
57 const value = this.native.asString();
58 return Number(value);
59 }
60 asString(): string {
61 return this.native.asString();
62 }
63
64 getSource(): 'default' | 'static' | 'remote' {
65 switch (this.native.getSource()) {
66 case SourceDefault():
67 return 'default';
68 case SourceStatic():
69 return 'static';
70 case SourceRemote():
71 return 'remote';
72 }
73 }
74}
75
76export class ConfigSettings implements IConfigSettings {
77 _native: com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected