diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b2e25ae..0fb583b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -158,6 +158,20 @@ await analytics().setUserId('12345678'); - [NEW] Added support for `firebase.perf.Trace.removeMetric(metricName: string)` - [NEW] Added support for `firebase.perf.Trace.getMetrics(): { [key: string]: number }` + +## Remote Config (config) + + - [NEW] Added a new `fetchAndActivate` method - this fetches the config and activate it without the need to call `activateFetch()` separately + - [NEW] Added a new `getConfigSettings` method - this provides the following properties; `lastFetchTime`, `lastFetchStatus` & `isDeveloperModeEnabled` + - [NEW] Added a new `setConfigSettings` method - this allows setting `isDeveloperModeEnabled`, replaces the `enableDeveloperMode` method + - [NEW] Added a new `getValuesByKeysPrefix` method - this will retrieve all values where the key matches the prefix provided, this saves having to call `getKeysByPrefix` and then `getValues` separately + - [BREAKING] `setDefaultsFromResource` now returns a Promise that resolves when completed, this will reject with code `config/resouce_not_found` if the file could not be found + - [BREAKING] `setDefaultsFromResource` now expects a resource file name for Android to match iOS, formerly this required a resource id (something you would not have in RN as this was generated at build time by Android) + - We're writing up a guide for this on the new documentation website, showing how to use the plist/xml defaults files on each platform + - [BREAKING] `enableDeveloperMode` has been removed, you can now use `setConfigSettings({ isDeveloperModeEnabled: boolean })` instead + - [BREAKING] `setDefaults` now returns a Promise that resolves when completed + + ## Messaging - [NEW] Support `setAutoInitEnabled(enabled: boolean)` - this is useful for opt-in first flows diff --git a/docs/typedoc.json b/docs/typedoc.json index a6c379f7..c6f40d69 100644 --- a/docs/typedoc.json +++ b/docs/typedoc.json @@ -30,7 +30,7 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", @@ -204,45 +204,45 @@ ] }, { - "id": 79, + "id": 122, "name": "config", "kind": 2048, "kindString": "Method", "flags": {}, "signatures": [ { - "id": 80, + "id": 123, "name": "config", "kind": 4096, "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Config" + "shortText": "Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your\napp without requiring users to download an app update. When using Remote Config, you create in-app default\nvalues that control the behavior and appearance of your app." }, "type": { "type": "reference", "name": "Module", - "id": 72 + "id": 87 } } ], "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 83, + "line": 195, "character": 10 } ] }, { - "id": 121, + "id": 164, "name": "crashlytics", "kind": 2048, "kindString": "Method", "flags": {}, "signatures": [ { - "id": 122, + "id": 165, "name": "crashlytics", "kind": 4096, "kindString": "Call signature", @@ -253,7 +253,7 @@ "type": { "type": "reference", "name": "Module", - "id": 83 + "id": 126 } } ], @@ -266,14 +266,14 @@ ] }, { - "id": 140, + "id": 183, "name": "fiam", "kind": 2048, "kindString": "Method", "flags": {}, "signatures": [ { - "id": 141, + "id": 184, "name": "fiam", "kind": 4096, "kindString": "Call signature", @@ -284,7 +284,7 @@ "type": { "type": "reference", "name": "Module", - "id": 125 + "id": 168 } } ], @@ -297,14 +297,14 @@ ] }, { - "id": 151, + "id": 194, "name": "firestore", "kind": 2048, "kindString": "Method", "flags": {}, "signatures": [ { - "id": 152, + "id": 195, "name": "firestore", "kind": 4096, "kindString": "Call signature", @@ -315,7 +315,7 @@ "type": { "type": "reference", "name": "Module", - "id": 144 + "id": 187 } } ], @@ -328,7 +328,7 @@ ] }, { - "id": 200, + "id": 243, "name": "functions", "kind": 2048, "kindString": "Method", @@ -337,7 +337,7 @@ }, "signatures": [ { - "id": 201, + "id": 244, "name": "functions", "kind": 4096, "kindString": "Call signature", @@ -347,7 +347,7 @@ }, "parameters": [ { - "id": 202, + "id": 245, "name": "region", "kind": 32768, "kindString": "Parameter", @@ -375,7 +375,7 @@ "type": { "type": "reference", "name": "Module", - "id": 186 + "id": 229 } } ], @@ -388,14 +388,14 @@ ] }, { - "id": 224, + "id": 267, "name": "iid", "kind": 2048, "kindString": "Method", "flags": {}, "signatures": [ { - "id": 225, + "id": 268, "name": "iid", "kind": 4096, "kindString": "Call signature", @@ -407,7 +407,7 @@ "type": { "type": "reference", "name": "Module", - "id": 205 + "id": 248 } } ], @@ -420,14 +420,14 @@ ] }, { - "id": 235, + "id": 278, "name": "mlkit", "kind": 2048, "kindString": "Method", "flags": {}, "signatures": [ { - "id": 236, + "id": 279, "name": "mlkit", "kind": 4096, "kindString": "Call signature", @@ -438,7 +438,7 @@ "type": { "type": "reference", "name": "Module", - "id": 228 + "id": 271 } } ], @@ -451,14 +451,14 @@ ] }, { - "id": 329, + "id": 372, "name": "perf", "kind": 2048, "kindString": "Method", "flags": {}, "signatures": [ { - "id": 330, + "id": 373, "name": "perf", "kind": 4096, "kindString": "Call signature", @@ -469,7 +469,7 @@ "type": { "type": "reference", "name": "Module", - "id": 310 + "id": 353 } } ], @@ -518,7 +518,7 @@ } }, { - "id": 340, + "id": 383, "name": "utils", "kind": 4096, "kindString": "Call signature", @@ -529,7 +529,7 @@ "type": { "type": "reference", "name": "Module", - "id": 333 + "id": 376 } } ], @@ -554,14 +554,14 @@ "children": [ 48, 68, - 79, - 121, - 140, - 151, - 200, - 224, - 235, - 329, + 122, + 164, + 183, + 194, + 243, + 267, + 278, + 372, 56 ] } @@ -584,7 +584,7 @@ }, { "fileName": "config/lib/index.d.ts", - "line": 79, + "line": 189, "character": 23 }, { @@ -655,7 +655,7 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", @@ -689,7 +689,7 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", @@ -705,30 +705,30 @@ } }, { - "id": 78, + "id": 121, "name": "config", "kind": 1024, "kindString": "Property", "flags": {}, "comment": { - "shortText": "Config" + "shortText": "Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your\napp without requiring users to download an app update. When using Remote Config, you create in-app default\nvalues that control the behavior and appearance of your app." }, "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 73, + "line": 186, "character": 10 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 72 + "id": 87 }, { "type": "reference", @@ -739,7 +739,7 @@ } }, { - "id": 120, + "id": 163, "name": "crashlytics", "kind": 1024, "kindString": "Property", @@ -757,23 +757,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 83 + "id": 126 }, { "type": "reference", "name": "Statics", - "id": 82 + "id": 125 } ] } }, { - "id": 139, + "id": 182, "name": "fiam", "kind": 1024, "kindString": "Property", @@ -791,23 +791,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 125 + "id": 168 }, { "type": "reference", "name": "Statics", - "id": 124 + "id": 167 } ] } }, { - "id": 150, + "id": 193, "name": "firestore", "kind": 1024, "kindString": "Property", @@ -825,23 +825,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 144 + "id": 187 }, { "type": "reference", "name": "Statics", - "id": 143 + "id": 186 } ] } }, { - "id": 199, + "id": 242, "name": "functions", "kind": 1024, "kindString": "Property", @@ -859,23 +859,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStaticsWithApp", - "id": 413, + "id": 456, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 186 + "id": 229 }, { "type": "reference", "name": "Statics", - "id": 184 + "id": 227 } ] } }, { - "id": 223, + "id": 266, "name": "iid", "kind": 1024, "kindString": "Property", @@ -894,23 +894,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStaticsWithApp", - "id": 413, + "id": 456, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 205 + "id": 248 }, { "type": "reference", "name": "Statics", - "id": 204 + "id": 247 } ] } }, { - "id": 234, + "id": 277, "name": "mlkit", "kind": 1024, "kindString": "Property", @@ -928,23 +928,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 228 + "id": 271 }, { "type": "reference", "name": "Statics", - "id": 227 + "id": 270 } ] } }, { - "id": 328, + "id": 371, "name": "perf", "kind": 1024, "kindString": "Property", @@ -962,17 +962,17 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 310 + "id": 353 }, { "type": "reference", "name": "Statics", - "id": 309 + "id": 352 } ] } @@ -1003,17 +1003,17 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 333 + "id": 376 }, { "type": "reference", "name": "Statics", - "id": 332 + "id": 375 } ] } @@ -1026,14 +1026,14 @@ "children": [ 46, 67, - 78, - 120, - 139, - 150, - 199, - 223, - 234, - 328, + 121, + 163, + 182, + 193, + 242, + 266, + 277, + 371, 52 ] } @@ -1056,7 +1056,7 @@ }, { "fileName": "config/lib/index.d.ts", - "line": 69, + "line": 180, "character": 40 }, { @@ -1130,7 +1130,7 @@ }, { "fileName": "config/lib/index.d.ts", - "line": 68, + "line": 179, "character": 49 }, { @@ -1201,7 +1201,7 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", @@ -1296,14 +1296,14 @@ ] }, { - "id": 74, + "id": 117, "name": "\"@react-native-firebase/config\"", "kind": 2, "kindString": "Module", "flags": {}, "children": [ { - "id": 77, + "id": 120, "name": "ConfigDefaultExport", "kind": 32, "kindString": "Variable", @@ -1314,19 +1314,19 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 51, + "line": 165, "character": 27 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 72 + "id": 87 }, { "type": "reference", @@ -1337,7 +1337,7 @@ } }, { - "id": 75, + "id": 118, "name": "FirebaseNamespaceExport", "kind": 32, "kindString": "Variable", @@ -1347,7 +1347,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 40, + "line": 154, "character": 31 } ], @@ -1366,7 +1366,7 @@ } }, { - "id": 76, + "id": 119, "name": "firebase", "kind": 32, "kindString": "Variable", @@ -1385,7 +1385,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 49, + "line": 163, "character": 23 } ], @@ -1401,29 +1401,29 @@ "title": "Variables", "kind": 32, "children": [ - 77, - 75, - 76 + 120, + 118, + 119 ] } ], "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 37, + "line": 151, "character": 46 } ] }, { - "id": 116, + "id": 159, "name": "\"@react-native-firebase/crashlytics\"", "kind": 2, "kindString": "Module", "flags": {}, "children": [ { - "id": 119, + "id": 162, "name": "CrashlyticsDefaultExport", "kind": 32, "kindString": "Variable", @@ -1441,23 +1441,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 83 + "id": 126 }, { "type": "reference", "name": "Statics", - "id": 82 + "id": 125 } ] } }, { - "id": 117, + "id": 160, "name": "FirebaseNamespaceExport", "kind": 32, "kindString": "Variable", @@ -1486,7 +1486,7 @@ } }, { - "id": 118, + "id": 161, "name": "firebase", "kind": 32, "kindString": "Variable", @@ -1521,9 +1521,9 @@ "title": "Variables", "kind": 32, "children": [ - 119, - 117, - 118 + 162, + 160, + 161 ] } ], @@ -1536,14 +1536,14 @@ ] }, { - "id": 135, + "id": 178, "name": "\"@react-native-firebase/fiam\"", "kind": 2, "kindString": "Module", "flags": {}, "children": [ { - "id": 138, + "id": 181, "name": "FiamDefaultExport", "kind": 32, "kindString": "Variable", @@ -1561,23 +1561,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 125 + "id": 168 }, { "type": "reference", "name": "Statics", - "id": 124 + "id": 167 } ] } }, { - "id": 136, + "id": 179, "name": "FirebaseNamespaceExport", "kind": 32, "kindString": "Variable", @@ -1606,7 +1606,7 @@ } }, { - "id": 137, + "id": 180, "name": "firebase", "kind": 32, "kindString": "Variable", @@ -1641,9 +1641,9 @@ "title": "Variables", "kind": 32, "children": [ - 138, - 136, - 137 + 181, + 179, + 180 ] } ], @@ -1656,14 +1656,14 @@ ] }, { - "id": 146, + "id": 189, "name": "\"@react-native-firebase/firestore\"", "kind": 2, "kindString": "Module", "flags": {}, "children": [ { - "id": 147, + "id": 190, "name": "FirebaseNamespaceExport", "kind": 32, "kindString": "Variable", @@ -1692,7 +1692,7 @@ } }, { - "id": 149, + "id": 192, "name": "FirestoreDefaultExport", "kind": 32, "kindString": "Variable", @@ -1710,23 +1710,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 144 + "id": 187 }, { "type": "reference", "name": "Statics", - "id": 143 + "id": 186 } ] } }, { - "id": 148, + "id": 191, "name": "firebase", "kind": 32, "kindString": "Variable", @@ -1761,9 +1761,9 @@ "title": "Variables", "kind": 32, "children": [ - 147, - 149, - 148 + 190, + 192, + 191 ] } ], @@ -1776,14 +1776,14 @@ ] }, { - "id": 195, + "id": 238, "name": "\"@react-native-firebase/functions\"", "kind": 2, "kindString": "Module", "flags": {}, "children": [ { - "id": 198, + "id": 241, "name": "FunctionsDefaultExport", "kind": 32, "kindString": "Variable", @@ -1801,23 +1801,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStaticsWithApp", - "id": 413, + "id": 456, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 186 + "id": 229 }, { "type": "reference", "name": "Statics", - "id": 184 + "id": 227 } ] } }, { - "id": 196, + "id": 239, "name": "HttpsErrorCode", "kind": 32, "kindString": "Variable", @@ -1842,13 +1842,13 @@ { "type": "reference", "name": "HttpsErrorCode", - "id": 166 + "id": 209 } ] } }, { - "id": 197, + "id": 240, "name": "firebase", "kind": 32, "kindString": "Variable", @@ -1891,9 +1891,9 @@ "title": "Variables", "kind": 32, "children": [ - 198, - 196, - 197 + 241, + 239, + 240 ] } ], @@ -1906,14 +1906,14 @@ ] }, { - "id": 219, + "id": 262, "name": "\"@react-native-firebase/iid\"", "kind": 2, "kindString": "Module", "flags": {}, "children": [ { - "id": 220, + "id": 263, "name": "FirebaseNamespaceExport", "kind": 32, "kindString": "Variable", @@ -1942,7 +1942,7 @@ } }, { - "id": 222, + "id": 265, "name": "IidDefaultExport", "kind": 32, "kindString": "Variable", @@ -1960,23 +1960,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStaticsWithApp", - "id": 413, + "id": 456, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 205 + "id": 248 }, { "type": "reference", "name": "Statics", - "id": 204 + "id": 247 } ] } }, { - "id": 221, + "id": 264, "name": "firebase", "kind": 32, "kindString": "Variable", @@ -2011,9 +2011,9 @@ "title": "Variables", "kind": 32, "children": [ - 220, - 222, - 221 + 263, + 265, + 264 ] } ], @@ -2026,14 +2026,14 @@ ] }, { - "id": 230, + "id": 273, "name": "\"@react-native-firebase/mlkit\"", "kind": 2, "kindString": "Module", "flags": {}, "children": [ { - "id": 231, + "id": 274, "name": "FirebaseNamespaceExport", "kind": 32, "kindString": "Variable", @@ -2062,7 +2062,7 @@ } }, { - "id": 233, + "id": 276, "name": "MlkitDefaultExport", "kind": 32, "kindString": "Variable", @@ -2080,23 +2080,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 228 + "id": 271 }, { "type": "reference", "name": "Statics", - "id": 227 + "id": 270 } ] } }, { - "id": 232, + "id": 275, "name": "firebase", "kind": 32, "kindString": "Variable", @@ -2131,9 +2131,9 @@ "title": "Variables", "kind": 32, "children": [ - 231, - 233, - 232 + 274, + 276, + 275 ] } ], @@ -2146,14 +2146,14 @@ ] }, { - "id": 324, + "id": 367, "name": "\"@react-native-firebase/perf\"", "kind": 2, "kindString": "Module", "flags": {}, "children": [ { - "id": 325, + "id": 368, "name": "FirebaseNamespaceExport", "kind": 32, "kindString": "Variable", @@ -2182,7 +2182,7 @@ } }, { - "id": 327, + "id": 370, "name": "PerfDefaultExport", "kind": 32, "kindString": "Variable", @@ -2200,23 +2200,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 310 + "id": 353 }, { "type": "reference", "name": "Statics", - "id": 309 + "id": 352 } ] } }, { - "id": 326, + "id": 369, "name": "firebase", "kind": 32, "kindString": "Variable", @@ -2251,9 +2251,9 @@ "title": "Variables", "kind": 32, "children": [ - 325, - 327, - 326 + 368, + 370, + 369 ] } ], @@ -2266,14 +2266,14 @@ ] }, { - "id": 336, + "id": 379, "name": "\"@react-native-firebase/utils\"", "kind": 2, "kindString": "Module", "flags": {}, "children": [ { - "id": 337, + "id": 380, "name": "FirebaseNamespaceExport", "kind": 32, "kindString": "Variable", @@ -2302,7 +2302,7 @@ } }, { - "id": 339, + "id": 382, "name": "UtilsDefaultExport", "kind": 32, "kindString": "Variable", @@ -2320,23 +2320,23 @@ "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 407, + "id": 450, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 333 + "id": 376 }, { "type": "reference", "name": "Statics", - "id": 332 + "id": 375 } ] } }, { - "id": 338, + "id": 381, "name": "firebase", "kind": 32, "kindString": "Variable", @@ -2371,9 +2371,9 @@ "title": "Variables", "kind": 32, "children": [ - 337, - 339, - 338 + 380, + 382, + 381 ] } ], @@ -3208,7 +3208,7 @@ ] }, { - "id": 388, + "id": 431, "name": "App", "kind": 2, "kindString": "Module", @@ -3225,7 +3225,7 @@ }, "children": [ { - "id": 389, + "id": 432, "name": "FirebaseApp", "kind": 256, "kindString": "Interface", @@ -3234,7 +3234,7 @@ }, "children": [ { - "id": 390, + "id": 433, "name": "name", "kind": 1024, "kindString": "Property", @@ -3257,7 +3257,7 @@ } }, { - "id": 391, + "id": 434, "name": "options", "kind": 1024, "kindString": "Property", @@ -3277,11 +3277,11 @@ "type": { "type": "reference", "name": "FirebaseOptions", - "id": 374 + "id": 417 } }, { - "id": 392, + "id": 435, "name": "delete", "kind": 2048, "kindString": "Method", @@ -3290,7 +3290,7 @@ }, "signatures": [ { - "id": 393, + "id": 436, "name": "delete", "kind": 4096, "kindString": "Call signature", @@ -3324,15 +3324,15 @@ "title": "Properties", "kind": 1024, "children": [ - 390, - 391 + 433, + 434 ] }, { "title": "Methods", "kind": 2048, "children": [ - 392 + 435 ] } ], @@ -3345,7 +3345,7 @@ ] }, { - "id": 394, + "id": 437, "name": "ReactNativeFirebaseNamespace", "kind": 256, "kindString": "Interface", @@ -3354,7 +3354,7 @@ }, "children": [ { - "id": 406, + "id": 449, "name": "SDK_VERSION", "kind": 1024, "kindString": "Property", @@ -3377,7 +3377,7 @@ } }, { - "id": 405, + "id": 448, "name": "apps", "kind": 1024, "kindString": "Property", @@ -3399,12 +3399,12 @@ "elementType": { "type": "reference", "name": "FirebaseApp", - "id": 389 + "id": 432 } } }, { - "id": 402, + "id": 445, "name": "app", "kind": 2048, "kindString": "Method", @@ -3413,7 +3413,7 @@ }, "signatures": [ { - "id": 403, + "id": 446, "name": "app", "kind": 4096, "kindString": "Call signature", @@ -3429,7 +3429,7 @@ }, "parameters": [ { - "id": 404, + "id": 447, "name": "name", "kind": 32768, "kindString": "Parameter", @@ -3457,7 +3457,7 @@ "type": { "type": "reference", "name": "FirebaseApp", - "id": 389 + "id": 432 } } ], @@ -3470,7 +3470,7 @@ ] }, { - "id": 395, + "id": 438, "name": "initializeApp", "kind": 2048, "kindString": "Method", @@ -3479,7 +3479,7 @@ }, "signatures": [ { - "id": 396, + "id": 439, "name": "initializeApp", "kind": 4096, "kindString": "Call signature", @@ -3489,7 +3489,7 @@ }, "parameters": [ { - "id": 397, + "id": 440, "name": "options", "kind": 32768, "kindString": "Parameter", @@ -3500,11 +3500,11 @@ "type": { "type": "reference", "name": "FirebaseOptions", - "id": 374 + "id": 417 } }, { - "id": 398, + "id": 441, "name": "config", "kind": 32768, "kindString": "Parameter", @@ -3517,18 +3517,18 @@ "type": { "type": "reference", "name": "FirebaseAppConfig", - "id": 350 + "id": 393 } } ], "type": { "type": "reference", "name": "FirebaseApp", - "id": 389 + "id": 432 } }, { - "id": 399, + "id": 442, "name": "initializeApp", "kind": 4096, "kindString": "Call signature", @@ -3538,7 +3538,7 @@ }, "parameters": [ { - "id": 400, + "id": 443, "name": "options", "kind": 32768, "kindString": "Parameter", @@ -3549,11 +3549,11 @@ "type": { "type": "reference", "name": "FirebaseOptions", - "id": 374 + "id": 417 } }, { - "id": 401, + "id": 444, "name": "name", "kind": 32768, "kindString": "Parameter", @@ -3581,7 +3581,7 @@ "type": { "type": "reference", "name": "FirebaseApp", - "id": 389 + "id": 432 } } ], @@ -3604,16 +3604,16 @@ "title": "Properties", "kind": 1024, "children": [ - 406, - 405 + 449, + 448 ] }, { "title": "Methods", "kind": 2048, "children": [ - 402, - 395 + 445, + 438 ] } ], @@ -3631,8 +3631,8 @@ "title": "Interfaces", "kind": 256, "children": [ - 389, - 394 + 432, + 437 ] } ], @@ -3763,7 +3763,7 @@ "isExported": true }, "comment": { - "shortText": "Config", + "shortText": "Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your\napp without requiring users to download an app update. When using Remote Config, you create in-app default\nvalues that control the behavior and appearance of your app.", "tags": [ { "tag": "firebase", @@ -3773,36 +3773,143 @@ }, "children": [ { - "id": 72, - "name": "Module", + "id": 84, + "name": "ConfigDefaults", "kind": 256, "kindString": "Interface", - "flags": { - "isExported": true + "flags": {}, + "comment": { + "shortText": "An Interface representing a Config Defaults object." }, - "children": [ + "indexSignature": [ { - "id": 73, - "name": "app", - "kind": 1024, - "kindString": "Property", - "flags": { - "isExported": true + "id": 85, + "name": "__index", + "kind": 8192, + "kindString": "Index signature", + "flags": {}, + "comment": { + "shortText": "An Interface representing a Config Defaults object." }, - "sources": [ + "parameters": [ { - "fileName": "analytics/node_modules/@react-native-firebase/app-types/index.d.ts", - "line": 179, - "character": 5 + "id": 86, + "name": "key", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } } ], "type": { - "type": "reference", - "name": "FirebaseApp" - }, - "inheritedFrom": { - "type": "reference", - "name": "ReactNativeFirebaseModule.app" + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "number" + }, + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "boolean" + } + ] + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 75, + "character": 26 + } + ] + }, + { + "id": 80, + "name": "ConfigSettingsRead", + "kind": 256, + "kindString": "Interface", + "flags": {}, + "comment": { + "shortText": "An Interface representing readable config settings." + }, + "children": [ + { + "id": 82, + "name": "isDeveloperModeEnabled", + "kind": 1024, + "kindString": "Property", + "flags": {}, + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 68, + "character": 26 + } + ], + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + { + "id": 83, + "name": "lastFetchStatus", + "kind": 1024, + "kindString": "Property", + "flags": {}, + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 69, + "character": 19 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "stringLiteral", + "value": "success" + }, + { + "type": "stringLiteral", + "value": "failure" + }, + { + "type": "stringLiteral", + "value": "no_fetch_yet" + }, + { + "type": "stringLiteral", + "value": "throttled" + } + ] + } + }, + { + "id": 81, + "name": "lastFetchTime", + "kind": 1024, + "kindString": "Property", + "flags": {}, + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 67, + "character": 17 + } + ], + "type": { + "type": "intrinsic", + "name": "number" } } ], @@ -3811,79 +3918,216 @@ "title": "Properties", "kind": 1024, "children": [ - 73 + 82, + 83, + 81 ] } ], "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 32, - "character": 25 - } - ], - "extendedTypes": [ - { - "type": "reference", - "name": "ReactNativeFirebaseModule" + "line": 66, + "character": 30 } ] }, { - "id": 71, - "name": "Statics", + "id": 78, + "name": "ConfigSettingsWrite", "kind": 256, "kindString": "Interface", - "flags": { - "isExported": true + "flags": {}, + "comment": { + "shortText": "An Interface representing settable config settings." }, + "children": [ + { + "id": 79, + "name": "isDeveloperModeEnabled", + "kind": 1024, + "kindString": "Property", + "flags": {}, + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 60, + "character": 26 + } + ], + "type": { + "type": "intrinsic", + "name": "boolean" + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 79 + ] + } + ], "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 30, - "character": 26 + "line": 59, + "character": 31 } ] - } - ], - "groups": [ + }, { - "title": "Interfaces", + "id": 72, + "name": "ConfigValue", "kind": 256, + "kindString": "Interface", + "flags": {}, + "comment": { + "shortText": "An Interface representing a Remote Config value" + }, "children": [ - 72, - 71 + { + "id": 73, + "name": "source", + "kind": 1024, + "kindString": "Property", + "flags": {}, + "comment": { + "shortText": "Where the value was retrieved from" + }, + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 41, + "character": 10 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "stringLiteral", + "value": "remote" + }, + { + "type": "stringLiteral", + "value": "default" + }, + { + "type": "stringLiteral", + "value": "static" + } + ] + } + }, + { + "id": 74, + "name": "value", + "kind": 1024, + "kindString": "Property", + "flags": {}, + "comment": { + "shortText": "The value" + }, + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 46, + "character": 9 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + }, + { + "type": "intrinsic", + "name": "boolean" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 73, + 74 + ] + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 37, + "character": 23 + } ] - } - ], - "sources": [ + }, { - "fileName": "config/lib/index.d.ts", - "line": 29, - "character": 23 - } - ] - }, - { - "id": 81, - "name": "Crashlytics", - "kind": 2, - "kindString": "Module", - "flags": { - "isExported": true - }, - "comment": { - "shortText": "Firebase Crashlytics helps you track, prioritize, and fix stability issues that erode app quality, in realtime.\nSpend less time triaging and troubleshooting crashes and more time building app features that delight users.", - "tags": [ - { - "tag": "firebase", - "text": "crashlytics\n" - } - ] - }, - "children": [ + "id": 75, + "name": "ConfigValues", + "kind": 256, + "kindString": "Interface", + "flags": {}, + "comment": { + "shortText": "An Interface representing multiple Config Values" + }, + "indexSignature": [ + { + "id": 76, + "name": "__index", + "kind": 8192, + "kindString": "Index signature", + "flags": {}, + "comment": { + "shortText": "An Interface representing multiple Config Values" + }, + "parameters": [ + { + "id": 77, + "name": "key", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "type": { + "type": "reference", + "name": "ConfigValue", + "id": 72 + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 52, + "character": 24 + } + ] + }, { - "id": 83, + "id": 87, "name": "Module", "kind": 256, "kindString": "Interface", @@ -3892,7 +4136,7 @@ }, "children": [ { - "id": 115, + "id": 116, "name": "app", "kind": 1024, "kindString": "Property", @@ -3916,7 +4160,694 @@ } }, { - "id": 84, + "id": 88, + "name": "activateFetched", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 89, + "name": "activateFetched", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Moves fetched data to the apps active config.\nAlways successfully resolves with a boolean value of whether the fetched config was moved successfully." + }, + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "boolean" + } + ] + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 84, + "character": 19 + } + ] + }, + { + "id": 90, + "name": "fetch", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 91, + "name": "fetch", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Fetches the remote config data from Firebase, defined in the dashboard. If duration is defined (seconds), data will be locally cached for this duration." + }, + "parameters": [ + { + "id": 92, + "name": "cacheExpirationSeconds", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "comment": { + "text": "Duration in seconds to cache the data for. To force a cache use a duration of 0.\n" + }, + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "null" + } + ] + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 91, + "character": 9 + } + ] + }, + { + "id": 93, + "name": "fetchAndActivate", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 94, + "name": "fetchAndActivate", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Fetches the remote config data from Firebase, defined in the dashboard. If duration is defined (seconds), data will be locally cached for this duration.", + "text": "Once fetching is completely this method immediately calls activateFetched on native and returns a boolean value of activation status.\n" + }, + "parameters": [ + { + "id": 95, + "name": "cacheExpirationSeconds", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "comment": { + "text": "Duration in seconds to cache the data for. To force a cache use a duration of 0.\n" + }, + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "boolean" + } + ] + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 100, + "character": 20 + } + ] + }, + { + "id": 96, + "name": "getConfigSettings", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 97, + "name": "getConfigSettings", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Retrieve the configuration settings and status for Remote Config." + }, + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "reference", + "name": "ConfigSettingsRead", + "id": 80 + } + ] + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 105, + "character": 21 + } + ] + }, + { + "id": 98, + "name": "getKeysByPrefix", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 99, + "name": "getKeysByPrefix", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Returns all keys matching the prefix as an array. If no prefix is defined all keys are returned." + }, + "parameters": [ + { + "id": 100, + "name": "prefix", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "comment": { + "text": "\n" + }, + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "array", + "elementType": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 112, + "character": 19 + } + ] + }, + { + "id": 104, + "name": "getValue", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 105, + "name": "getValue", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Gets a ConfigValue by key." + }, + "parameters": [ + { + "id": 106, + "name": "key", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "comment": { + "text": "\n" + }, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "reference", + "name": "ConfigValue", + "id": 72 + } + ] + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 126, + "character": 12 + } + ] + }, + { + "id": 101, + "name": "getValuesByKeysPrefix", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 102, + "name": "getValuesByKeysPrefix", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Returns all config values for the keys matching the prefix provided. In no prefix is provided all values are returned." + }, + "parameters": [ + { + "id": 103, + "name": "prefix", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "comment": { + "text": "\n" + }, + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "reference", + "name": "ConfigValues", + "id": 75 + } + ] + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 119, + "character": 25 + } + ] + }, + { + "id": 107, + "name": "setConfigSettings", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 108, + "name": "setConfigSettings", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Set the Remote Config settings, specifically the `isDeveloperModeEnabled` flag." + }, + "parameters": [ + { + "id": 109, + "name": "configSettings", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "reference", + "name": "ConfigSettingsWrite", + "id": 78 + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "reference", + "name": "ConfigSettingsRead", + "id": 80 + } + ] + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 131, + "character": 21 + } + ] + }, + { + "id": 110, + "name": "setDefaults", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 111, + "name": "setDefaults", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Sets default values for the app to use when accessing values.\nAny data fetched and activated will override any default values. Any values in the defaults but not on Firebase will be untouched." + }, + "parameters": [ + { + "id": 112, + "name": "defaults", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "reference", + "name": "ConfigDefaults", + "id": 84 + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "null" + } + ] + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 138, + "character": 15 + } + ] + }, + { + "id": 113, + "name": "setDefaultsFromResource", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 114, + "name": "setDefaultsFromResource", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Sets the default values from a resource file.\nOn iOS this is a plist file and on Android this is an XML defaultsMap file.\nTODO(ehesp): insert link to guide here somehow?" + }, + "parameters": [ + { + "id": 115, + "name": "resourceName", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "comment": { + "text": "The plist/xml file name with no extension.\n" + }, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "null" + } + ] + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 147, + "character": 27 + } + ] + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 116 + ] + }, + { + "title": "Methods", + "kind": 2048, + "children": [ + 88, + 90, + 93, + 96, + 98, + 104, + 101, + 107, + 110, + 113 + ] + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 79, + "character": 25 + } + ], + "extendedTypes": [ + { + "type": "reference", + "name": "ReactNativeFirebaseModule" + } + ] + }, + { + "id": 71, + "name": "Statics", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 32, + "character": 26 + } + ] + } + ], + "groups": [ + { + "title": "Interfaces", + "kind": 256, + "children": [ + 84, + 80, + 78, + 72, + 75, + 87, + 71 + ] + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 31, + "character": 23 + } + ] + }, + { + "id": 124, + "name": "Crashlytics", + "kind": 2, + "kindString": "Module", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Firebase Crashlytics helps you track, prioritize, and fix stability issues that erode app quality, in realtime.\nSpend less time triaging and troubleshooting crashes and more time building app features that delight users.", + "tags": [ + { + "tag": "firebase", + "text": "crashlytics\n" + } + ] + }, + "children": [ + { + "id": 126, + "name": "Module", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "children": [ + { + "id": 158, + "name": "app", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "analytics/node_modules/@react-native-firebase/app-types/index.d.ts", + "line": 179, + "character": 5 + } + ], + "type": { + "type": "reference", + "name": "FirebaseApp" + }, + "inheritedFrom": { + "type": "reference", + "name": "ReactNativeFirebaseModule.app" + } + }, + { + "id": 127, "name": "isCrashlyticsCollectionEnabled", "kind": 1024, "kindString": "Property", @@ -3939,7 +4870,7 @@ } }, { - "id": 85, + "id": 128, "name": "crash", "kind": 2048, "kindString": "Method", @@ -3948,7 +4879,7 @@ }, "signatures": [ { - "id": 86, + "id": 129, "name": "crash", "kind": 4096, "kindString": "Call signature", @@ -3971,7 +4902,7 @@ ] }, { - "id": 87, + "id": 130, "name": "log", "kind": 2048, "kindString": "Method", @@ -3980,7 +4911,7 @@ }, "signatures": [ { - "id": 88, + "id": 131, "name": "log", "kind": 4096, "kindString": "Call signature", @@ -3990,7 +4921,7 @@ }, "parameters": [ { - "id": 89, + "id": 132, "name": "message", "kind": 32768, "kindString": "Parameter", @@ -4019,7 +4950,7 @@ ] }, { - "id": 90, + "id": 133, "name": "recordError", "kind": 2048, "kindString": "Method", @@ -4028,18 +4959,18 @@ }, "signatures": [ { - "id": 91, + "id": 134, "name": "recordError", "kind": 4096, "kindString": "Call signature", "flags": {}, "comment": { "shortText": "Record a JavaScript Error.", - "text": "The JavaScript stack trace is converted into a mock native exception before submission.\n" + "text": "The JavaScript stack trace is converted into a mock native iOS or Android exception before submission.\n" }, "parameters": [ { - "id": 92, + "id": 135, "name": "error", "kind": 32768, "kindString": "Parameter", @@ -4068,7 +4999,7 @@ ] }, { - "id": 102, + "id": 145, "name": "setAttribute", "kind": 2048, "kindString": "Method", @@ -4077,7 +5008,7 @@ }, "signatures": [ { - "id": 103, + "id": 146, "name": "setAttribute", "kind": 4096, "kindString": "Call signature", @@ -4087,7 +5018,7 @@ }, "parameters": [ { - "id": 104, + "id": 147, "name": "name", "kind": 32768, "kindString": "Parameter", @@ -4099,7 +5030,7 @@ } }, { - "id": 105, + "id": 148, "name": "value", "kind": 32768, "kindString": "Parameter", @@ -4134,7 +5065,7 @@ ] }, { - "id": 106, + "id": 149, "name": "setAttributes", "kind": 2048, "kindString": "Method", @@ -4143,7 +5074,7 @@ }, "signatures": [ { - "id": 107, + "id": 150, "name": "setAttributes", "kind": 4096, "kindString": "Call signature", @@ -4153,7 +5084,7 @@ }, "parameters": [ { - "id": 108, + "id": 151, "name": "attributes", "kind": 32768, "kindString": "Parameter", @@ -4164,21 +5095,21 @@ "type": { "type": "reflection", "declaration": { - "id": 109, + "id": 152, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "indexSignature": [ { - "id": 110, + "id": 153, "name": "__index", "kind": 8192, "kindString": "Index signature", "flags": {}, "parameters": [ { - "id": 111, + "id": 154, "name": "key", "kind": 32768, "kindString": "Parameter", @@ -4227,7 +5158,7 @@ ] }, { - "id": 112, + "id": 155, "name": "setCrashlyticsCollectionEnabled", "kind": 2048, "kindString": "Method", @@ -4236,7 +5167,7 @@ }, "signatures": [ { - "id": 113, + "id": 156, "name": "setCrashlyticsCollectionEnabled", "kind": 4096, "kindString": "Call signature", @@ -4247,7 +5178,7 @@ }, "parameters": [ { - "id": 114, + "id": 157, "name": "enabled", "kind": 32768, "kindString": "Parameter", @@ -4282,7 +5213,7 @@ ] }, { - "id": 99, + "id": 142, "name": "setUserEmail", "kind": 2048, "kindString": "Method", @@ -4291,7 +5222,7 @@ }, "signatures": [ { - "id": 100, + "id": 143, "name": "setUserEmail", "kind": 4096, "kindString": "Call signature", @@ -4302,7 +5233,7 @@ }, "parameters": [ { - "id": 101, + "id": 144, "name": "userEmail", "kind": 32768, "kindString": "Parameter", @@ -4337,7 +5268,7 @@ ] }, { - "id": 93, + "id": 136, "name": "setUserId", "kind": 2048, "kindString": "Method", @@ -4346,7 +5277,7 @@ }, "signatures": [ { - "id": 94, + "id": 137, "name": "setUserId", "kind": 4096, "kindString": "Call signature", @@ -4357,7 +5288,7 @@ }, "parameters": [ { - "id": 95, + "id": 138, "name": "userId", "kind": 32768, "kindString": "Parameter", @@ -4392,7 +5323,7 @@ ] }, { - "id": 96, + "id": 139, "name": "setUserName", "kind": 2048, "kindString": "Method", @@ -4401,7 +5332,7 @@ }, "signatures": [ { - "id": 97, + "id": 140, "name": "setUserName", "kind": 4096, "kindString": "Call signature", @@ -4412,7 +5343,7 @@ }, "parameters": [ { - "id": 98, + "id": 141, "name": "userName", "kind": 32768, "kindString": "Parameter", @@ -4452,23 +5383,23 @@ "title": "Properties", "kind": 1024, "children": [ - 115, - 84 + 158, + 127 ] }, { "title": "Methods", "kind": 2048, "children": [ - 85, - 87, - 90, - 102, - 106, - 112, - 99, - 93, - 96 + 128, + 130, + 133, + 145, + 149, + 155, + 142, + 136, + 139 ] } ], @@ -4487,7 +5418,7 @@ ] }, { - "id": 82, + "id": 125, "name": "Statics", "kind": 256, "kindString": "Interface", @@ -4508,8 +5439,8 @@ "title": "Interfaces", "kind": 256, "children": [ - 83, - 82 + 126, + 125 ] } ], @@ -4522,7 +5453,7 @@ ] }, { - "id": 123, + "id": 166, "name": "Fiam", "kind": 2, "kindString": "Module", @@ -4540,7 +5471,7 @@ }, "children": [ { - "id": 125, + "id": 168, "name": "Module", "kind": 256, "kindString": "Interface", @@ -4549,7 +5480,7 @@ }, "children": [ { - "id": 134, + "id": 177, "name": "app", "kind": 1024, "kindString": "Property", @@ -4573,7 +5504,7 @@ } }, { - "id": 130, + "id": 173, "name": "isAutomaticDataCollectionEnabled", "kind": 1024, "kindString": "Property", @@ -4596,7 +5527,7 @@ } }, { - "id": 126, + "id": 169, "name": "isMessagesDisplaySuppressed", "kind": 1024, "kindString": "Property", @@ -4619,7 +5550,7 @@ } }, { - "id": 131, + "id": 174, "name": "setAutomaticDataCollectionEnabled", "kind": 2048, "kindString": "Method", @@ -4628,7 +5559,7 @@ }, "signatures": [ { - "id": 132, + "id": 175, "name": "setAutomaticDataCollectionEnabled", "kind": 4096, "kindString": "Call signature", @@ -4639,7 +5570,7 @@ }, "parameters": [ { - "id": 133, + "id": 176, "name": "enabled", "kind": 32768, "kindString": "Parameter", @@ -4674,7 +5605,7 @@ ] }, { - "id": 127, + "id": 170, "name": "setMessagesDisplaySuppressed", "kind": 2048, "kindString": "Method", @@ -4683,7 +5614,7 @@ }, "signatures": [ { - "id": 128, + "id": 171, "name": "setMessagesDisplaySuppressed", "kind": 4096, "kindString": "Call signature", @@ -4694,7 +5625,7 @@ }, "parameters": [ { - "id": 129, + "id": 172, "name": "enabled", "kind": 32768, "kindString": "Parameter", @@ -4734,17 +5665,17 @@ "title": "Properties", "kind": 1024, "children": [ - 134, - 130, - 126 + 177, + 173, + 169 ] }, { "title": "Methods", "kind": 2048, "children": [ - 131, - 127 + 174, + 170 ] } ], @@ -4763,7 +5694,7 @@ ] }, { - "id": 124, + "id": 167, "name": "Statics", "kind": 256, "kindString": "Interface", @@ -4784,8 +5715,8 @@ "title": "Interfaces", "kind": 256, "children": [ - 125, - 124 + 168, + 167 ] } ], @@ -4798,7 +5729,7 @@ ] }, { - "id": 142, + "id": 185, "name": "Firestore", "kind": 2, "kindString": "Module", @@ -4816,7 +5747,7 @@ }, "children": [ { - "id": 144, + "id": 187, "name": "Module", "kind": 256, "kindString": "Interface", @@ -4825,7 +5756,7 @@ }, "children": [ { - "id": 145, + "id": 188, "name": "app", "kind": 1024, "kindString": "Property", @@ -4854,7 +5785,7 @@ "title": "Properties", "kind": 1024, "children": [ - 145 + 188 ] } ], @@ -4873,7 +5804,7 @@ ] }, { - "id": 143, + "id": 186, "name": "Statics", "kind": 256, "kindString": "Interface", @@ -4894,8 +5825,8 @@ "title": "Interfaces", "kind": 256, "children": [ - 144, - 143 + 187, + 186 ] } ], @@ -4908,7 +5839,7 @@ ] }, { - "id": 153, + "id": 196, "name": "Functions", "kind": 2, "kindString": "Module", @@ -4926,7 +5857,7 @@ }, "children": [ { - "id": 156, + "id": 199, "name": "HttpsCallable", "kind": 256, "kindString": "Interface", @@ -4938,7 +5869,7 @@ }, "signatures": [ { - "id": 157, + "id": 200, "name": "__call", "kind": 4096, "kindString": "Call signature", @@ -4948,7 +5879,7 @@ }, "parameters": [ { - "id": 158, + "id": 201, "name": "data", "kind": 32768, "kindString": "Parameter", @@ -4968,7 +5899,7 @@ { "type": "reference", "name": "HttpsCallableResult", - "id": 154 + "id": 197 } ] } @@ -4983,7 +5914,7 @@ ] }, { - "id": 154, + "id": 197, "name": "HttpsCallableResult", "kind": 256, "kindString": "Interface", @@ -4995,7 +5926,7 @@ }, "children": [ { - "id": 155, + "id": 198, "name": "data", "kind": 1024, "kindString": "Property", @@ -5020,7 +5951,7 @@ "title": "Properties", "kind": 1024, "children": [ - 155 + 198 ] } ], @@ -5033,7 +5964,7 @@ ] }, { - "id": 159, + "id": 202, "name": "HttpsError", "kind": 256, "kindString": "Interface", @@ -5042,7 +5973,7 @@ }, "children": [ { - "id": 165, + "id": 208, "name": "Error", "kind": 1024, "kindString": "Property", @@ -5062,7 +5993,7 @@ } }, { - "id": 160, + "id": 203, "name": "code", "kind": 1024, "kindString": "Property", @@ -5082,11 +6013,11 @@ "type": { "type": "reference", "name": "FunctionsErrorCode", - "id": 194 + "id": 237 } }, { - "id": 161, + "id": 204, "name": "details", "kind": 1024, "kindString": "Property", @@ -5110,7 +6041,7 @@ } }, { - "id": 163, + "id": 206, "name": "message", "kind": 1024, "kindString": "Property", @@ -5134,7 +6065,7 @@ } }, { - "id": 162, + "id": 205, "name": "name", "kind": 1024, "kindString": "Property", @@ -5158,7 +6089,7 @@ } }, { - "id": 164, + "id": 207, "name": "stack", "kind": 1024, "kindString": "Property", @@ -5201,12 +6132,12 @@ "title": "Properties", "kind": 1024, "children": [ - 165, - 160, - 161, - 163, - 162, - 164 + 208, + 203, + 204, + 206, + 205, + 207 ] } ], @@ -5225,7 +6156,7 @@ ] }, { - "id": 166, + "id": 209, "name": "HttpsErrorCode", "kind": 256, "kindString": "Interface", @@ -5234,7 +6165,7 @@ }, "children": [ { - "id": 178, + "id": 221, "name": "ABORTED", "kind": 1024, "kindString": "Property", @@ -5254,7 +6185,7 @@ } }, { - "id": 173, + "id": 216, "name": "ALREADY_EXISTS", "kind": 1024, "kindString": "Property", @@ -5274,7 +6205,7 @@ } }, { - "id": 168, + "id": 211, "name": "CANCELLED", "kind": 1024, "kindString": "Property", @@ -5294,7 +6225,7 @@ } }, { - "id": 183, + "id": 226, "name": "DATA_LOSS", "kind": 1024, "kindString": "Property", @@ -5314,7 +6245,7 @@ } }, { - "id": 171, + "id": 214, "name": "DEADLINE_EXCEEDED", "kind": 1024, "kindString": "Property", @@ -5334,7 +6265,7 @@ } }, { - "id": 177, + "id": 220, "name": "FAILED_PRECONDITION", "kind": 1024, "kindString": "Property", @@ -5354,7 +6285,7 @@ } }, { - "id": 181, + "id": 224, "name": "INTERNAL", "kind": 1024, "kindString": "Property", @@ -5374,7 +6305,7 @@ } }, { - "id": 170, + "id": 213, "name": "INVALID_ARGUMENT", "kind": 1024, "kindString": "Property", @@ -5394,7 +6325,7 @@ } }, { - "id": 172, + "id": 215, "name": "NOT_FOUND", "kind": 1024, "kindString": "Property", @@ -5414,7 +6345,7 @@ } }, { - "id": 167, + "id": 210, "name": "OK", "kind": 1024, "kindString": "Property", @@ -5434,7 +6365,7 @@ } }, { - "id": 179, + "id": 222, "name": "OUT_OF_RANGE", "kind": 1024, "kindString": "Property", @@ -5454,7 +6385,7 @@ } }, { - "id": 174, + "id": 217, "name": "PERMISSION_DENIED", "kind": 1024, "kindString": "Property", @@ -5474,7 +6405,7 @@ } }, { - "id": 176, + "id": 219, "name": "RESOURCE_EXHAUSTED", "kind": 1024, "kindString": "Property", @@ -5494,7 +6425,7 @@ } }, { - "id": 175, + "id": 218, "name": "UNAUTHENTICATED", "kind": 1024, "kindString": "Property", @@ -5514,7 +6445,7 @@ } }, { - "id": 182, + "id": 225, "name": "UNAVAILABLE", "kind": 1024, "kindString": "Property", @@ -5534,7 +6465,7 @@ } }, { - "id": 180, + "id": 223, "name": "UNIMPLEMENTED", "kind": 1024, "kindString": "Property", @@ -5554,7 +6485,7 @@ } }, { - "id": 169, + "id": 212, "name": "UNKNOWN", "kind": 1024, "kindString": "Property", @@ -5579,23 +6510,23 @@ "title": "Properties", "kind": 1024, "children": [ - 178, - 173, - 168, - 183, - 171, - 177, - 181, - 170, - 172, - 167, - 179, - 174, - 176, - 175, - 182, - 180, - 169 + 221, + 216, + 211, + 226, + 214, + 220, + 224, + 213, + 215, + 210, + 222, + 217, + 219, + 218, + 225, + 223, + 212 ] } ], @@ -5608,7 +6539,7 @@ ] }, { - "id": 186, + "id": 229, "name": "Module", "kind": 256, "kindString": "Interface", @@ -5620,7 +6551,7 @@ }, "children": [ { - "id": 193, + "id": 236, "name": "app", "kind": 1024, "kindString": "Property", @@ -5644,7 +6575,7 @@ } }, { - "id": 187, + "id": 230, "name": "httpsCallable", "kind": 2048, "kindString": "Method", @@ -5653,7 +6584,7 @@ }, "signatures": [ { - "id": 188, + "id": 231, "name": "httpsCallable", "kind": 4096, "kindString": "Call signature", @@ -5664,7 +6595,7 @@ }, "parameters": [ { - "id": 189, + "id": 232, "name": "name", "kind": 32768, "kindString": "Parameter", @@ -5681,7 +6612,7 @@ "type": { "type": "reference", "name": "HttpsCallable", - "id": 156 + "id": 199 } } ], @@ -5694,7 +6625,7 @@ ] }, { - "id": 190, + "id": 233, "name": "useFunctionsEmulator", "kind": 2048, "kindString": "Method", @@ -5703,7 +6634,7 @@ }, "signatures": [ { - "id": 191, + "id": 234, "name": "useFunctionsEmulator", "kind": 4096, "kindString": "Call signature", @@ -5714,7 +6645,7 @@ }, "parameters": [ { - "id": 192, + "id": 235, "name": "origin", "kind": 32768, "kindString": "Parameter", @@ -5748,15 +6679,15 @@ "title": "Properties", "kind": 1024, "children": [ - 193 + 236 ] }, { "title": "Methods", "kind": 2048, "children": [ - 187, - 190 + 230, + 233 ] } ], @@ -5775,7 +6706,7 @@ ] }, { - "id": 184, + "id": 227, "name": "Statics", "kind": 256, "kindString": "Interface", @@ -5787,7 +6718,7 @@ }, "children": [ { - "id": 185, + "id": 228, "name": "HttpsErrorCode", "kind": 1024, "kindString": "Property", @@ -5814,7 +6745,7 @@ { "type": "reference", "name": "HttpsErrorCode", - "id": 166 + "id": 209 } ] } @@ -5825,7 +6756,7 @@ "title": "Properties", "kind": 1024, "children": [ - 185 + 228 ] } ], @@ -5838,7 +6769,7 @@ ] }, { - "id": 194, + "id": 237, "name": "FunctionsErrorCode", "kind": 4194304, "kindString": "Type alias", @@ -5936,19 +6867,19 @@ "title": "Interfaces", "kind": 256, "children": [ - 156, - 154, - 159, - 166, - 186, - 184 + 199, + 197, + 202, + 209, + 229, + 227 ] }, { "title": "Type aliases", "kind": 4194304, "children": [ - 194 + 237 ] } ], @@ -5961,7 +6892,7 @@ ] }, { - "id": 203, + "id": 246, "name": "Iid", "kind": 2, "kindString": "Module", @@ -5980,7 +6911,7 @@ }, "children": [ { - "id": 205, + "id": 248, "name": "Module", "kind": 256, "kindString": "Interface", @@ -5989,7 +6920,7 @@ }, "children": [ { - "id": 218, + "id": 261, "name": "app", "kind": 1024, "kindString": "Property", @@ -6013,7 +6944,7 @@ } }, { - "id": 208, + "id": 251, "name": "delete", "kind": 2048, "kindString": "Method", @@ -6022,7 +6953,7 @@ }, "signatures": [ { - "id": 209, + "id": 252, "name": "delete", "kind": 4096, "kindString": "Call signature", @@ -6052,7 +6983,7 @@ ] }, { - "id": 214, + "id": 257, "name": "deleteToken", "kind": 2048, "kindString": "Method", @@ -6061,7 +6992,7 @@ }, "signatures": [ { - "id": 215, + "id": 258, "name": "deleteToken", "kind": 4096, "kindString": "Call signature", @@ -6071,7 +7002,7 @@ }, "parameters": [ { - "id": 216, + "id": 259, "name": "authorizedEntity", "kind": 32768, "kindString": "Parameter", @@ -6096,7 +7027,7 @@ } }, { - "id": 217, + "id": 260, "name": "scope", "kind": 32768, "kindString": "Parameter", @@ -6142,7 +7073,7 @@ ] }, { - "id": 206, + "id": 249, "name": "get", "kind": 2048, "kindString": "Method", @@ -6151,7 +7082,7 @@ }, "signatures": [ { - "id": 207, + "id": 250, "name": "get", "kind": 4096, "kindString": "Call signature", @@ -6181,7 +7112,7 @@ ] }, { - "id": 210, + "id": 253, "name": "getToken", "kind": 2048, "kindString": "Method", @@ -6190,7 +7121,7 @@ }, "signatures": [ { - "id": 211, + "id": 254, "name": "getToken", "kind": 4096, "kindString": "Call signature", @@ -6200,7 +7131,7 @@ }, "parameters": [ { - "id": 212, + "id": 255, "name": "authorizedEntity", "kind": 32768, "kindString": "Parameter", @@ -6225,7 +7156,7 @@ } }, { - "id": 213, + "id": 256, "name": "scope", "kind": 32768, "kindString": "Parameter", @@ -6276,17 +7207,17 @@ "title": "Properties", "kind": 1024, "children": [ - 218 + 261 ] }, { "title": "Methods", "kind": 2048, "children": [ - 208, - 214, - 206, - 210 + 251, + 257, + 249, + 253 ] } ], @@ -6305,7 +7236,7 @@ ] }, { - "id": 204, + "id": 247, "name": "Statics", "kind": 256, "kindString": "Interface", @@ -6326,8 +7257,8 @@ "title": "Interfaces", "kind": 256, "children": [ - 205, - 204 + 248, + 247 ] } ], @@ -6340,7 +7271,7 @@ ] }, { - "id": 226, + "id": 269, "name": "Mlkit", "kind": 2, "kindString": "Module", @@ -6358,7 +7289,7 @@ }, "children": [ { - "id": 228, + "id": 271, "name": "Module", "kind": 256, "kindString": "Interface", @@ -6367,7 +7298,7 @@ }, "children": [ { - "id": 229, + "id": 272, "name": "app", "kind": 1024, "kindString": "Property", @@ -6396,7 +7327,7 @@ "title": "Properties", "kind": 1024, "children": [ - 229 + 272 ] } ], @@ -6415,7 +7346,7 @@ ] }, { - "id": 227, + "id": 270, "name": "Statics", "kind": 256, "kindString": "Interface", @@ -6436,8 +7367,8 @@ "title": "Interfaces", "kind": 256, "children": [ - 228, - 227 + 271, + 270 ] } ], @@ -6450,7 +7381,7 @@ ] }, { - "id": 237, + "id": 280, "name": "Perf", "kind": 2, "kindString": "Module", @@ -6468,7 +7399,7 @@ }, "children": [ { - "id": 277, + "id": 320, "name": "HttpMetric", "kind": 256, "kindString": "Interface", @@ -6480,7 +7411,7 @@ }, "children": [ { - "id": 278, + "id": 321, "name": "getAttribute", "kind": 2048, "kindString": "Method", @@ -6489,7 +7420,7 @@ }, "signatures": [ { - "id": 279, + "id": 322, "name": "getAttribute", "kind": 4096, "kindString": "Call signature", @@ -6499,7 +7430,7 @@ }, "parameters": [ { - "id": 280, + "id": 323, "name": "attribute", "kind": 32768, "kindString": "Parameter", @@ -6537,7 +7468,7 @@ ] }, { - "id": 281, + "id": 324, "name": "getAttributes", "kind": 2048, "kindString": "Method", @@ -6546,7 +7477,7 @@ }, "signatures": [ { - "id": 282, + "id": 325, "name": "getAttributes", "kind": 4096, "kindString": "Call signature", @@ -6557,21 +7488,21 @@ "type": { "type": "reflection", "declaration": { - "id": 283, + "id": 326, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "indexSignature": [ { - "id": 284, + "id": 327, "name": "__index", "kind": 8192, "kindString": "Index signature", "flags": {}, "parameters": [ { - "id": 285, + "id": 328, "name": "key", "kind": 32768, "kindString": "Parameter", @@ -6608,7 +7539,7 @@ ] }, { - "id": 286, + "id": 329, "name": "putAttribute", "kind": 2048, "kindString": "Method", @@ -6617,7 +7548,7 @@ }, "signatures": [ { - "id": 287, + "id": 330, "name": "putAttribute", "kind": 4096, "kindString": "Call signature", @@ -6627,7 +7558,7 @@ }, "parameters": [ { - "id": 288, + "id": 331, "name": "attribute", "kind": 32768, "kindString": "Parameter", @@ -6641,7 +7572,7 @@ } }, { - "id": 289, + "id": 332, "name": "value", "kind": 32768, "kindString": "Parameter", @@ -6670,7 +7601,7 @@ ] }, { - "id": 290, + "id": 333, "name": "removeAttribute", "kind": 2048, "kindString": "Method", @@ -6679,7 +7610,7 @@ }, "signatures": [ { - "id": 291, + "id": 334, "name": "removeAttribute", "kind": 4096, "kindString": "Call signature", @@ -6689,7 +7620,7 @@ }, "parameters": [ { - "id": 292, + "id": 335, "name": "attribute", "kind": 32768, "kindString": "Parameter", @@ -6718,7 +7649,7 @@ ] }, { - "id": 293, + "id": 336, "name": "setHttpResponseCode", "kind": 2048, "kindString": "Method", @@ -6727,7 +7658,7 @@ }, "signatures": [ { - "id": 294, + "id": 337, "name": "setHttpResponseCode", "kind": 4096, "kindString": "Call signature", @@ -6743,7 +7674,7 @@ }, "parameters": [ { - "id": 295, + "id": 338, "name": "code", "kind": 32768, "kindString": "Parameter", @@ -6781,7 +7712,7 @@ ] }, { - "id": 296, + "id": 339, "name": "setRequestPayloadSize", "kind": 2048, "kindString": "Method", @@ -6790,7 +7721,7 @@ }, "signatures": [ { - "id": 297, + "id": 340, "name": "setRequestPayloadSize", "kind": 4096, "kindString": "Call signature", @@ -6800,7 +7731,7 @@ }, "parameters": [ { - "id": 298, + "id": 341, "name": "bytes", "kind": 32768, "kindString": "Parameter", @@ -6838,7 +7769,7 @@ ] }, { - "id": 302, + "id": 345, "name": "setResponseContentType", "kind": 2048, "kindString": "Method", @@ -6847,7 +7778,7 @@ }, "signatures": [ { - "id": 303, + "id": 346, "name": "setResponseContentType", "kind": 4096, "kindString": "Call signature", @@ -6857,7 +7788,7 @@ }, "parameters": [ { - "id": 304, + "id": 347, "name": "contentType", "kind": 32768, "kindString": "Parameter", @@ -6895,7 +7826,7 @@ ] }, { - "id": 299, + "id": 342, "name": "setResponsePayloadSize", "kind": 2048, "kindString": "Method", @@ -6904,7 +7835,7 @@ }, "signatures": [ { - "id": 300, + "id": 343, "name": "setResponsePayloadSize", "kind": 4096, "kindString": "Call signature", @@ -6914,7 +7845,7 @@ }, "parameters": [ { - "id": 301, + "id": 344, "name": "bytes", "kind": 32768, "kindString": "Parameter", @@ -6952,7 +7883,7 @@ ] }, { - "id": 305, + "id": 348, "name": "start", "kind": 2048, "kindString": "Method", @@ -6961,7 +7892,7 @@ }, "signatures": [ { - "id": 306, + "id": 349, "name": "start", "kind": 4096, "kindString": "Call signature", @@ -6990,7 +7921,7 @@ ] }, { - "id": 307, + "id": 350, "name": "stop", "kind": 2048, "kindString": "Method", @@ -6999,7 +7930,7 @@ }, "signatures": [ { - "id": 308, + "id": 351, "name": "stop", "kind": 4096, "kindString": "Call signature", @@ -7033,16 +7964,16 @@ "title": "Methods", "kind": 2048, "children": [ - 278, - 281, - 286, - 290, - 293, - 296, - 302, - 299, - 305, - 307 + 321, + 324, + 329, + 333, + 336, + 339, + 345, + 342, + 348, + 350 ] } ], @@ -7055,7 +7986,7 @@ ] }, { - "id": 310, + "id": 353, "name": "Module", "kind": 256, "kindString": "Interface", @@ -7064,7 +7995,7 @@ }, "children": [ { - "id": 322, + "id": 365, "name": "app", "kind": 1024, "kindString": "Property", @@ -7088,7 +8019,7 @@ } }, { - "id": 311, + "id": 354, "name": "isPerformanceCollectionEnabled", "kind": 1024, "kindString": "Property", @@ -7111,7 +8042,7 @@ } }, { - "id": 318, + "id": 361, "name": "newHttpMetric", "kind": 2048, "kindString": "Method", @@ -7120,7 +8051,7 @@ }, "signatures": [ { - "id": 319, + "id": 362, "name": "newHttpMetric", "kind": 4096, "kindString": "Call signature", @@ -7130,7 +8061,7 @@ }, "parameters": [ { - "id": 320, + "id": 363, "name": "url", "kind": 32768, "kindString": "Parameter", @@ -7144,7 +8075,7 @@ } }, { - "id": 321, + "id": 364, "name": "httpMethod", "kind": 32768, "kindString": "Parameter", @@ -7155,14 +8086,14 @@ "type": { "type": "reference", "name": "HttpMethod", - "id": 323 + "id": 366 } } ], "type": { "type": "reference", "name": "HttpMetric", - "id": 277 + "id": 320 } } ], @@ -7175,7 +8106,7 @@ ] }, { - "id": 315, + "id": 358, "name": "newTrace", "kind": 2048, "kindString": "Method", @@ -7184,7 +8115,7 @@ }, "signatures": [ { - "id": 316, + "id": 359, "name": "newTrace", "kind": 4096, "kindString": "Call signature", @@ -7194,7 +8125,7 @@ }, "parameters": [ { - "id": 317, + "id": 360, "name": "identifier", "kind": 32768, "kindString": "Parameter", @@ -7211,7 +8142,7 @@ "type": { "type": "reference", "name": "Trace", - "id": 238 + "id": 281 } } ], @@ -7224,7 +8155,7 @@ ] }, { - "id": 312, + "id": 355, "name": "setPerformanceCollectionEnabled", "kind": 2048, "kindString": "Method", @@ -7233,7 +8164,7 @@ }, "signatures": [ { - "id": 313, + "id": 356, "name": "setPerformanceCollectionEnabled", "kind": 4096, "kindString": "Call signature", @@ -7243,7 +8174,7 @@ }, "parameters": [ { - "id": 314, + "id": 357, "name": "enabled", "kind": 32768, "kindString": "Parameter", @@ -7283,17 +8214,17 @@ "title": "Properties", "kind": 1024, "children": [ - 322, - 311 + 365, + 354 ] }, { "title": "Methods", "kind": 2048, "children": [ - 318, - 315, - 312 + 361, + 358, + 355 ] } ], @@ -7312,7 +8243,7 @@ ] }, { - "id": 309, + "id": 352, "name": "Statics", "kind": 256, "kindString": "Interface", @@ -7328,7 +8259,7 @@ ] }, { - "id": 238, + "id": 281, "name": "Trace", "kind": 256, "kindString": "Interface", @@ -7340,7 +8271,7 @@ }, "children": [ { - "id": 239, + "id": 282, "name": "getAttribute", "kind": 2048, "kindString": "Method", @@ -7349,7 +8280,7 @@ }, "signatures": [ { - "id": 240, + "id": 283, "name": "getAttribute", "kind": 4096, "kindString": "Call signature", @@ -7359,7 +8290,7 @@ }, "parameters": [ { - "id": 241, + "id": 284, "name": "attribute", "kind": 32768, "kindString": "Parameter", @@ -7397,7 +8328,7 @@ ] }, { - "id": 242, + "id": 285, "name": "getAttributes", "kind": 2048, "kindString": "Method", @@ -7406,7 +8337,7 @@ }, "signatures": [ { - "id": 243, + "id": 286, "name": "getAttributes", "kind": 4096, "kindString": "Call signature", @@ -7417,21 +8348,21 @@ "type": { "type": "reflection", "declaration": { - "id": 244, + "id": 287, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "indexSignature": [ { - "id": 245, + "id": 288, "name": "__index", "kind": 8192, "kindString": "Index signature", "flags": {}, "parameters": [ { - "id": 246, + "id": 289, "name": "key", "kind": 32768, "kindString": "Parameter", @@ -7468,7 +8399,7 @@ ] }, { - "id": 254, + "id": 297, "name": "getMetric", "kind": 2048, "kindString": "Method", @@ -7477,7 +8408,7 @@ }, "signatures": [ { - "id": 255, + "id": 298, "name": "getMetric", "kind": 4096, "kindString": "Call signature", @@ -7487,7 +8418,7 @@ }, "parameters": [ { - "id": 256, + "id": 299, "name": "metricName", "kind": 32768, "kindString": "Parameter", @@ -7516,7 +8447,7 @@ ] }, { - "id": 257, + "id": 300, "name": "getMetrics", "kind": 2048, "kindString": "Method", @@ -7525,7 +8456,7 @@ }, "signatures": [ { - "id": 258, + "id": 301, "name": "getMetrics", "kind": 4096, "kindString": "Call signature", @@ -7536,21 +8467,21 @@ "type": { "type": "reflection", "declaration": { - "id": 259, + "id": 302, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "indexSignature": [ { - "id": 260, + "id": 303, "name": "__index", "kind": 8192, "kindString": "Index signature", "flags": {}, "parameters": [ { - "id": 261, + "id": 304, "name": "key", "kind": 32768, "kindString": "Parameter", @@ -7587,7 +8518,7 @@ ] }, { - "id": 266, + "id": 309, "name": "incrementMetric", "kind": 2048, "kindString": "Method", @@ -7596,7 +8527,7 @@ }, "signatures": [ { - "id": 267, + "id": 310, "name": "incrementMetric", "kind": 4096, "kindString": "Call signature", @@ -7607,7 +8538,7 @@ }, "parameters": [ { - "id": 268, + "id": 311, "name": "metricName", "kind": 32768, "kindString": "Parameter", @@ -7621,7 +8552,7 @@ } }, { - "id": 269, + "id": 312, "name": "incrementBy", "kind": 32768, "kindString": "Parameter", @@ -7650,7 +8581,7 @@ ] }, { - "id": 247, + "id": 290, "name": "putAttribute", "kind": 2048, "kindString": "Method", @@ -7659,7 +8590,7 @@ }, "signatures": [ { - "id": 248, + "id": 291, "name": "putAttribute", "kind": 4096, "kindString": "Call signature", @@ -7669,7 +8600,7 @@ }, "parameters": [ { - "id": 249, + "id": 292, "name": "attribute", "kind": 32768, "kindString": "Parameter", @@ -7683,7 +8614,7 @@ } }, { - "id": 250, + "id": 293, "name": "value", "kind": 32768, "kindString": "Parameter", @@ -7712,7 +8643,7 @@ ] }, { - "id": 262, + "id": 305, "name": "putMetric", "kind": 2048, "kindString": "Method", @@ -7721,7 +8652,7 @@ }, "signatures": [ { - "id": 263, + "id": 306, "name": "putMetric", "kind": 4096, "kindString": "Call signature", @@ -7732,7 +8663,7 @@ }, "parameters": [ { - "id": 264, + "id": 307, "name": "metricName", "kind": 32768, "kindString": "Parameter", @@ -7746,7 +8677,7 @@ } }, { - "id": 265, + "id": 308, "name": "value", "kind": 32768, "kindString": "Parameter", @@ -7775,7 +8706,7 @@ ] }, { - "id": 251, + "id": 294, "name": "removeAttribute", "kind": 2048, "kindString": "Method", @@ -7784,7 +8715,7 @@ }, "signatures": [ { - "id": 252, + "id": 295, "name": "removeAttribute", "kind": 4096, "kindString": "Call signature", @@ -7794,7 +8725,7 @@ }, "parameters": [ { - "id": 253, + "id": 296, "name": "attribute", "kind": 32768, "kindString": "Parameter", @@ -7823,7 +8754,7 @@ ] }, { - "id": 270, + "id": 313, "name": "removeMetric", "kind": 2048, "kindString": "Method", @@ -7832,7 +8763,7 @@ }, "signatures": [ { - "id": 271, + "id": 314, "name": "removeMetric", "kind": 4096, "kindString": "Call signature", @@ -7842,7 +8773,7 @@ }, "parameters": [ { - "id": 272, + "id": 315, "name": "metricName", "kind": 32768, "kindString": "Parameter", @@ -7871,7 +8802,7 @@ ] }, { - "id": 273, + "id": 316, "name": "start", "kind": 2048, "kindString": "Method", @@ -7880,7 +8811,7 @@ }, "signatures": [ { - "id": 274, + "id": 317, "name": "start", "kind": 4096, "kindString": "Call signature", @@ -7909,7 +8840,7 @@ ] }, { - "id": 275, + "id": 318, "name": "stop", "kind": 2048, "kindString": "Method", @@ -7918,7 +8849,7 @@ }, "signatures": [ { - "id": 276, + "id": 319, "name": "stop", "kind": 4096, "kindString": "Call signature", @@ -7952,17 +8883,17 @@ "title": "Methods", "kind": 2048, "children": [ - 239, - 242, - 254, - 257, - 266, - 247, - 262, - 251, - 270, - 273, - 275 + 282, + 285, + 297, + 300, + 309, + 290, + 305, + 294, + 313, + 316, + 318 ] } ], @@ -7975,7 +8906,7 @@ ] }, { - "id": 323, + "id": 366, "name": "HttpMethod", "kind": 4194304, "kindString": "Type alias", @@ -8037,17 +8968,17 @@ "title": "Interfaces", "kind": 256, "children": [ - 277, - 310, - 309, - 238 + 320, + 353, + 352, + 281 ] }, { "title": "Type aliases", "kind": 4194304, "children": [ - 323 + 366 ] } ], @@ -8060,7 +8991,7 @@ ] }, { - "id": 331, + "id": 374, "name": "Utils", "kind": 2, "kindString": "Module", @@ -8078,7 +9009,7 @@ }, "children": [ { - "id": 333, + "id": 376, "name": "Module", "kind": 256, "kindString": "Interface", @@ -8087,7 +9018,7 @@ }, "children": [ { - "id": 335, + "id": 378, "name": "app", "kind": 1024, "kindString": "Property", @@ -8111,7 +9042,7 @@ } }, { - "id": 334, + "id": 377, "name": "isRunningInTestLab", "kind": 1024, "kindString": "Property", @@ -8145,8 +9076,8 @@ "title": "Properties", "kind": 1024, "children": [ - 335, - 334 + 378, + 377 ] } ], @@ -8165,7 +9096,7 @@ ] }, { - "id": 332, + "id": 375, "name": "Statics", "kind": 256, "kindString": "Interface", @@ -8186,8 +9117,8 @@ "title": "Interfaces", "kind": 256, "children": [ - 333, - 332 + 376, + 375 ] } ], @@ -8200,7 +9131,7 @@ ] }, { - "id": 354, + "id": 397, "name": "FirebaseApp", "kind": 256, "kindString": "Interface", @@ -8209,7 +9140,7 @@ }, "children": [ { - "id": 355, + "id": 398, "name": "name", "kind": 1024, "kindString": "Property", @@ -8232,7 +9163,7 @@ } }, { - "id": 356, + "id": 399, "name": "options", "kind": 1024, "kindString": "Property", @@ -8252,11 +9183,11 @@ "type": { "type": "reference", "name": "FirebaseOptions", - "id": 374 + "id": 417 } }, { - "id": 357, + "id": 400, "name": "delete", "kind": 2048, "kindString": "Method", @@ -8265,7 +9196,7 @@ }, "signatures": [ { - "id": 358, + "id": 401, "name": "delete", "kind": 4096, "kindString": "Call signature", @@ -8299,15 +9230,15 @@ "title": "Properties", "kind": 1024, "children": [ - 355, - 356 + 398, + 399 ] }, { "title": "Methods", "kind": 2048, "children": [ - 357 + 400 ] } ], @@ -8320,7 +9251,7 @@ ] }, { - "id": 350, + "id": 393, "name": "FirebaseAppConfig", "kind": 256, "kindString": "Interface", @@ -8329,7 +9260,7 @@ }, "children": [ { - "id": 352, + "id": 395, "name": "automaticDataCollectionEnabled", "kind": 1024, "kindString": "Property", @@ -8364,7 +9295,7 @@ } }, { - "id": 353, + "id": 396, "name": "automaticResourceManagement", "kind": 1024, "kindString": "Property", @@ -8401,7 +9332,7 @@ } }, { - "id": 351, + "id": 394, "name": "name", "kind": 1024, "kindString": "Property", @@ -8439,9 +9370,9 @@ "title": "Properties", "kind": 1024, "children": [ - 352, - 353, - 351 + 395, + 396, + 394 ] } ], @@ -8454,7 +9385,7 @@ ] }, { - "id": 341, + "id": 384, "name": "NativeFirebaseError", "kind": 256, "kindString": "Interface", @@ -8463,7 +9394,7 @@ }, "children": [ { - "id": 349, + "id": 392, "name": "Error", "kind": 1024, "kindString": "Property", @@ -8483,7 +9414,7 @@ } }, { - "id": 342, + "id": 385, "name": "code", "kind": 1024, "kindString": "Property", @@ -8506,7 +9437,7 @@ } }, { - "id": 343, + "id": 386, "name": "message", "kind": 1024, "kindString": "Property", @@ -8533,7 +9464,7 @@ } }, { - "id": 347, + "id": 390, "name": "name", "kind": 1024, "kindString": "Property", @@ -8557,7 +9488,7 @@ } }, { - "id": 344, + "id": 387, "name": "namespace", "kind": 1024, "kindString": "Property", @@ -8580,7 +9511,7 @@ } }, { - "id": 345, + "id": 388, "name": "nativeErrorCode", "kind": 1024, "kindString": "Property", @@ -8612,7 +9543,7 @@ } }, { - "id": 346, + "id": 389, "name": "nativeErrorMessage", "kind": 1024, "kindString": "Property", @@ -8635,7 +9566,7 @@ } }, { - "id": 348, + "id": 391, "name": "stack", "kind": 1024, "kindString": "Property", @@ -8678,14 +9609,14 @@ "title": "Properties", "kind": 1024, "children": [ - 349, - 342, - 343, - 347, - 344, - 345, - 346, - 348 + 392, + 385, + 386, + 390, + 387, + 388, + 389, + 391 ] } ], @@ -8704,7 +9635,7 @@ ] }, { - "id": 372, + "id": 415, "name": "ReactNativeFirebaseModule", "kind": 256, "kindString": "Interface", @@ -8713,7 +9644,7 @@ }, "children": [ { - "id": 373, + "id": 416, "name": "app", "kind": 1024, "kindString": "Property", @@ -8730,7 +9661,7 @@ "type": { "type": "reference", "name": "FirebaseApp", - "id": 354 + "id": 397 } } ], @@ -8739,7 +9670,7 @@ "title": "Properties", "kind": 1024, "children": [ - 373 + 416 ] } ], @@ -8752,7 +9683,7 @@ ] }, { - "id": 359, + "id": 402, "name": "ReactNativeFirebaseNamespace", "kind": 256, "kindString": "Interface", @@ -8761,7 +9692,7 @@ }, "children": [ { - "id": 371, + "id": 414, "name": "SDK_VERSION", "kind": 1024, "kindString": "Property", @@ -8784,7 +9715,7 @@ } }, { - "id": 370, + "id": 413, "name": "apps", "kind": 1024, "kindString": "Property", @@ -8806,12 +9737,12 @@ "elementType": { "type": "reference", "name": "FirebaseApp", - "id": 354 + "id": 397 } } }, { - "id": 367, + "id": 410, "name": "app", "kind": 2048, "kindString": "Method", @@ -8820,7 +9751,7 @@ }, "signatures": [ { - "id": 368, + "id": 411, "name": "app", "kind": 4096, "kindString": "Call signature", @@ -8836,7 +9767,7 @@ }, "parameters": [ { - "id": 369, + "id": 412, "name": "name", "kind": 32768, "kindString": "Parameter", @@ -8864,7 +9795,7 @@ "type": { "type": "reference", "name": "FirebaseApp", - "id": 354 + "id": 397 } } ], @@ -8877,7 +9808,7 @@ ] }, { - "id": 360, + "id": 403, "name": "initializeApp", "kind": 2048, "kindString": "Method", @@ -8886,7 +9817,7 @@ }, "signatures": [ { - "id": 361, + "id": 404, "name": "initializeApp", "kind": 4096, "kindString": "Call signature", @@ -8896,7 +9827,7 @@ }, "parameters": [ { - "id": 362, + "id": 405, "name": "options", "kind": 32768, "kindString": "Parameter", @@ -8907,11 +9838,11 @@ "type": { "type": "reference", "name": "FirebaseOptions", - "id": 374 + "id": 417 } }, { - "id": 363, + "id": 406, "name": "config", "kind": 32768, "kindString": "Parameter", @@ -8924,18 +9855,18 @@ "type": { "type": "reference", "name": "FirebaseAppConfig", - "id": 350 + "id": 393 } } ], "type": { "type": "reference", "name": "FirebaseApp", - "id": 354 + "id": 397 } }, { - "id": 364, + "id": 407, "name": "initializeApp", "kind": 4096, "kindString": "Call signature", @@ -8945,7 +9876,7 @@ }, "parameters": [ { - "id": 365, + "id": 408, "name": "options", "kind": 32768, "kindString": "Parameter", @@ -8956,11 +9887,11 @@ "type": { "type": "reference", "name": "FirebaseOptions", - "id": 374 + "id": 417 } }, { - "id": 366, + "id": 409, "name": "name", "kind": 32768, "kindString": "Parameter", @@ -8988,7 +9919,7 @@ "type": { "type": "reference", "name": "FirebaseApp", - "id": 354 + "id": 397 } } ], @@ -9011,16 +9942,16 @@ "title": "Properties", "kind": 1024, "children": [ - 371, - 370 + 414, + 413 ] }, { "title": "Methods", "kind": 2048, "children": [ - 367, - 360 + 410, + 403 ] } ], @@ -9033,7 +9964,7 @@ ] }, { - "id": 374, + "id": 417, "name": "FirebaseOptions", "kind": 4194304, "kindString": "Type alias", @@ -9050,21 +9981,21 @@ "type": { "type": "reflection", "declaration": { - "id": 375, + "id": 418, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "indexSignature": [ { - "id": 386, + "id": 429, "name": "__index", "kind": 8192, "kindString": "Index signature", "flags": {}, "parameters": [ { - "id": 387, + "id": 430, "name": "name", "kind": 32768, "kindString": "Parameter", @@ -9083,7 +10014,7 @@ ], "children": [ { - "id": 384, + "id": 427, "name": "androidClientId", "kind": 32, "kindString": "Variable", @@ -9115,7 +10046,7 @@ } }, { - "id": 377, + "id": 420, "name": "apiKey", "kind": 32, "kindString": "Variable", @@ -9147,7 +10078,7 @@ } }, { - "id": 376, + "id": 419, "name": "appId", "kind": 32, "kindString": "Variable", @@ -9168,7 +10099,7 @@ } }, { - "id": 383, + "id": 426, "name": "clientId", "kind": 32, "kindString": "Variable", @@ -9200,7 +10131,7 @@ } }, { - "id": 378, + "id": 421, "name": "databaseURL", "kind": 32, "kindString": "Variable", @@ -9232,7 +10163,7 @@ } }, { - "id": 385, + "id": 428, "name": "deepLinkURLScheme", "kind": 32, "kindString": "Variable", @@ -9264,7 +10195,7 @@ } }, { - "id": 380, + "id": 423, "name": "gaTrackingId", "kind": 32, "kindString": "Variable", @@ -9296,7 +10227,7 @@ } }, { - "id": 382, + "id": 425, "name": "messagingSenderId", "kind": 32, "kindString": "Variable", @@ -9328,7 +10259,7 @@ } }, { - "id": 379, + "id": 422, "name": "projectId", "kind": 32, "kindString": "Variable", @@ -9349,7 +10280,7 @@ } }, { - "id": 381, + "id": 424, "name": "storageBucket", "kind": 32, "kindString": "Variable", @@ -9386,16 +10317,16 @@ "title": "Variables", "kind": 32, "children": [ - 384, - 377, - 376, - 383, - 378, - 385, - 380, - 382, - 379, - 381 + 427, + 420, + 419, + 426, + 421, + 428, + 423, + 425, + 422, + 424 ] } ], @@ -9410,7 +10341,7 @@ } }, { - "id": 407, + "id": 450, "name": "ReactNativeFirebaseModuleAndStatics", "kind": 4194304, "kindString": "Type alias", @@ -9419,14 +10350,14 @@ }, "typeParameter": [ { - "id": 408, + "id": 451, "name": "M", "kind": 131072, "kindString": "Type parameter", "flags": {} }, { - "id": 409, + "id": 452, "name": "S", "kind": 131072, "kindString": "Type parameter", @@ -9446,14 +10377,14 @@ { "type": "reflection", "declaration": { - "id": 410, + "id": 453, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "signatures": [ { - "id": 411, + "id": 454, "name": "__call", "kind": 4096, "kindString": "Call signature", @@ -9466,7 +10397,7 @@ ], "children": [ { - "id": 412, + "id": 455, "name": "SDK_VERSION", "kind": 32, "kindString": "Variable", @@ -9492,7 +10423,7 @@ "title": "Variables", "kind": 32, "children": [ - 412 + 455 ] } ], @@ -9513,7 +10444,7 @@ } }, { - "id": 413, + "id": 456, "name": "ReactNativeFirebaseModuleAndStaticsWithApp", "kind": 4194304, "kindString": "Type alias", @@ -9522,14 +10453,14 @@ }, "typeParameter": [ { - "id": 414, + "id": 457, "name": "M", "kind": 131072, "kindString": "Type parameter", "flags": {} }, { - "id": 415, + "id": 458, "name": "S", "kind": 131072, "kindString": "Type parameter", @@ -9549,21 +10480,21 @@ { "type": "reflection", "declaration": { - "id": 416, + "id": 459, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "signatures": [ { - "id": 417, + "id": 460, "name": "__call", "kind": 4096, "kindString": "Call signature", "flags": {}, "parameters": [ { - "id": 418, + "id": 461, "name": "app", "kind": 32768, "kindString": "Parameter", @@ -9585,7 +10516,7 @@ ], "children": [ { - "id": 419, + "id": 462, "name": "SDK_VERSION", "kind": 32, "kindString": "Variable", @@ -9611,7 +10542,7 @@ "title": "Variables", "kind": 32, "children": [ - 419 + 462 ] } ], @@ -9640,48 +10571,48 @@ 40, 44, 63, - 74, - 116, - 135, - 146, - 195, - 219, - 230, - 324, - 336, + 117, + 159, + 178, + 189, + 238, + 262, + 273, + 367, + 379, 50, 1, - 388, + 431, 59, 70, - 81, - 123, - 142, - 153, - 203, - 226, - 237, - 331 + 124, + 166, + 185, + 196, + 246, + 269, + 280, + 374 ] }, { "title": "Interfaces", "kind": 256, "children": [ - 354, - 350, - 341, - 372, - 359 + 397, + 393, + 384, + 415, + 402 ] }, { "title": "Type aliases", "kind": 4194304, "children": [ - 374, - 407, - 413 + 417, + 450, + 456 ] } ] diff --git a/package.json b/package.json index f65b01da..eba1ec24 100644 --- a/package.json +++ b/package.json @@ -15,18 +15,18 @@ "tests:packager:chrome": "cd tests && react-native start --platforms ios,android", "tests:packager:jet": "REACT_DEBUGGER='echo nope' cd tests && react-native start", "tests:packager:jet-reset-cache": "REACT_DEBUGGER='echo nope' cd tests && react-native start --reset-cache", - "tests:android:build": "cd tests && detox build --configuration android.emu.debug", - "tests:android:build-release": "cd tests && detox build --configuration android.emu.release", - "tests:android:test": "cd tests && detox test --configuration android.emu.debug", - "tests:android:test-reuse": "cd tests && detox test --configuration android.emu.debug --reuse", + "tests:android:build": "cd tests && ./node_modules/.bin/detox build --configuration android.emu.debug", + "tests:android:build-release": "cd tests && ./node_modules/.bin/detox build --configuration android.emu.release", + "tests:android:test": "cd tests && ./node_modules/.bin/detox test --configuration android.emu.debug", + "tests:android:test-reuse": "cd tests && ./node_modules/.bin/detox test --configuration android.emu.debug --reuse", "tests:android:test-cover": "cd tests && nyc ./node_modules/.bin/detox test --configuration android.emu.debug", - "tests:android:test-cover-reuse": "cd tests && nyc detox test --configuration android.emu.debug --reuse", - "tests:ios:build": "cd tests && detox build --configuration ios.sim.debug", - "tests:ios:build-release": "cd tests && detox build --configuration ios.sim.release", - "tests:ios:test": "cd tests && detox test --configuration ios.sim.debug --loglevel warn", - "tests:ios:test-reuse": "cd tests && detox test --configuration ios.sim.debug --reuse --loglevel warn", + "tests:android:test-cover-reuse": "cd tests && nyc ./node_modules/.bin/detox test --configuration android.emu.debug --reuse", + "tests:ios:build": "cd tests && ./node_modules/.bin/detox build --configuration ios.sim.debug", + "tests:ios:build-release": "cd tests && ./node_modules/.bin/detox build --configuration ios.sim.release", + "tests:ios:test": "cd tests && ./node_modules/.bin/detox test --configuration ios.sim.debug --loglevel warn", + "tests:ios:test-reuse": "cd tests && ./node_modules/.bin/detox test --configuration ios.sim.debug --reuse --loglevel warn", "tests:ios:test-cover": "cd tests && nyc ./node_modules/.bin/detox test --configuration ios.sim.debug", - "tests:ios:test-cover-reuse": "cd tests && nyc detox test --configuration ios.sim.debug --reuse --loglevel warn", + "tests:ios:test-cover-reuse": "cd tests && nyc ./node_modules/.bin/detox test --configuration ios.sim.debug --reuse --loglevel warn", "tests:ios:pod:install": "cd tests && cd ios && rm -rf ReactNativeFirebaseDemo.xcworkspace && pod install && cd ..", "npm:version:release:patch": "echo '!!🔴!! RELEASE !!🔴!!' && lerna version patch --exact --force-publish=*", "npm:version:release:minor": "echo '!!🔴!! RELEASE !!🔴!!' && lerna version minor --exact --force-publish=*", diff --git a/packages/analytics/android/build.gradle b/packages/analytics/android/build.gradle index dc94a5d1..8eb3719e 100644 --- a/packages/analytics/android/build.gradle +++ b/packages/analytics/android/build.gradle @@ -55,7 +55,7 @@ repositories { } dependencies { - api project(':@react-native-firebase/app') + api project(':@react-native-firebase_app') implementation "com.google.firebase:firebase-analytics:${ReactNative.ext.getVersion("firebase", "analytics")}" implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}" } diff --git a/packages/analytics/android/settings.gradle b/packages/analytics/android/settings.gradle index 953994e0..e2d96ad5 100644 --- a/packages/analytics/android/settings.gradle +++ b/packages/analytics/android/settings.gradle @@ -1 +1 @@ -rootProject.name = '@react-native-firebase/analytics' +rootProject.name = '@react-native-firebase_analytics' diff --git a/packages/analytics/android/src/main/java/io/invertase/firebase/analytics/ReactNativeFirebaseAnalyticsModule.java b/packages/analytics/android/src/main/java/io/invertase/firebase/analytics/ReactNativeFirebaseAnalyticsModule.java index 43064d8c..75c892f7 100644 --- a/packages/analytics/android/src/main/java/io/invertase/firebase/analytics/ReactNativeFirebaseAnalyticsModule.java +++ b/packages/analytics/android/src/main/java/io/invertase/firebase/analytics/ReactNativeFirebaseAnalyticsModule.java @@ -17,6 +17,7 @@ package io.invertase.firebase.analytics; * */ +import android.annotation.SuppressLint; import android.app.Activity; import com.facebook.react.bridge.Arguments; @@ -38,6 +39,7 @@ public class ReactNativeFirebaseAnalyticsModule extends ReactNativeFirebaseModul super(reactContext, TAG); } + @SuppressLint("MissingPermission") @ReactMethod public void logEvent(String name, @Nullable ReadableMap params, Promise promise) { try { @@ -48,6 +50,7 @@ public class ReactNativeFirebaseAnalyticsModule extends ReactNativeFirebaseModul } } + @SuppressLint("MissingPermission") @ReactMethod public void setAnalyticsCollectionEnabled(Boolean enabled, Promise promise) { try { @@ -63,6 +66,7 @@ public class ReactNativeFirebaseAnalyticsModule extends ReactNativeFirebaseModul Activity activity = getActivity(); if (activity != null) { activity.runOnUiThread(new Runnable() { + @SuppressLint("MissingPermission") @Override public void run() { try { @@ -81,6 +85,7 @@ public class ReactNativeFirebaseAnalyticsModule extends ReactNativeFirebaseModul } } + @SuppressLint("MissingPermission") @ReactMethod public void setMinimumSessionDuration(double milliseconds, Promise promise) { try { @@ -91,6 +96,7 @@ public class ReactNativeFirebaseAnalyticsModule extends ReactNativeFirebaseModul } } + @SuppressLint("MissingPermission") @ReactMethod public void setSessionTimeoutDuration(double milliseconds, Promise promise) { try { @@ -101,6 +107,7 @@ public class ReactNativeFirebaseAnalyticsModule extends ReactNativeFirebaseModul } } + @SuppressLint("MissingPermission") @ReactMethod public void setUserId(String id, Promise promise) { try { @@ -111,6 +118,7 @@ public class ReactNativeFirebaseAnalyticsModule extends ReactNativeFirebaseModul } } + @SuppressLint("MissingPermission") @ReactMethod public void setUserProperty(String name, String value, Promise promise) { try { @@ -125,7 +133,7 @@ public class ReactNativeFirebaseAnalyticsModule extends ReactNativeFirebaseModul public void setUserProperties(ReadableMap properties, Promise promise) { try { ReadableMapKeySetIterator iterator = properties.keySetIterator(); - FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(getContext()); + @SuppressLint("MissingPermission") FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(getContext()); while (iterator.hasNextKey()) { String name = iterator.nextKey(); @@ -139,6 +147,7 @@ public class ReactNativeFirebaseAnalyticsModule extends ReactNativeFirebaseModul } } + @SuppressLint("MissingPermission") @ReactMethod public void resetAnalyticsData(Promise promise) { try { diff --git a/packages/app/android/settings.gradle b/packages/app/android/settings.gradle index aeaa1880..8ec1d4fa 100644 --- a/packages/app/android/settings.gradle +++ b/packages/app/android/settings.gradle @@ -1 +1 @@ -rootProject.name = '@react-native-firebase/app' +rootProject.name = '@react-native-firebase_app' diff --git a/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseModule.java b/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseModule.java index 1c1a88e5..b4dec5fa 100644 --- a/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseModule.java +++ b/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseModule.java @@ -30,6 +30,8 @@ import com.facebook.react.bridge.WritableMap; import java.util.HashMap; import java.util.Map; +import javax.annotation.Nonnull; + import io.invertase.firebase.interfaces.ContextProvider; public class ReactNativeFirebaseModule extends ReactContextBaseJavaModule implements ContextProvider { @@ -72,10 +74,17 @@ public class ReactNativeFirebaseModule extends ReactContextBaseJavaModule implem } public void rejectPromiseWithExceptionMap(Promise promise, Exception exception) { - // TODO hook into crashlytics - report as handled exception? promise.reject(exception, getExceptionMap(exception)); } + public void rejectPromiseWithCodeAndMessage(Promise promise, String code, String message) { + WritableMap userInfoMap = Arguments.createMap(); + userInfoMap.putString("code", code); + userInfoMap.putString("message", message); + promise.reject(code, message, userInfoMap); + } + + @Nonnull @Override public String getName() { return "RNFB" + moduleName + "Module"; diff --git a/packages/app/ios/RNFBApp/RNFBSharedUtils.m b/packages/app/ios/RNFBApp/RNFBSharedUtils.m index 3fd82395..5ae74ee8 100644 --- a/packages/app/ios/RNFBApp/RNFBSharedUtils.m +++ b/packages/app/ios/RNFBApp/RNFBSharedUtils.m @@ -72,16 +72,11 @@ NSString *const DEFAULT_APP_NAME = @"__FIRAPP_DEFAULT"; NSError *error = [NSError errorWithDomain:RNFBErrorDomain code:666 userInfo:userInfo]; - // TODO hook into crashlytics - report as handled exception? - reject(exception.name, exception.reason, error); } + (void)rejectPromiseWithUserInfo:(RCTPromiseRejectBlock)reject userInfo:(NSMutableDictionary *)userInfo; { NSError *error = [NSError errorWithDomain:RNFBErrorDomain code:666 userInfo:userInfo]; - - // TODO hook into crashlytics - report as handled exception? - reject(userInfo[@"code"], userInfo[@"message"], error); } @end \ No newline at end of file diff --git a/packages/app/pod_config.rb b/packages/app/pod_config.rb index 323cb17f..b2da16d5 100644 --- a/packages/app/pod_config.rb +++ b/packages/app/pod_config.rb @@ -28,9 +28,9 @@ end def react_native_firebase!(config = {}) react_native_firebase_path = config.fetch(:react_native_firebase_path, '../node_modules/@react-native-firebase') - known_firebase_modules = %w(app analytics crashlytics fiam functions firestore iid invites perf utils) + known_firebase_modules = %w(app analytics config crashlytics fiam functions firestore iid invites perf utils) - # TODO: validate versions / set pod versions + # TODO(salakar): validate versions / set pod versions app_package = JSON.parse(File.read("#{react_native_firebase_path}/#{known_firebase_modules[0]}/package.json")) app_package_version = app_package['version'] diff --git a/packages/auth/android/build.gradle b/packages/auth/android/build.gradle index 6ae07133..904efe0d 100644 --- a/packages/auth/android/build.gradle +++ b/packages/auth/android/build.gradle @@ -55,7 +55,7 @@ repositories { } dependencies { - api project(':@react-native-firebase/app') + api project(':@react-native-firebase_app') implementation "com.google.firebase:firebase-auth:${ReactNative.ext.getVersion("firebase", "auth")}" implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}" } diff --git a/packages/auth/android/settings.gradle b/packages/auth/android/settings.gradle index e2974f03..ffe89833 100644 --- a/packages/auth/android/settings.gradle +++ b/packages/auth/android/settings.gradle @@ -1 +1 @@ -rootProject.name = '@react-native-firebase/auth' +rootProject.name = '@react-native-firebase_auth' diff --git a/packages/config/android/build.gradle b/packages/config/android/build.gradle index da4e6dd0..1fdbfbb1 100644 --- a/packages/config/android/build.gradle +++ b/packages/config/android/build.gradle @@ -55,7 +55,7 @@ repositories { } dependencies { - api project(':@react-native-firebase/app') + api project(':@react-native-firebase_app') implementation "com.google.firebase:firebase-config:${ReactNative.ext.getVersion("firebase", "config")}" implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}" } diff --git a/packages/config/android/settings.gradle b/packages/config/android/settings.gradle index a6ce970e..821c8284 100644 --- a/packages/config/android/settings.gradle +++ b/packages/config/android/settings.gradle @@ -1 +1 @@ -rootProject.name = '@react-native-firebase/config' +rootProject.name = '@react-native-firebase_config' diff --git a/packages/config/android/src/main/java/io/invertase/firebase/config/ReactNativeFirebaseConfigModule.java b/packages/config/android/src/main/java/io/invertase/firebase/config/ReactNativeFirebaseConfigModule.java index 62ddf4b3..057aa11e 100644 --- a/packages/config/android/src/main/java/io/invertase/firebase/config/ReactNativeFirebaseConfigModule.java +++ b/packages/config/android/src/main/java/io/invertase/firebase/config/ReactNativeFirebaseConfigModule.java @@ -17,24 +17,247 @@ package io.invertase.firebase.config; * */ -import android.app.Activity; +import android.content.res.Resources; +import android.content.res.XmlResourceParser; import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactMethod; +import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; -import com.facebook.react.bridge.ReadableMapKeySetIterator; +import com.facebook.react.bridge.WritableArray; +import com.facebook.react.bridge.WritableMap; +import com.google.android.gms.tasks.Task; +import com.google.firebase.remoteconfig.FirebaseRemoteConfig; +import com.google.firebase.remoteconfig.FirebaseRemoteConfigFetchThrottledException; +import com.google.firebase.remoteconfig.FirebaseRemoteConfigInfo; +import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; +import com.google.firebase.remoteconfig.FirebaseRemoteConfigValue; -import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Set; import io.invertase.firebase.common.ReactNativeFirebaseModule; +import static com.google.firebase.remoteconfig.FirebaseRemoteConfig.LAST_FETCH_STATUS_FAILURE; +import static com.google.firebase.remoteconfig.FirebaseRemoteConfig.LAST_FETCH_STATUS_NO_FETCH_YET; +import static com.google.firebase.remoteconfig.FirebaseRemoteConfig.LAST_FETCH_STATUS_SUCCESS; +import static com.google.firebase.remoteconfig.FirebaseRemoteConfig.LAST_FETCH_STATUS_THROTTLED; + public class ReactNativeFirebaseConfigModule extends ReactNativeFirebaseModule { private static final String TAG = "Config"; + private static final String STRING_VALUE = "stringValue"; + private static final String BOOL_VALUE = "boolValue"; + private static final String NUMBER_VALUE = "numberValue"; + private static final String SOURCE = "source"; ReactNativeFirebaseConfigModule(ReactApplicationContext reactContext) { super(reactContext, TAG); } + @ReactMethod + public void activateFetched(Promise promise) { + boolean activated = FirebaseRemoteConfig.getInstance().activateFetched(); + promise.resolve(activated); + } + + @ReactMethod + public void fetch(double cacheExpirationSeconds, boolean activate, Promise promise) { + Task fetchTask; + + if (cacheExpirationSeconds == -1) { + fetchTask = FirebaseRemoteConfig.getInstance().fetch((long) cacheExpirationSeconds); + } else { + fetchTask = FirebaseRemoteConfig.getInstance().fetch(); + } + + fetchTask.addOnCompleteListener(task -> { + if (task.isSuccessful()) { + if (activate) { + promise.resolve(FirebaseRemoteConfig.getInstance().activateFetched()); + } else { + promise.resolve(null); + } + } else { + if (task.getException() instanceof FirebaseRemoteConfigFetchThrottledException) { + rejectPromiseWithCodeAndMessage( + promise, + "throttled", + "fetch() operation cannot be completed successfully, due to throttling." + ); + } else { + rejectPromiseWithCodeAndMessage( + promise, + "failure", + "fetch() operation cannot be completed successfully." + ); + } + } + }); + } + + @ReactMethod + public void getConfigSettings(Promise promise) { + WritableMap configSettingsMap = Arguments.createMap(); + FirebaseRemoteConfigInfo remoteConfigInfo = FirebaseRemoteConfig.getInstance().getInfo(); + FirebaseRemoteConfigSettings remoteConfigSettings = remoteConfigInfo.getConfigSettings(); + + configSettingsMap.putDouble("lastFetchTime", remoteConfigInfo.getFetchTimeMillis()); + configSettingsMap.putString( + "lastFetchStatus", + lastFetchStatusToString(remoteConfigInfo.getLastFetchStatus()) + ); + configSettingsMap.putBoolean( + "isDeveloperModeEnabled", + remoteConfigSettings.isDeveloperModeEnabled() + ); + + promise.resolve(configSettingsMap); + } + + @ReactMethod + public void setConfigSettings(ReadableMap configSettings, Promise promise) { + FirebaseRemoteConfigSettings.Builder configSettingsBuilder = new FirebaseRemoteConfigSettings.Builder(); + configSettingsBuilder.setDeveloperModeEnabled(configSettings.getBoolean("isDeveloperModeEnabled")); + FirebaseRemoteConfig.getInstance().setConfigSettings(configSettingsBuilder.build()); + getConfigSettings(promise); + } + + @ReactMethod + public void setDefaults(ReadableMap defaults, Promise promise) { + FirebaseRemoteConfig.getInstance().setDefaults(defaults.toHashMap()); + promise.resolve(null); + } + + @ReactMethod + public void setDefaultsFromResource(String resourceName, Promise promise) { + int resourceId = getXmlResourceIdByName(resourceName); + XmlResourceParser xmlResourceParser = null; + + try { + xmlResourceParser = getApplicationContext().getResources().getXml(resourceId); + } catch (Resources.NotFoundException nfe) { + // do nothing + } + + if (xmlResourceParser != null) { + FirebaseRemoteConfig.getInstance().setDefaults(resourceId); + promise.resolve(null); + } else { + rejectPromiseWithCodeAndMessage( + promise, + "resource_not_found", + "The specified resource name was not found." + ); + } + } + + private int getXmlResourceIdByName(String name) { + String packageName = getApplicationContext().getPackageName(); + return getApplicationContext().getResources().getIdentifier(name, "xml", packageName); + } + + @ReactMethod + public void getValuesByKeysPrefix(String prefix, Promise promise) { + Set keys = FirebaseRemoteConfig.getInstance().getKeysByPrefix(prefix); + WritableMap writableMap = Arguments.createMap(); + + for (String key : keys) { + FirebaseRemoteConfigValue configValue = FirebaseRemoteConfig.getInstance().getValue(key); + writableMap.putMap(key, convertRemoteConfigValue(configValue)); + } + + promise.resolve(writableMap); + } + + + @ReactMethod + public void getKeysByPrefix(String prefix, Promise promise) { + WritableArray keysByPrefix = Arguments.createArray(); + + Set keys = FirebaseRemoteConfig.getInstance().getKeysByPrefix(prefix); + + for (String key : keys) { + keysByPrefix.pushString(key); + } + + promise.resolve(keysByPrefix); + } + + @ReactMethod + public void getValue(String key, Promise promise) { + FirebaseRemoteConfigValue configValue = FirebaseRemoteConfig.getInstance().getValue(key); + promise.resolve(convertRemoteConfigValue(configValue)); + } + + @ReactMethod + public void getValues(ReadableArray keys, Promise promise) { + WritableArray valuesArray = Arguments.createArray(); + ArrayList keysList = keys.toArrayList(); + + for (Object key : keysList) { + + FirebaseRemoteConfigValue configValue = FirebaseRemoteConfig + .getInstance() + .getValue((String) key); + + valuesArray.pushMap(convertRemoteConfigValue(configValue)); + } + + promise.resolve(valuesArray); + } + + private WritableMap convertRemoteConfigValue(FirebaseRemoteConfigValue value) { + WritableMap map = Arguments.createMap(); + + map.putString(STRING_VALUE, value.asString()); + + try { + boolean booleanValue = value.asBoolean(); + map.putBoolean(BOOL_VALUE, booleanValue); + } catch (Exception e) { + map.putNull(BOOL_VALUE); + } + + try { + double numberValue = value.asDouble(); + map.putDouble(NUMBER_VALUE, numberValue); + } catch (Exception e) { + map.putNull(NUMBER_VALUE); + } + + switch (value.getSource()) { + case FirebaseRemoteConfig.VALUE_SOURCE_DEFAULT: + map.putString(SOURCE, "default"); + break; + case FirebaseRemoteConfig.VALUE_SOURCE_REMOTE: + map.putString(SOURCE, "remote"); + break; + default: + map.putString(SOURCE, "static"); + } + + return map; + } + + + private String lastFetchStatusToString(int fetchStatus) { + String status = "unknown"; + switch (fetchStatus) { + case LAST_FETCH_STATUS_SUCCESS: + status = "success"; + break; + case LAST_FETCH_STATUS_FAILURE: + status = "failure"; + break; + case LAST_FETCH_STATUS_NO_FETCH_YET: + status = "no_fetch_yet"; + break; + case LAST_FETCH_STATUS_THROTTLED: + status = "throttled"; + break; + } + return status; + } } diff --git a/packages/config/e2e/config.e2e.js b/packages/config/e2e/config.e2e.js index 0123d629..65ab01d1 100644 --- a/packages/config/e2e/config.e2e.js +++ b/packages/config/e2e/config.e2e.js @@ -22,23 +22,333 @@ describe('config()', () => { should.exist(app.config); app.config().app.should.equal(app); }); + }); - // removing as pending if module.options.hasMultiAppSupport = true - xit('supports multiple apps', async () => { - firebase.config().app.name.should.equal('[DEFAULT]'); - - firebase - .config(firebase.app('secondaryFromNative')) - .app.name.should.equal('secondaryFromNative'); - - firebase - .app('secondaryFromNative') - .config() - .app.name.should.equal('secondaryFromNative'); + describe('fetch()', () => { + it('with expiration provided', () => firebase.config().fetch(0)); + it('without expiration provided', () => firebase.config().fetch()); + it('it throws if expiration is not a number', () => { + try { + firebase.config().fetch('foo'); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be a number value'); + return Promise.resolve(); + } }); }); - describe('aMethod()', () => { - // TODO + describe('fetchAndActivate()', () => { + it('returns true/false if activated', async () => { + const activated = await firebase.config().fetchAndActivate(0); + activated.should.be.a.Boolean(); + }); + it('with expiration provided', () => firebase.config().fetchAndActivate(0)); + it('without expiration provided', () => firebase.config().fetchAndActivate()); + it('it throws if expiration is not a number', () => { + try { + firebase.config().fetchAndActivate('foo'); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be a number value'); + return Promise.resolve(); + } + }); + }); + + describe('activateFetched()', () => { + it('with expiration provided', async () => { + await firebase.config().fetch(0); + const activated = await firebase.config().activateFetched(); + activated.should.be.a.Boolean(); + }); + + it('without expiration provided', async () => { + await firebase.config().fetch(); + const activated = await firebase.config().activateFetched(); + activated.should.be.a.Boolean(); + }); + }); + + describe('getConfigSettings()', () => { + it('gets settings', async () => { + const settings = await firebase.config().getConfigSettings(); + settings.isDeveloperModeEnabled.should.be.a.Boolean(); + settings.isDeveloperModeEnabled.should.equal(false); + settings.lastFetchStatus.should.be.a.String(); + settings.lastFetchStatus.should.equal('success'); + settings.lastFetchTime.should.be.a.Number(); + }); + }); + + describe('setConfigSettings()', () => { + it('isDeveloperModeEnabled sets correctly', async () => { + const settingsBefore = await firebase.config().getConfigSettings(); + settingsBefore.isDeveloperModeEnabled.should.equal(false); + settingsBefore.isDeveloperModeEnabled.should.be.a.Boolean(); + + await firebase.config().setConfigSettings({ isDeveloperModeEnabled: true }); + + const settingsAfter = await firebase.config().getConfigSettings(); + settingsAfter.isDeveloperModeEnabled.should.equal(true); + settingsAfter.isDeveloperModeEnabled.should.be.a.Boolean(); + + await firebase.config().setConfigSettings({ isDeveloperModeEnabled: false }); + }); + + it('returns the new config settings', async () => { + const settings = await firebase.config().setConfigSettings({ isDeveloperModeEnabled: false }); + settings.isDeveloperModeEnabled.should.be.a.Boolean(); + settings.isDeveloperModeEnabled.should.equal(false); + settings.lastFetchStatus.should.be.a.String(); + settings.lastFetchStatus.should.equal('success'); + settings.lastFetchTime.should.be.a.Number(); + }); + + it('it throws if no args', async () => { + try { + await firebase.config().setConfigSettings(); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be an object'); + return Promise.resolve(); + } + }); + + it('it throws if object does not contain isDeveloperModeEnabled key', async () => { + try { + await firebase.config().setConfigSettings({}); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql(`'isDeveloperModeEnabled' key`); + return Promise.resolve(); + } + }); + + it('it throws if isDeveloperModeEnabled key is not a boolean', async () => { + try { + await firebase.config().setConfigSettings({ isDeveloperModeEnabled: 'potato' }); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql( + `'settings.isDeveloperModeEnabled' must be a boolean value`, + ); + return Promise.resolve(); + } + }); + }); + + describe('getKeysByPrefix()', () => { + it('should return an object of all available values if no key prefix provided', async () => { + const config = await firebase.config().getValuesByKeysPrefix(); + config.number.value.should.equal(1337); + config.number.source.should.equal('remote'); + // firebase console stores as a string + config.float.value.should.equal(123.456); + config.float.source.should.equal('remote'); + }); + + it('should return an object filtered by prefixed keys', async () => { + const config = await firebase.config().getValuesByKeysPrefix('prefix_'); + Object.keys(config).length.should.equal(3); + config.prefix_1.value.should.equal(1); + config.prefix_1.source.should.equal('remote'); + }); + + it('it throws if prefix is not a string', async () => { + try { + await firebase.config().getValuesByKeysPrefix(1337); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be a string value'); + return Promise.resolve(); + } + }); + }); + + describe('getKeysByPrefix()', () => { + it('should return an array of all available keys if no prefix provided', async () => { + const keys = await firebase.config().getKeysByPrefix(); + keys.length.should.equal(9); + keys[0].should.be.a.String(); + }); + + it('should return an array of prefixed keys', async () => { + const keys = await firebase.config().getKeysByPrefix('prefix_'); + keys.length.should.equal(3); + keys[0].should.be.a.String(); + }); + + it('it throws if prefix is not a string', () => { + try { + firebase.config().getKeysByPrefix(1337); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be a string value'); + return Promise.resolve(); + } + }); + }); + + describe('setDefaults()', () => { + it('sets default values from key values object', async () => { + await firebase.config().setDefaults({ + some_key: 'I do not exist', + some_key_1: 1337, + some_key_2: true, + }); + + await firebase.config().fetch(0); + + const values = await firebase.config().getValues(['some_key', 'some_key_1', 'some_key_2']); + + values.some_key.value.should.equal('I do not exist'); + values.some_key_1.value.should.equal(1337); + should.equal(values.some_key_2.value, true); + + values.some_key.source.should.equal('default'); + values.some_key_1.source.should.equal('default'); + values.some_key_2.source.should.equal('default'); + }); + + it('it throws if defaults object not provided', () => { + try { + firebase.config().setDefaults(); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be an object'); + return Promise.resolve(); + } + }); + + it('it throws if defaults arg is not an object', () => { + try { + firebase.config().setDefaults(1337); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be an object'); + return Promise.resolve(); + } + }); + }); + + describe('setDefaultsFromResource()', () => { + it('sets defaults from remote_config_resource_test file', async () => { + await Utils.sleep(10000); + await firebase.config().setDefaultsFromResource('remote_config_resource_test'); + const config = await firebase.config().getValues(['company']); + config.company.source.should.equal('default'); + config.company.value.should.equal('invertase'); + }); + + it('it rejects if resource not found', async () => { + const [error] = await A2A(firebase.config().setDefaultsFromResource('i_do_not_exist')); + if (!error) throw new Error('Did not reject'); + error.code.should.equal('config/resource_not_found'); + error.message.should.containEql('was not found'); + }); + + it('it throws if resourceName is not a string', () => { + try { + firebase.config().setDefaultsFromResource(1337); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be a string value'); + return Promise.resolve(); + } + }); + }); + + describe('getValue()', () => { + it('returns a value for the specified key', async () => { + const configValue = await firebase.config().getValue('string'); + configValue.source.should.equal('remote'); + configValue.value.should.equal('invertase'); + }); + + it('errors if no key provided', async () => { + try { + await firebase.config().getValue(); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be a string'); + return Promise.resolve(); + } + }); + + it('errors if key not a string', async () => { + try { + await firebase.config().getValue(1234); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be a string'); + return Promise.resolve(); + } + }); + }); + + describe('getValues()', () => { + it('returns undefined for non existent keys', async () => { + const config = await firebase.config().getValues(['boopy', 'shoopy']); + should.equal(config.boopy.value, undefined); + should.equal(config.boopy.source, 'static'); + should.equal(config.shoopy.value, undefined); + should.equal(config.shoopy.source, 'static'); + }); + + it('get multiple values by an array of keys', async () => { + const config = await firebase.config().getValues(['bool', 'string', 'number']); + + config.should.be.a.Object(); + config.should.have.keys('bool', 'string', 'number'); + + const boolValue = config.bool.value; + const stringValue = config.string.value; + const numberValue = config.number.value; + + boolValue.should.be.equal(true); + stringValue.should.be.equal('invertase'); + numberValue.should.be.equal(1337); + }); + + it('errors if no args', async () => { + try { + await firebase.config().getValues(); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be an non empty array'); + return Promise.resolve(); + } + }); + + it('errors if not an array', async () => { + try { + await firebase.config().getValues({ foo: 'bar' }); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be an non empty array'); + return Promise.resolve(); + } + }); + + it('errors if array is empty', async () => { + try { + await firebase.config().getValues([]); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be an non empty array'); + return Promise.resolve(); + } + }); + + it('errors if array values are not strings', async () => { + try { + await firebase.config().getValues([1, 2, 3]); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql('must be an array of strings'); + return Promise.resolve(); + } + }); }); }); diff --git a/packages/config/ios/RNFBConfig.podspec b/packages/config/ios/RNFBConfig.podspec index 016aa4f9..c35072d9 100644 --- a/packages/config/ios/RNFBConfig.podspec +++ b/packages/config/ios/RNFBConfig.podspec @@ -17,6 +17,7 @@ Pod::Spec.new do |s| s.source_files = 'RNFBConfig/**/*.{h,m}' s.dependency 'React' s.dependency 'Firebase/Core', '~> 5.17.0' + s.dependency 'Firebase/RemoteConfig', '~> 5.17.0' s.dependency 'RNFBApp' s.static_framework = true end diff --git a/packages/config/ios/RNFBConfig/RNFBConfigModule.m b/packages/config/ios/RNFBConfig/RNFBConfigModule.m index 72810a66..23684f22 100644 --- a/packages/config/ios/RNFBConfig/RNFBConfigModule.m +++ b/packages/config/ios/RNFBConfig/RNFBConfigModule.m @@ -16,13 +16,59 @@ */ #import +#import #import #import "RNFBConfigModule.h" -#import "RNFBApp/RNFBSharedUtils.h" +#import "RNFBSharedUtils.h" @implementation RNFBConfigModule +#pragma mark - +# pragma mark Converters + + NSString *convertFIRRemoteConfigFetchStatusToNSString(FIRRemoteConfigFetchStatus value) { + switch (value) { + case FIRRemoteConfigFetchStatusNoFetchYet: + return @"no_fetch_yet"; + case FIRRemoteConfigFetchStatusSuccess: + return @"success"; + case FIRRemoteConfigFetchStatusThrottled: + return @"throttled"; + case FIRRemoteConfigFetchStatusFailure: + return @"failure"; + default: + return @"unknown"; + } + } + + NSString *convertFIRRemoteConfigFetchStatusToNSStringDescription(FIRRemoteConfigFetchStatus value) { + switch (value) { + case FIRRemoteConfigFetchStatusThrottled: + return @"fetch() operation cannot be completed successfully, due to throttling."; + case FIRRemoteConfigFetchStatusNoFetchYet: + default: + return @"fetch() operation cannot be completed successfully."; + } + } + + NSString *convertFIRRemoteConfigSourceToNSString(FIRRemoteConfigSource value) { + switch (value) { + case FIRRemoteConfigSourceDefault: + return @"default"; + case FIRRemoteConfigSourceRemote: + return @"remote"; + case FIRRemoteConfigSourceStatic: + return @"static"; + default: + return @"unknown"; + } + } + + NSDictionary *convertFIRRemoteConfigValueToNSDictionary(FIRRemoteConfigValue *value) { + return @{@"stringValue": (id) value.stringValue ?: [NSNull null], @"numberValue": (id) value.numberValue ?: [NSNull null], @"boolValue": @(value.boolValue), @"source": convertFIRRemoteConfigSourceToNSString(value.source)}; + } + #pragma mark - #pragma mark Module Setup @@ -32,7 +78,162 @@ return dispatch_get_main_queue(); } + + (BOOL)requiresMainQueueSetup { + return NO; + } + #pragma mark - #pragma mark Firebase Config Methods + RCT_EXPORT_METHOD(fetch: + (nonnull + NSNumber *)expirationDuration + activate: (BOOL) activate + resolver:(RCTPromiseResolveBlock)resolve + rejecter:(RCTPromiseRejectBlock)reject) { + FIRRemoteConfigFetchCompletion completionHandler = ^(FIRRemoteConfigFetchStatus status, NSError *__nullable error) { + if (error) { + [RNFBSharedUtils rejectPromiseWithUserInfo:reject userInfo:[@{@"code": convertFIRRemoteConfigFetchStatusToNSString(status), @"message": convertFIRRemoteConfigFetchStatusToNSStringDescription(status)} mutableCopy]]; + } else { + if (activate) { + resolve(@([[FIRRemoteConfig remoteConfig] activateFetched])); + } else { + resolve([NSNull null]); + } + } + }; + + if (expirationDuration == @(-1)) { + [[FIRRemoteConfig remoteConfig] fetchWithExpirationDuration:expirationDuration.doubleValue completionHandler:completionHandler]; + } else { + [[FIRRemoteConfig remoteConfig] fetchWithCompletionHandler:completionHandler]; + } + } + + RCT_EXPORT_METHOD(activateFetched: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + BOOL status = [[FIRRemoteConfig remoteConfig] activateFetched]; + resolve(@(status)); + } + + RCT_EXPORT_METHOD(getConfigSettings: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + resolve([self getConfigSettings]); + } + + RCT_EXPORT_METHOD(getValue: + (NSString *) key + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + FIRRemoteConfigValue *value = [[FIRRemoteConfig remoteConfig] configValueForKey:key]; + resolve(convertFIRRemoteConfigValueToNSDictionary(value)); + } + + RCT_EXPORT_METHOD(getValues: + (NSArray *) keys + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + NSMutableArray *valuesArray = [[NSMutableArray alloc] init]; + + for (NSString *key in keys) { + FIRRemoteConfigValue *value = [[FIRRemoteConfig remoteConfig] configValueForKey:key]; + [valuesArray addObject:convertFIRRemoteConfigValueToNSDictionary(value)]; + } + + resolve(valuesArray); + } + + RCT_EXPORT_METHOD(setConfigSettings: + (NSDictionary *) configSettings + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + FIRRemoteConfigSettings *remoteConfigSettings = [[FIRRemoteConfigSettings alloc] initWithDeveloperModeEnabled:[configSettings[@"isDeveloperModeEnabled"] boolValue]]; + [FIRRemoteConfig remoteConfig].configSettings = remoteConfigSettings; + resolve([self getConfigSettings]); + } + + RCT_EXPORT_METHOD(getKeysByPrefix: + (NSString *) prefix + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + NSSet *keys = [[FIRRemoteConfig remoteConfig] keysWithPrefix:prefix]; + + NSMutableArray *keysArray = [[NSMutableArray alloc] init]; + for (NSString *key in keys) { + [keysArray addObject:key]; + } + + resolve(keysArray); + } + + RCT_EXPORT_METHOD(getValuesByKeysPrefix: + (NSString *) prefix + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + NSSet *keys = [[FIRRemoteConfig remoteConfig] keysWithPrefix:prefix]; + NSMutableDictionary *mutableDictionary = [NSMutableDictionary dictionary]; + + for (NSString *key in keys) { + FIRRemoteConfigValue *value = [[FIRRemoteConfig remoteConfig] configValueForKey:key]; + mutableDictionary[key] = convertFIRRemoteConfigValueToNSDictionary(value); + } + + resolve(mutableDictionary); + } + + RCT_EXPORT_METHOD(setDefaults: + (NSDictionary *) defaults + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject + ) { + [[FIRRemoteConfig remoteConfig] setDefaults:defaults]; + resolve([NSNull null]); + } + + RCT_EXPORT_METHOD(setDefaultsFromResource: + (NSString *) fileName + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + if ([[NSBundle mainBundle] pathForResource:fileName ofType:@"plist"] != nil) { + [[FIRRemoteConfig remoteConfig] setDefaultsFromPlistFileName:fileName]; + resolve([NSNull null]); + } else { + [RNFBSharedUtils rejectPromiseWithUserInfo:reject userInfo:[@{@"code": @"resource_not_found", @"message": @"The specified resource name was not found."} mutableCopy]]; + } + } + +#pragma mark - +#pragma mark Internal Helper Methods + + + - (NSDictionary *)getConfigSettings { + FIRRemoteConfig *remoteConfig = [FIRRemoteConfig remoteConfig]; + BOOL isDeveloperModeEnabled = [RCTConvert BOOL:@([remoteConfig configSettings].isDeveloperModeEnabled)]; + NSString *lastFetchStatus = convertFIRRemoteConfigFetchStatusToNSString(remoteConfig.lastFetchStatus); + NSDate *lastFetchTime = remoteConfig.lastFetchTime; + return @{ + @"isDeveloperModeEnabled": @(isDeveloperModeEnabled), + @"lastFetchTime": @(round([lastFetchTime timeIntervalSince1970])), + @"lastFetchStatus": lastFetchStatus + }; + } + @end diff --git a/packages/config/lib/index.d.ts b/packages/config/lib/index.d.ts index 47421ec7..685f69c2 100644 --- a/packages/config/lib/index.d.ts +++ b/packages/config/lib/index.d.ts @@ -22,15 +22,129 @@ import { } from '@react-native-firebase/app-types'; /** - * Config + * Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your + * app without requiring users to download an app update. When using Remote Config, you create in-app default + * values that control the behavior and appearance of your app. * * @firebase config */ export namespace Config { export interface Statics {} - export interface Module extends ReactNativeFirebaseModule { + /** + * An Interface representing a Remote Config value + */ + export interface ConfigValue { + /** + * Where the value was retrieved from + */ + source: 'remote' | 'default' | 'static'; + /** + * The value + */ + value: undefined | number | boolean | string; + } + + /** + * An Interface representing multiple Config Values + */ + export interface ConfigValues { + [key: string]: ConfigValue; + } + + /** + * An Interface representing settable config settings. + */ + export interface ConfigSettingsWrite { + isDeveloperModeEnabled: boolean; + } + + /** + * An Interface representing readable config settings. + */ + export interface ConfigSettingsRead { + lastFetchTime: number; + isDeveloperModeEnabled: boolean; + lastFetchStatus: 'success' | 'failure' | 'no_fetch_yet' | 'throttled'; + } + + /** + * An Interface representing a Config Defaults object. + */ + export interface ConfigDefaults { + [key: string]: number | string | boolean; + } + + export interface Module extends ReactNativeFirebaseModule { + /** + * Moves fetched data to the apps active config. + * Always successfully resolves with a boolean value of whether the fetched config was moved successfully. + */ + activateFetched(): Promise; + + /** + * Fetches the remote config data from Firebase, defined in the dashboard. If duration is defined (seconds), data will be locally cached for this duration. + * + * @param cacheExpirationSeconds Duration in seconds to cache the data for. To force a cache use a duration of 0. + */ + fetch(cacheExpirationSeconds?: number): Promise; + + /** + * Fetches the remote config data from Firebase, defined in the dashboard. If duration is defined (seconds), data will be locally cached for this duration. + * + * Once fetching is completely this method immediately calls activateFetched on native and returns a boolean value of activation status. + * + * @param cacheExpirationSeconds Duration in seconds to cache the data for. To force a cache use a duration of 0. + */ + fetchAndActivate(cacheExpirationSeconds?: number): Promise; + + /** + * Retrieve the configuration settings and status for Remote Config. + */ + getConfigSettings(): Promise; + + /** + * Returns all keys matching the prefix as an array. If no prefix is defined all keys are returned. + * + * @param prefix + */ + getKeysByPrefix(prefix?: string): Promise; + + /** + * Returns all config values for the keys matching the prefix provided. In no prefix is provided all values are returned. + * + * @param prefix + */ + getValuesByKeysPrefix(prefix?: string): Promise; + + /** + * Gets a ConfigValue by key. + * + * @param key + */ + getValue(key: string): Promise; + + /** + * Set the Remote Config settings, specifically the `isDeveloperModeEnabled` flag. + */ + setConfigSettings(configSettings: ConfigSettingsWrite): Promise; + + /** + * Sets default values for the app to use when accessing values. + * Any data fetched and activated will override any default values. Any values in the defaults but not on Firebase will be untouched. + * + */ + setDefaults(defaults: ConfigDefaults): Promise; + + /** + * Sets the default values from a resource file. + * On iOS this is a plist file and on Android this is an XML defaultsMap file. + * TODO(ehesp): insert link to guide here somehow? + * + * @param resourceName The plist/xml file name with no extension. + */ + setDefaultsFromResource(resourceName: string): Promise; } } @@ -48,10 +162,7 @@ declare module '@react-native-firebase/config' { */ export const firebase = FirebaseNamespaceExport; - const ConfigDefaultExport: ReactNativeFirebaseModuleAndStatics< - Config.Module, - Config.Statics - >; + const ConfigDefaultExport: ReactNativeFirebaseModuleAndStatics; /** * @example * ```js @@ -68,17 +179,18 @@ declare module '@react-native-firebase/config' { declare module '@react-native-firebase/app-types' { interface ReactNativeFirebaseNamespace { /** - * Config + * Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your + * app without requiring users to download an app update. When using Remote Config, you create in-app default + * values that control the behavior and appearance of your app. */ - config: ReactNativeFirebaseModuleAndStatics< - Config.Module, - Config.Statics - >; + config: ReactNativeFirebaseModuleAndStatics; } interface FirebaseApp { /** - * Config + * Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your + * app without requiring users to download an app update. When using Remote Config, you create in-app default + * values that control the behavior and appearance of your app. */ config(): Config.Module; } diff --git a/packages/config/lib/index.js b/packages/config/lib/index.js index 648c4c57..82ca40e3 100644 --- a/packages/config/lib/index.js +++ b/packages/config/lib/index.js @@ -20,7 +20,15 @@ import { FirebaseModule, getFirebaseRoot, } from '@react-native-firebase/app/lib/internal'; - +import { + hasOwnProperty, + isNumber, + isString, + isBoolean, + isArray, + isUndefined, + isObject, +} from '@react-native-firebase/common'; import version from './version'; const statics = {}; @@ -29,8 +37,221 @@ const namespace = 'config'; const nativeModuleName = 'RNFBConfigModule'; -class FirebaseConfigModule extends FirebaseModule { +/** + * + * @param nativeValue + * @returns {*} + */ +function nativeValueToJS(nativeValue) { + return { + source: nativeValue.source, + get value() { + const { boolValue, stringValue, numberValue } = nativeValue; + // undefined + if (boolValue === false && numberValue === 0 && !stringValue.length) { + return undefined; + } + + // boolean + if ( + boolValue !== null && + (stringValue === 'true' || stringValue === 'false' || stringValue === null) + ) { + return boolValue; + } + + // number + if ( + numberValue !== null && + numberValue !== undefined && + (stringValue == null || stringValue === '' || numberValue.toString() === stringValue || parseInt(stringValue, 10) === numberValue) + ) { + return numberValue; + } + + // string + return stringValue; + }, + }; +} + +class FirebaseConfigModule extends FirebaseModule { + /** + * Activates the Fetched Config, so that the fetched key-values take effect. + * @returns {Promise} + */ + activateFetched() { + return this.native.activateFetched(); + } + + /** + * Fetches parameter values for your app. + + * @param {number} cacheExpirationSeconds + * @returns {Promise} + */ + fetch(cacheExpirationSeconds) { + if (!isUndefined(cacheExpirationSeconds) && !isNumber(cacheExpirationSeconds)) { + throw new Error( + `firebase.config().fetch(): 'cacheExpirationSeconds' must be a number value.`, + ); + } + + return this.native.fetch(cacheExpirationSeconds !== undefined ? cacheExpirationSeconds : -1, false); + } + + /** + * TODO(salakar) return boolean always? + * @param cacheExpirationSeconds + * @returns {Promise|never|Promise} + */ + fetchAndActivate(cacheExpirationSeconds) { + if (!isUndefined(cacheExpirationSeconds) && !isNumber(cacheExpirationSeconds)) { + throw new Error( + `firebase.config().fetchAndActivate(): 'cacheExpirationSeconds' must be a number value.`, + ); + } + + return this.native.fetch(cacheExpirationSeconds !== undefined ? cacheExpirationSeconds : -1, true); + } + + /** + * Returns FirebaseRemoteConfig singleton + * lastFetchTime, + * lastFetchStatus. + * isDeveloperModeEnabled + * @returns {Object} + */ + getConfigSettings() { + return this.native.getConfigSettings(); + } + + /** + * Gets the set of keys that start with the given prefix. + * + * @param {string} prefix + * @returns {string[]} + */ + getKeysByPrefix(prefix) { + if (!isUndefined(prefix) && !isString(prefix)) { + throw new Error(`firebase.config().getKeysByPrefix(): 'prefix' must be a string value.`); + } + + return this.native.getKeysByPrefix(prefix); + } + + /** + * + * @param prefix + * @returns {Promise} + */ + async getValuesByKeysPrefix(prefix) { + if (!isUndefined(prefix) && !isString(prefix)) { + throw new Error( + `firebase.config().getValuesByKeysPrefix(): 'prefix' must be a string value.`, + ); + } + + const output = {}; + const entries = Object.entries(await this.native.getValuesByKeysPrefix(prefix)); + + for (let i = 0; i < entries.length; i++) { + const [key, value] = entries[i]; + output[key] = nativeValueToJS(value); + } + + return output; + } + + /** + * Gets the FirebaseRemoteConfigValue corresponding to the specified key. + * + * @param {string} key + */ + async getValue(key) { + if (!isString(key)) { + throw new Error(`firebase.config().getValue(): 'key' must be a string value.`); + } + + return nativeValueToJS(await this.native.getValue(key)); + } + + /** + * Gets the FirebaseRemoteConfigValue array corresponding to the specified keys. + * + * @param keys + */ + async getValues(keys) { + if (!isArray(keys) || !keys.length) { + throw new Error(`firebase.config().getValues(): 'keys' must be an non empty array.`); + } + + if (!isString(keys[0])) { + throw new Error(`firebase.config().getValues(): 'keys' must be an array of strings.`); + } + + const valuesObject = {}; + const keyValues = await this.native.getValues(keys); + + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + valuesObject[key] = nativeValueToJS(keyValues[i]); + } + + return valuesObject; + } + + /** + * Changes the settings for the FirebaseRemoteConfig object's operations, + * such as turning the developer mode on. + * @param {object} settings + * @description Android & iOS + */ + setConfigSettings(settings = {}) { + if (!isObject(settings) || !hasOwnProperty(settings, 'isDeveloperModeEnabled')) { + throw new Error( + `firebase.config().setConfigSettings(): 'settings' must be an object with a 'isDeveloperModeEnabled' key.`, + ); + } + + if (!isBoolean(settings.isDeveloperModeEnabled)) { + throw new Error( + `firebase.config().setConfigSettings(): 'settings.isDeveloperModeEnabled' must be a boolean value.`, + ); + } + + return this.native.setConfigSettings(settings); + } + + /** + * Sets defaults. + * + * @param {object} defaults + */ + setDefaults(defaults) { + if (!isObject(defaults)) { + throw new Error( + `firebase.config().setDefaults(): 'defaults' must be an object.`, + ); + } + + return this.native.setDefaults(defaults); + } + + /** + * Sets defaults based on resource. + * @param {string} resourceName + */ + setDefaultsFromResource(resourceName) { + if (!isString(resourceName)) { + throw new Error( + `firebase.config().setDefaultsFromResource(): 'resourceName' must be a string value.`, + ); + } + + return this.native.setDefaultsFromResource(resourceName); + } } // import { SDK_VERSION } from '@react-native-firebase/config'; diff --git a/packages/config/lib/index.js.flow b/packages/config/lib/index.js.flow index 67ec7aeb..c8e6a065 100644 --- a/packages/config/lib/index.js.flow +++ b/packages/config/lib/index.js.flow @@ -20,8 +20,120 @@ import type { ReactNativeFirebaseModule } from '@react-native-firebase/app-types export interface Statics {} -export interface Module extends ReactNativeFirebaseModule { +/** + * An Interface representing a Remote Config value + */ +export interface ConfigValue { + /** + * Where the value was retrieved from + */ + source: 'remote' | 'default' | 'static'; + /** + * The value + */ + value: undefined | number | boolean | string; +} + +/** + * An Interface representing multiple Config Values + */ +export interface ConfigValues { + [key: string]: ConfigValue; +} + +/** + * An Interface representing settable config settings. + */ +export interface ConfigSettingsWrite { + isDeveloperModeEnabled: boolean; +} + +/** + * An Interface representing readable config settings. + */ +export interface ConfigSettingsRead { + lastFetchTime: number; + isDeveloperModeEnabled: boolean; + lastFetchStatus: 'success' | 'failure' | 'no_fetch_yet' | 'throttled'; +} + +/** + * An Interface representing a Config Defaults object. + */ +export interface ConfigDefaults { + [key: string]: number | string | boolean; +} + +export interface Module extends ReactNativeFirebaseModule { + /** + * Moves fetched data to the apps active config. + * Always successfully resolves with a boolean value of whether the fetched config was moved successfully. + */ + activateFetched(): Promise; + + /** + * Fetches the remote config data from Firebase, defined in the dashboard. If duration is defined (seconds), data will be locally cached for this duration. + * + * @param cacheExpirationSeconds Duration in seconds to cache the data for. To force a cache use a duration of 0. + */ + fetch(cacheExpirationSeconds?: number): Promise; + + /** + * Fetches the remote config data from Firebase, defined in the dashboard. If duration is defined (seconds), data will be locally cached for this duration. + * + * Once fetching is completely this method immediately calls activateFetched on native and returns a boolean value of activation status. + * + * @param cacheExpirationSeconds Duration in seconds to cache the data for. To force a cache use a duration of 0. + */ + fetchAndActivate(cacheExpirationSeconds?: number): Promise; + + /** + * Retrieve the configuration settings and status for Remote Config. + */ + getConfigSettings(): Promise; + + /** + * Returns all keys matching the prefix as an array. If no prefix is defined all keys are returned. + * + * @param prefix + */ + getKeysByPrefix(prefix?: string): Promise; + + /** + * Returns all config values for the keys matching the prefix provided. In no prefix is provided all values are returned. + * + * @param prefix + */ + getValuesByKeysPrefix(prefix?: string): Promise; + + /** + * Gets a ConfigValue by key. + * + * @param key + */ + getValue(key: string): Promise; + + /** + * Set the Remote Config settings, specifically the `isDeveloperModeEnabled` flag. + */ + setConfigSettings(configSettings: ConfigSettingsWrite): Promise; + + /** + * Sets default values for the app to use when accessing values. + * Any data fetched and activated will override any default values. Any values in the defaults but not on Firebase will be untouched. + * + */ + setDefaults(defaults: ConfigDefaults): Promise; + + /** + * Sets the default values from a resource file. + * On iOS this is a plist file and on Android this is an XML defaultsMap file. + * TODO(ehesp): insert link to guide here somehow? + * + * @param resourceName The plist/xml file name with no extension. + */ + setDefaultsFromResource(resourceName: string): Promise; } declare module '@react-native-firebase/config' { diff --git a/packages/crashlytics/android/build.gradle b/packages/crashlytics/android/build.gradle index 8d18a6a4..57c6521b 100644 --- a/packages/crashlytics/android/build.gradle +++ b/packages/crashlytics/android/build.gradle @@ -56,7 +56,7 @@ repositories { } dependencies { - api project(':@react-native-firebase/app') + api project(':@react-native-firebase_app') implementation "com.crashlytics.sdk.android:crashlytics:${ReactNative.ext.getVersion("fabric", "crashlytics")}" implementation "com.crashlytics.sdk.android:crashlytics-ndk:${ReactNative.ext.getVersion("fabric", "crashlyticsNdk")}" implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}" diff --git a/packages/crashlytics/android/settings.gradle b/packages/crashlytics/android/settings.gradle index b34fa0e3..883fd489 100644 --- a/packages/crashlytics/android/settings.gradle +++ b/packages/crashlytics/android/settings.gradle @@ -1 +1 @@ -rootProject.name = '@react-native-firebase/crashlytics' +rootProject.name = '@react-native-firebase_crashlytics' diff --git a/packages/fiam/android/build.gradle b/packages/fiam/android/build.gradle index c9868c5d..3b5cc5a7 100644 --- a/packages/fiam/android/build.gradle +++ b/packages/fiam/android/build.gradle @@ -55,7 +55,7 @@ repositories { } dependencies { - api project(':@react-native-firebase/app') + api project(':@react-native-firebase_app') implementation "com.google.firebase:firebase-inappmessaging-display:${ReactNative.ext.getVersion("firebase", "fiam")}" implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}" } diff --git a/packages/fiam/android/settings.gradle b/packages/fiam/android/settings.gradle index ea6834cc..53adc6f5 100644 --- a/packages/fiam/android/settings.gradle +++ b/packages/fiam/android/settings.gradle @@ -1 +1 @@ -rootProject.name = '@react-native-firebase/fiam' +rootProject.name = '@react-native-firebase_fiam' diff --git a/packages/firestore/android/build.gradle b/packages/firestore/android/build.gradle index 52c85728..a475ce10 100644 --- a/packages/firestore/android/build.gradle +++ b/packages/firestore/android/build.gradle @@ -55,7 +55,7 @@ repositories { } dependencies { - api project(':@react-native-firebase/app') + api project(':@react-native-firebase_app') implementation "com.google.firebase:firebase-firestore:${ReactNative.ext.getVersion("firebase", "firestore")}" implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}" } diff --git a/packages/firestore/android/settings.gradle b/packages/firestore/android/settings.gradle index 7d9aba3d..e48335db 100644 --- a/packages/firestore/android/settings.gradle +++ b/packages/firestore/android/settings.gradle @@ -1 +1 @@ -rootProject.name = '@react-native-firebase/firestore' +rootProject.name = '@react-native-firebase_firestore' diff --git a/packages/functions/android/build.gradle b/packages/functions/android/build.gradle index 4bf077c4..7971906b 100644 --- a/packages/functions/android/build.gradle +++ b/packages/functions/android/build.gradle @@ -55,7 +55,7 @@ repositories { } dependencies { - api project(':@react-native-firebase/app') + api project(':@react-native-firebase_app') implementation "com.google.firebase:firebase-functions:${ReactNative.ext.getVersion("firebase", "functions")}" implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}" } diff --git a/packages/functions/android/settings.gradle b/packages/functions/android/settings.gradle index 8babe47c..70a5fd0d 100644 --- a/packages/functions/android/settings.gradle +++ b/packages/functions/android/settings.gradle @@ -1 +1 @@ -rootProject.name = '@react-native-firebase/functions' +rootProject.name = '@react-native-firebase_functions' diff --git a/packages/iid/android/build.gradle b/packages/iid/android/build.gradle index 75e66133..a8e748aa 100644 --- a/packages/iid/android/build.gradle +++ b/packages/iid/android/build.gradle @@ -55,7 +55,7 @@ repositories { } dependencies { - api project(':@react-native-firebase/app') + api project(':@react-native-firebase_app') implementation "com.google.firebase:firebase-iid:${ReactNative.ext.getVersion("firebase", "iid")}" implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}" } diff --git a/packages/iid/android/settings.gradle b/packages/iid/android/settings.gradle index f65c643c..219a92b6 100644 --- a/packages/iid/android/settings.gradle +++ b/packages/iid/android/settings.gradle @@ -1 +1 @@ -rootProject.name = '@react-native-firebase/iid' +rootProject.name = '@react-native-firebase_iid' diff --git a/packages/mlkit/android/build.gradle b/packages/mlkit/android/build.gradle index 797cf48c..dbab1e5f 100644 --- a/packages/mlkit/android/build.gradle +++ b/packages/mlkit/android/build.gradle @@ -57,7 +57,7 @@ repositories { } dependencies { - api project(':@react-native-firebase/app') + api project(':@react-native-firebase_app') implementation "com.google.firebase:firebase-ml-common:${ReactNative.ext.getVersion("firebase", "mlkitCommon")}" implementation "com.google.firebase:firebase-ml-vision:${ReactNative.ext.getVersion("firebase", "mlkitVision")}" implementation "com.google.firebase:firebase-ml-natural-language:${ReactNative.ext.getVersion("firebase", "mlkitNaturalLanguage")}" diff --git a/packages/mlkit/android/settings.gradle b/packages/mlkit/android/settings.gradle index 7378cc7f..6f4bb007 100644 --- a/packages/mlkit/android/settings.gradle +++ b/packages/mlkit/android/settings.gradle @@ -1 +1 @@ -rootProject.name = '@react-native-firebase/mlkit' +rootProject.name = '@react-native-firebase_mlkit' diff --git a/packages/perf/android/build.gradle b/packages/perf/android/build.gradle index f68ff643..c584348a 100644 --- a/packages/perf/android/build.gradle +++ b/packages/perf/android/build.gradle @@ -55,7 +55,7 @@ repositories { } dependencies { - api project(':@react-native-firebase/app') + api project(':@react-native-firebase_app') implementation "com.google.firebase:firebase-perf:${ReactNative.ext.getVersion("firebase", "perf")}" implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}" } diff --git a/packages/perf/android/settings.gradle b/packages/perf/android/settings.gradle index cfe9204c..38e72f01 100644 --- a/packages/perf/android/settings.gradle +++ b/packages/perf/android/settings.gradle @@ -1 +1 @@ -rootProject.name = '@react-native-firebase/perf' +rootProject.name = '@react-native-firebase_perf' diff --git a/packages/utils/android/build.gradle b/packages/utils/android/build.gradle index b9203ff6..458eae34 100644 --- a/packages/utils/android/build.gradle +++ b/packages/utils/android/build.gradle @@ -51,7 +51,7 @@ repositories { } dependencies { - api project(':@react-native-firebase/app') + api project(':@react-native-firebase_app') implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}" } diff --git a/packages/utils/android/settings.gradle b/packages/utils/android/settings.gradle index 27e54a0e..b642a8d4 100644 --- a/packages/utils/android/settings.gradle +++ b/packages/utils/android/settings.gradle @@ -1 +1 @@ -rootProject.name = '@react-native-firebase/utils' +rootProject.name = '@react-native-firebase_utils' diff --git a/scripts/_TEMPLATE_/android/build.gradle b/scripts/_TEMPLATE_/android/build.gradle index db8669f2..639742c5 100644 --- a/scripts/_TEMPLATE_/android/build.gradle +++ b/scripts/_TEMPLATE_/android/build.gradle @@ -55,7 +55,7 @@ repositories { } dependencies { - api project(':@react-native-firebase/app') + api project(':@react-native-firebase_app') implementation "com.google.firebase:firebase-_template_:${ReactNative.ext.getVersion("firebase", "_template_")}" implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}" } diff --git a/scripts/_TEMPLATE_/android/settings.gradle b/scripts/_TEMPLATE_/android/settings.gradle index 94470f68..72ee7319 100644 --- a/scripts/_TEMPLATE_/android/settings.gradle +++ b/scripts/_TEMPLATE_/android/settings.gradle @@ -1 +1 @@ -rootProject.name = '@react-native-firebase/_template_' +rootProject.name = '@react-native-firebase__template_' diff --git a/tests/android/app/build.gradle b/tests/android/app/build.gradle index 74c03b7d..7dad4dcc 100755 --- a/tests/android/app/build.gradle +++ b/tests/android/app/build.gradle @@ -74,6 +74,12 @@ android { matchingFallbacks = ['debug'] } } + + compileOptions { + sourceCompatibility 1.8 + targetCompatibility 1.8 + } + // applicationVariants are e.g. debug, release applicationVariants.all { variant -> variant.outputs.each { output -> @@ -109,7 +115,7 @@ dependencies { * ---------------------------- */ firebasePackages.each { firebasePackage -> - implementation project(path: ":@react-native-firebase/${firebasePackage}") + implementation project(path: ":@react-native-firebase_${firebasePackage}") } /* ------------------------ diff --git a/tests/android/app/src/main/res/xml/remote_config_resource_test.xml b/tests/android/app/src/main/res/xml/remote_config_resource_test.xml new file mode 100644 index 00000000..235b3d60 --- /dev/null +++ b/tests/android/app/src/main/res/xml/remote_config_resource_test.xml @@ -0,0 +1,7 @@ + + + + company + invertase + + diff --git a/tests/android/gradle.properties b/tests/android/gradle.properties index 95445a85..10daad35 100755 --- a/tests/android/gradle.properties +++ b/tests/android/gradle.properties @@ -9,7 +9,7 @@ # Default value: -Xmx10248m -XX:MaxPermSize=256m org.gradle.daemon=true org.gradle.caching=true -org.gradle.parallel=true +org.gradle.parallel=false org.gradle.configureondemand=true org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 # When configured, Gradle will run in incubating parallel mode. diff --git a/tests/android/settings.gradle b/tests/android/settings.gradle index cab4c001..69aeb0fe 100755 --- a/tests/android/settings.gradle +++ b/tests/android/settings.gradle @@ -1,4 +1,4 @@ -rootProject.name = '@react-native-firebase/tests' +rootProject.name = '@react-native-firebase_tests' def firebasePackages = [ 'app', @@ -14,8 +14,8 @@ def firebasePackages = [ ] firebasePackages.each { firebasePackage -> - include ":@react-native-firebase/${firebasePackage}" - project(":@react-native-firebase/${firebasePackage}").projectDir = new File(rootProject.projectDir, "./../../packages/${firebasePackage}/android") + include ":@react-native-firebase_${firebasePackage}" + project(":@react-native-firebase_${firebasePackage}").projectDir = new File(rootProject.projectDir, "./../../packages/${firebasePackage}/android") } include ':jet' diff --git a/tests/e2e/helpers.js b/tests/e2e/helpers.js index 2af2be00..2b52029d 100644 --- a/tests/e2e/helpers.js +++ b/tests/e2e/helpers.js @@ -38,6 +38,12 @@ function requirePackageTests(packageName) { } } +Object.defineProperty(global, 'A2A', { + get() { + return require('a2a'); + }, +}); + Object.defineProperty(global, 'firebase', { get() { return jet.module; diff --git a/tests/e2e/mocha.opts b/tests/e2e/mocha.opts index ab5f3dc8..94930d7a 100755 --- a/tests/e2e/mocha.opts +++ b/tests/e2e/mocha.opts @@ -2,7 +2,7 @@ --timeout 260000 --reporter spec --slow 1000 ---retries 3 +--retries 1 --bail --exit --require jet/platform/node diff --git a/tests/ios/Podfile.lock b/tests/ios/Podfile.lock index f9d1dd75..3787d443 100644 --- a/tests/ios/Podfile.lock +++ b/tests/ios/Podfile.lock @@ -21,6 +21,9 @@ PODS: - Firebase/Performance (5.17.0): - Firebase/Core - FirebasePerformance (= 2.2.3) + - Firebase/RemoteConfig (5.17.0): + - Firebase/Core + - FirebaseRemoteConfig (= 3.1.0) - FirebaseABTesting (2.0.0): - FirebaseCore (~> 5.0) - Protobuf (~> 3.5) @@ -170,6 +173,11 @@ PODS: - Firebase/Auth (~> 5.17.0) - Firebase/Core (~> 5.17.0) - React + - RNFBConfig (6.0.0-alpha.5): + - Firebase/Core (~> 5.17.0) + - Firebase/RemoteConfig (~> 5.17.0) + - React + - RNFBApp - RNFBCrashlytics (6.0.0-alpha.5): - Crashlytics (~> 3.12.0) - Fabric (~> 1.9.0) @@ -218,6 +226,7 @@ DEPENDENCIES: - React/RCTWebSocket (from `../node_modules/react-native`) - "RNFBAnalytics (from `../node_modules/@react-native-firebase/analytics/ios`)" - "RNFBApp (from `../node_modules/@react-native-firebase/app/ios`)" + - "RNFBConfig (from `../node_modules/@react-native-firebase/config/ios`)" - "RNFBCrashlytics (from `../node_modules/@react-native-firebase/crashlytics/ios`)" - "RNFBFiam (from `../node_modules/@react-native-firebase/fiam/ios`)" - "RNFBFirestore (from `../node_modules/@react-native-firebase/firestore/ios`)" @@ -266,6 +275,8 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-firebase/analytics/ios" RNFBApp: :path: "../node_modules/@react-native-firebase/app/ios" + RNFBConfig: + :path: "../node_modules/@react-native-firebase/config/ios" RNFBCrashlytics: :path: "../node_modules/@react-native-firebase/crashlytics/ios" RNFBFiam: @@ -312,6 +323,7 @@ SPEC CHECKSUMS: React: 1d605e098d69bdf08960787f3446f0a9dc2e2ccf RNFBAnalytics: 61b9d722deb136454425850860df910250a1874d RNFBApp: ea2649b5993bec4ef4ff5ed4cb29454328e78b74 + RNFBConfig: 7804a2113cb720f6819c3b289a1bee8342b82aad RNFBCrashlytics: b7ec197ade3caaa6060525b506fd2ff65b529a4c RNFBFiam: 7ea892c593296cfb74bced95d96717c991233c69 RNFBFirestore: 5cc04b0781abd2a0c339738dcc56fc76a5930ac0 diff --git a/tests/ios/remote_config_resource_test.plist b/tests/ios/remote_config_resource_test.plist new file mode 100644 index 00000000..823a1941 --- /dev/null +++ b/tests/ios/remote_config_resource_test.plist @@ -0,0 +1,8 @@ + + + + + company + invertase + + diff --git a/tests/ios/testing.xcodeproj/project.pbxproj b/tests/ios/testing.xcodeproj/project.pbxproj index 7dd977b8..43fa857e 100644 --- a/tests/ios/testing.xcodeproj/project.pbxproj +++ b/tests/ios/testing.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 271CB185206AFCD300EBADF4 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 271CB184206AFCD300EBADF4 /* GoogleService-Info.plist */; }; + 27CE6A36224923D200222E16 /* remote_config_resource_test.plist in Resources */ = {isa = PBXBuildFile; fileRef = 27CE6A35224923D200222E16 /* remote_config_resource_test.plist */; }; 3323F06104C7189BEC46D8B5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3323FFA47718EA67C36AD776 /* Images.xcassets */; }; E31DA68013C367A4C7A4C7C7 /* Pods_testing.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0468979958B59C09A7C97954 /* Pods_testing.framework */; }; /* End PBXBuildFile section */ @@ -40,6 +41,7 @@ 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = testing/main.m; sourceTree = ""; }; 27034D93212869A1004B697E /* testing.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = testing.entitlements; path = testing/testing.entitlements; sourceTree = ""; }; 271CB184206AFCD300EBADF4 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; + 27CE6A35224923D200222E16 /* remote_config_resource_test.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = remote_config_resource_test.plist; sourceTree = ""; }; 30F8459A53F04DD0B22777D1 /* testing.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; path = testing.xcodeproj; sourceTree = ""; }; 3323FFA47718EA67C36AD776 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = testing/Images.xcassets; sourceTree = ""; }; 4C4B32475FBBBAC16708CB5B /* Pods-testing.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-testing.debug.xcconfig"; path = "Pods/Target Support Files/Pods-testing/Pods-testing.debug.xcconfig"; sourceTree = ""; }; @@ -85,6 +87,7 @@ 13B07FB61A68108700A75B9A /* Info.plist */, 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 13B07FB71A68108700A75B9A /* main.m */, + 27CE6A35224923D200222E16 /* remote_config_resource_test.plist */, ); name = testing; sourceTree = ""; @@ -227,6 +230,7 @@ files = ( 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 271CB185206AFCD300EBADF4 /* GoogleService-Info.plist in Resources */, + 27CE6A36224923D200222E16 /* remote_config_resource_test.plist in Resources */, 3323F06104C7189BEC46D8B5 /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/tests/package.json b/tests/package.json index 910253ad..ff0dd596 100755 --- a/tests/package.json +++ b/tests/package.json @@ -34,6 +34,7 @@ "sinon": "^6.2.0" }, "devDependencies": { + "a2a": "^0.2.0", "@react-native-firebase/private-tests-helpers": "^0.0.8", "babel-plugin-istanbul": "^5.1.1", "nyc": "^13.1.0", diff --git a/tests/type-test.ts b/tests/type-test.ts index 3f1dcc75..5272b10f 100644 --- a/tests/type-test.ts +++ b/tests/type-test.ts @@ -1,28 +1,17 @@ -import firebase from 'react-native-firebase'; -import '@react-native-firebase/iid'; -import analytics, { Analytics } from '@react-native-firebase/analytics'; -import functions, { - firebase as boopy, - Functions, - HttpsErrorCode, -} from '@react-native-firebase/functions'; +import '@react-native-firebase/config'; +import '@react-native-firebase/functions'; +import { firebase } from '@react-native-firebase/analytics'; -boopy.apps[0].options.projectId; -analytics.SDK_VERSION; -functions.SDK_VERSION; -const httpsCallable = firebase.functions(firebase.app()).httpsCallable('foo'); -functions; +async () => { + await firebase.config().activateFetched(); + await firebase.config().fetch(0); + await firebase.config().fetch(); -firebase.iid().get(); -firebase.analytics().resetAnalyticsData(); + const settings = await firebase.config().getConfigSettings(); + console.log(settings.isDeveloperModeEnabled); + console.log(settings.lastFetchStatus); + console.log(settings.lastFetchTime); -httpsCallable({ foo: 1 }) - .then(result => { - result.data; - }) - .catch((error: Functions.HttpsError) => { - const foo = {} as Analytics.Module; - error.details; - foo.logEvent('shoopy', {}); - HttpsErrorCode.NOT_FOUND; - }); + await firebase.config().setConfigSettings({ isDeveloperModeEnabled: false }); + await firebase.config().setDefaults({ foo: null }); +}; diff --git a/yarn.lock b/yarn.lock index b841a202..9f19bd5d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1488,6 +1488,11 @@ JSONStream@^1.0.4, JSONStream@^1.3.4: jsonparse "^1.2.0" through ">=2.2.7 <3" +a2a@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/a2a/-/a2a-0.2.0.tgz#32bcbc13457636a9cd37f0c3674778120e3a847c" + integrity sha512-zacbQ73PcKwlC4dFqaD5GDvluv2I7owHYELi6PCDERcZVFm0LNuhWGm1CKwtxcxEF7SmQXVF342wBKO8xAayMg== + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"