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

Class RemoteConfig

packages/firebase-remote-config/index.ios.ts:96–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94 }
95}
96export class RemoteConfig implements IRemoteConfig {
97 _native: FIRRemoteConfig;
98 _app: FirebaseApp;
99 constructor(app?: FirebaseApp) {
100 if (app?.native) {
101 this._native = FIRRemoteConfig.remoteConfigWithApp(app.native);
102 } else {
103 if (defaultRemoteConfig) {
104 return defaultRemoteConfig;
105 }
106 defaultRemoteConfig = this;
107 this._native = FIRRemoteConfig.remoteConfig();
108 }
109 }
110
111 get native() {
112 return this._native;
113 }
114 get ios() {
115 return this.native;
116 }
117
118 get app(): FirebaseApp {
119 if (!this._app) {
120 // @ts-ignore
121 this._app = FirebaseApp.fromNative(this.native.app);
122 }
123 return this._app;
124 }
125
126 get fetchTimeMillis(): number {
127 return this.native.lastFetchTime?.getTime?.();
128 }
129 get lastFetchStatus(): 'success' | 'failure' | 'no_fetch_yet' | 'throttled' {
130 switch (this.native.lastFetchStatus) {
131 case FIRRemoteConfigFetchStatus.Failure:
132 return 'failure';
133 case FIRRemoteConfigFetchStatus.Success:
134 return 'success';
135 case FIRRemoteConfigFetchStatus.NoFetchYet:
136 return 'no_fetch_yet';
137 case FIRRemoteConfigFetchStatus.Throttled:
138 return 'throttled';
139 }
140 }
141
142 get settings() {
143 return ConfigSettings.fromNative(this.native.configSettings);
144 }
145
146 set settings(value: ConfigSettings) {
147 this.native.configSettings = value.native;
148 }
149
150 activate(): Promise<boolean> {
151 return new Promise((resolve, reject) => {
152 this.native.activateWithCompletion((done, error) => {
153 if (error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…