@react-native-firebase/remote-config 25.0.1 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/RNFBRemoteConfig.podspec +7 -6
- package/android/build.gradle +19 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/{ReactNativeFirebaseConfigModule.java → NativeRNFBTurboConfig.java} +53 -40
- package/android/src/reactnative/java/io/invertase/firebase/config/ReactNativeFirebaseConfigPackage.java +1 -1
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboConfigSpec.java +115 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/CMakeLists.txt +36 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/RNFBRemoteConfigTurboModules-generated.cpp +98 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/RNFBRemoteConfigTurboModules.h +31 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/react/renderer/components/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModulesJSI-generated.cpp +110 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/react/renderer/components/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModulesJSI.h +471 -0
- package/dist/module/index.js +499 -5
- package/dist/module/index.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/lib/index.d.ts +83 -5
- package/dist/typescript/lib/index.d.ts.map +1 -1
- package/dist/typescript/lib/types/internal.d.ts +25 -24
- package/dist/typescript/lib/types/internal.d.ts.map +1 -1
- package/dist/typescript/lib/types/remote-config.d.ts +24 -3
- package/dist/typescript/lib/types/remote-config.d.ts.map +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/ios/RNFBConfig/RNFBConfigModule.h +3 -2
- package/ios/RNFBConfig/{RNFBConfigModule.m → RNFBConfigModule.mm} +137 -93
- package/ios/RNFBConfig.xcodeproj/project.pbxproj +8 -8
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModules-generated.mm +121 -0
- package/ios/generated/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModules.h +172 -0
- package/ios/generated/RNFBRemoteConfigTurboModulesJSI-generated.cpp +110 -0
- package/ios/generated/RNFBRemoteConfigTurboModulesJSI.h +471 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/index.ts +683 -8
- package/lib/types/internal.ts +25 -44
- package/lib/types/remote-config.ts +28 -3
- package/lib/version.ts +1 -1
- package/package.json +23 -5
- package/react-native.config.js +10 -0
- package/specs/NativeRNFBTurboConfig.ts +60 -0
- package/typedoc.json +1 -1
- package/dist/module/modular.js +0 -155
- package/dist/module/modular.js.map +0 -1
- package/dist/module/namespaced.js +0 -400
- package/dist/module/namespaced.js.map +0 -1
- package/dist/module/types/namespaced.js +0 -24
- package/dist/module/types/namespaced.js.map +0 -1
- package/dist/typescript/lib/modular.d.ts +0 -76
- package/dist/typescript/lib/modular.d.ts.map +0 -1
- package/dist/typescript/lib/namespaced.d.ts +0 -11
- package/dist/typescript/lib/namespaced.d.ts.map +0 -1
- package/dist/typescript/lib/types/namespaced.d.ts +0 -124
- package/dist/typescript/lib/types/namespaced.d.ts.map +0 -1
- package/lib/modular.ts +0 -197
- package/lib/namespaced.ts +0 -552
- package/lib/types/namespaced.ts +0 -163
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"namespaced.d.ts","sourceRoot":"","sources":["../../../../lib/types/namespaced.ts"],"names":[],"mappings":"AAiB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B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;QAC9B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;KACvB;IAED,KAAY,kBAAkB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC;IAEpF,KAAY,+BAA+B,GAAG,CAC5C,KAAK,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,EAAE,CAAA;KAAE,EACjC,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,kBAAkB,EAAE,MAAM,CAAC;KAC5B,KACE,IAAI,CAAC;CACX;AAED,OAAO,QAAQ,4BAA4B,CAAC;IAE1C,UAAU,mBAAmB,CAAC;QAC5B,OAAO,yBAAyB,GAAG,mBAAmB,CAAC,yBAAyB,CAAC;QAEjF,UAAU,MAAM;YACd;;eAEG;YACH,YAAY,EAAE,yBAAyB,CACrC,yBAAyB,CAAC,MAAM,EAChC,yBAAyB,CAAC,OAAO,CAClC,CAAC;SACH;QAED,UAAU,WAAW;YACnB;;eAEG;YACH,YAAY,IAAI,yBAAyB,CAAC,MAAM,CAAC;SAClD;KACF;CACF"}
|
package/lib/modular.ts
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this library except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import type { FirebaseApp } from '@firebase/app';
|
|
19
|
-
import { getApp } from '@react-native-firebase/app';
|
|
20
|
-
import {
|
|
21
|
-
MODULAR_DEPRECATION_ARG,
|
|
22
|
-
withModularFlag,
|
|
23
|
-
} from '@react-native-firebase/app/dist/module/common';
|
|
24
|
-
import type {
|
|
25
|
-
ConfigUpdateObserver,
|
|
26
|
-
CustomSignals,
|
|
27
|
-
LogLevel,
|
|
28
|
-
RemoteConfig,
|
|
29
|
-
Unsubscribe,
|
|
30
|
-
Value,
|
|
31
|
-
} from './types/remote-config';
|
|
32
|
-
import type { AppWithRemoteConfigInternal, RemoteConfigInternal } from './types/internal';
|
|
33
|
-
|
|
34
|
-
function rc(remoteConfig: RemoteConfig): RemoteConfigInternal {
|
|
35
|
-
return remoteConfig as RemoteConfigInternal;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type { CustomSignals } from './types/remote-config';
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Returns a RemoteConfig instance for the given app.
|
|
42
|
-
* @param app - FirebaseApp. Optional.
|
|
43
|
-
*/
|
|
44
|
-
export function getRemoteConfig(app?: FirebaseApp): RemoteConfig {
|
|
45
|
-
if (app) {
|
|
46
|
-
return withModularFlag(() =>
|
|
47
|
-
(getApp(app.name) as unknown as AppWithRemoteConfigInternal).remoteConfig(
|
|
48
|
-
MODULAR_DEPRECATION_ARG,
|
|
49
|
-
),
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return withModularFlag(() =>
|
|
54
|
-
(getApp() as unknown as AppWithRemoteConfigInternal).remoteConfig(MODULAR_DEPRECATION_ARG),
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Returns a Boolean which resolves to true if the current call
|
|
60
|
-
* activated the fetched configs.
|
|
61
|
-
*/
|
|
62
|
-
export function activate(remoteConfig: RemoteConfig): Promise<boolean> {
|
|
63
|
-
return rc(remoteConfig).activate.call(remoteConfig, MODULAR_DEPRECATION_ARG);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Ensures the last activated config are available to the getters.
|
|
68
|
-
*/
|
|
69
|
-
export function ensureInitialized(remoteConfig: RemoteConfig): Promise<void> {
|
|
70
|
-
return rc(remoteConfig).ensureInitialized.call(remoteConfig, MODULAR_DEPRECATION_ARG);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Performs a fetch and returns a Boolean which resolves to true
|
|
75
|
-
* if the current call activated the fetched configs.
|
|
76
|
-
*/
|
|
77
|
-
export function fetchAndActivate(remoteConfig: RemoteConfig): Promise<boolean> {
|
|
78
|
-
return rc(remoteConfig).fetchAndActivate.call(remoteConfig, MODULAR_DEPRECATION_ARG);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Fetches and caches configuration from the Remote Config service.
|
|
83
|
-
*/
|
|
84
|
-
export function fetchConfig(remoteConfig: RemoteConfig): Promise<void> {
|
|
85
|
-
return rc(remoteConfig).fetch.call(remoteConfig, undefined, MODULAR_DEPRECATION_ARG);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Gets all config.
|
|
90
|
-
*/
|
|
91
|
-
export function getAll(remoteConfig: RemoteConfig): Record<string, Value> {
|
|
92
|
-
return rc(remoteConfig).getAll.call(remoteConfig, MODULAR_DEPRECATION_ARG);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Gets the value for the given key as a boolean.
|
|
97
|
-
*/
|
|
98
|
-
export function getBoolean(remoteConfig: RemoteConfig, key: string): boolean {
|
|
99
|
-
return rc(remoteConfig).getBoolean.call(remoteConfig, key, MODULAR_DEPRECATION_ARG);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Gets the value for the given key as a number.
|
|
104
|
-
*/
|
|
105
|
-
export function getNumber(remoteConfig: RemoteConfig, key: string): number {
|
|
106
|
-
return rc(remoteConfig).getNumber.call(remoteConfig, key, MODULAR_DEPRECATION_ARG);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Gets the value for the given key as a string.
|
|
111
|
-
*/
|
|
112
|
-
export function getString(remoteConfig: RemoteConfig, key: string): string {
|
|
113
|
-
return rc(remoteConfig).getString.call(remoteConfig, key, MODULAR_DEPRECATION_ARG);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Gets the value for the given key.
|
|
118
|
-
*/
|
|
119
|
-
export function getValue(remoteConfig: RemoteConfig, key: string): Value {
|
|
120
|
-
return rc(remoteConfig).getValue.call(remoteConfig, key, MODULAR_DEPRECATION_ARG);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Defines the log level to use.
|
|
125
|
-
*/
|
|
126
|
-
export function setLogLevel(remoteConfig: RemoteConfig, logLevel: LogLevel): void {
|
|
127
|
-
void remoteConfig;
|
|
128
|
-
void logLevel;
|
|
129
|
-
// Intentionally ignored on native. The modular API matches the JS SDK and returns void.
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Checks two different things.
|
|
134
|
-
* 1. Check if IndexedDB exists in the browser environment.
|
|
135
|
-
* 2. Check if the current browser context allows IndexedDB open() calls.
|
|
136
|
-
*/
|
|
137
|
-
export function isSupported(): Promise<boolean> {
|
|
138
|
-
// always return "true" for now. Web only.
|
|
139
|
-
return Promise.resolve(true);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Deletes all activated, fetched and defaults configs and
|
|
144
|
-
* resets all Firebase Remote Config settings.
|
|
145
|
-
* Android only. iOS does not reset anything.
|
|
146
|
-
*/
|
|
147
|
-
export function reset(remoteConfig: RemoteConfig): Promise<void> {
|
|
148
|
-
return rc(remoteConfig).reset.call(remoteConfig, MODULAR_DEPRECATION_ARG);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Sets defaults based on a native resource.
|
|
153
|
-
*/
|
|
154
|
-
export function setDefaultsFromResource(
|
|
155
|
-
remoteConfig: RemoteConfig,
|
|
156
|
-
resourceName: string,
|
|
157
|
-
): Promise<null> {
|
|
158
|
-
return rc(remoteConfig).setDefaultsFromResource.call(
|
|
159
|
-
remoteConfig,
|
|
160
|
-
resourceName,
|
|
161
|
-
MODULAR_DEPRECATION_ARG,
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Registers a listener to changes in the configuration.
|
|
167
|
-
*
|
|
168
|
-
*/
|
|
169
|
-
export function onConfigUpdate(
|
|
170
|
-
remoteConfig: RemoteConfig,
|
|
171
|
-
observer: ConfigUpdateObserver,
|
|
172
|
-
): Unsubscribe {
|
|
173
|
-
return rc(remoteConfig).onConfigUpdate.call(remoteConfig, observer, MODULAR_DEPRECATION_ARG);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Sets the custom signals for the app instance.
|
|
178
|
-
*/
|
|
179
|
-
export async function setCustomSignals(
|
|
180
|
-
remoteConfig: RemoteConfig,
|
|
181
|
-
customSignals: CustomSignals,
|
|
182
|
-
): Promise<void> {
|
|
183
|
-
for (const [key, value] of Object.entries(customSignals)) {
|
|
184
|
-
if (typeof value !== 'string' && typeof value !== 'number' && value !== null) {
|
|
185
|
-
throw new Error(
|
|
186
|
-
`firebase.remoteConfig().setCustomSignals(): Invalid type for custom signal '${key}': ${typeof value}. Expected 'string', 'number', or 'null'.`,
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return withModularFlag(() =>
|
|
192
|
-
rc(remoteConfig)._promiseWithConstants(
|
|
193
|
-
rc(remoteConfig).native.setCustomSignals(customSignals),
|
|
194
|
-
MODULAR_DEPRECATION_ARG,
|
|
195
|
-
),
|
|
196
|
-
);
|
|
197
|
-
}
|