@react-native-firebase/installations 21.7.3 → 21.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/lib/modular/index.js +7 -8
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/__tests__/installations.test.ts +0 -69
- package/type-test.ts +0 -19
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,19 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [21.8.0](https://github.com/invertase/react-native-firebase/compare/v21.7.4...v21.8.0) (2025-02-10)
|
7
|
+
|
8
|
+
### Bug Fixes
|
9
|
+
|
10
|
+
- do not ship types tests with released packages ([a870cf7](https://github.com/invertase/react-native-firebase/commit/a870cf749687ad2bd6a7a027540bdf29beeaffaa))
|
11
|
+
- do not ship unit tests in released packages ([e71dadf](https://github.com/invertase/react-native-firebase/commit/e71dadfc1c0cad2e89c94100913af31ddf7d9c91))
|
12
|
+
|
13
|
+
## [21.7.4](https://github.com/invertase/react-native-firebase/compare/v21.7.3...v21.7.4) (2025-02-08)
|
14
|
+
|
15
|
+
### Bug Fixes
|
16
|
+
|
17
|
+
- the init calls for modular should use modular getApp() ([79da98b](https://github.com/invertase/react-native-firebase/commit/79da98bf4ecf7860db61b2813b87673f1cd0adfd))
|
18
|
+
|
6
19
|
## [21.7.3](https://github.com/invertase/react-native-firebase/compare/v21.7.2...v21.7.3) (2025-02-08)
|
7
20
|
|
8
21
|
**Note:** Version bump only for package @react-native-firebase/installations
|
package/lib/modular/index.js
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
*
|
16
16
|
*/
|
17
17
|
|
18
|
-
import {
|
18
|
+
import { getApp } from '@react-native-firebase/app';
|
19
19
|
|
20
20
|
/**
|
21
21
|
* @typedef {import('..').FirebaseInstallationsTypes.Module} FirebaseInstallation
|
@@ -23,9 +23,9 @@ import { firebase } from '..';
|
|
23
23
|
|
24
24
|
export function getInstallations(app) {
|
25
25
|
if (app) {
|
26
|
-
return
|
26
|
+
return getApp(app.name).installations();
|
27
27
|
}
|
28
|
-
return
|
28
|
+
return getApp().installations();
|
29
29
|
}
|
30
30
|
|
31
31
|
/**
|
@@ -33,7 +33,7 @@ export function getInstallations(app) {
|
|
33
33
|
* @returns {Promise<void>}
|
34
34
|
*/
|
35
35
|
export function deleteInstallations(installations) {
|
36
|
-
return
|
36
|
+
return installations.delete();
|
37
37
|
}
|
38
38
|
|
39
39
|
/**
|
@@ -41,7 +41,7 @@ export function deleteInstallations(installations) {
|
|
41
41
|
* @returns {Promise<string>}
|
42
42
|
*/
|
43
43
|
export function getId(installations) {
|
44
|
-
return
|
44
|
+
return installations.getId();
|
45
45
|
}
|
46
46
|
|
47
47
|
/**
|
@@ -50,7 +50,7 @@ export function getId(installations) {
|
|
50
50
|
* @returns {Promise<string>}
|
51
51
|
*/
|
52
52
|
export function getToken(installations, forceRefresh) {
|
53
|
-
return
|
53
|
+
return installations.getToken(forceRefresh);
|
54
54
|
}
|
55
55
|
|
56
56
|
/**
|
@@ -58,7 +58,6 @@ export function getToken(installations, forceRefresh) {
|
|
58
58
|
* @param {(string) => void} callback
|
59
59
|
* @returns {() => void}
|
60
60
|
*/
|
61
|
-
|
62
|
-
export function onIdChange(installations, callback) {
|
61
|
+
export function onIdChange(_installations, _callback) {
|
63
62
|
throw new Error('onIdChange() is unsupported by the React Native Firebase SDK.');
|
64
63
|
}
|
package/lib/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
// Generated by genversion.
|
2
|
-
module.exports = '21.
|
2
|
+
module.exports = '21.8.0';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-native-firebase/installations",
|
3
|
-
"version": "21.
|
3
|
+
"version": "21.8.0",
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
5
5
|
"description": "React Native Firebase - Installations",
|
6
6
|
"main": "lib/index.js",
|
@@ -22,10 +22,10 @@
|
|
22
22
|
"installations"
|
23
23
|
],
|
24
24
|
"peerDependencies": {
|
25
|
-
"@react-native-firebase/app": "21.
|
25
|
+
"@react-native-firebase/app": "21.8.0"
|
26
26
|
},
|
27
27
|
"publishConfig": {
|
28
28
|
"access": "public"
|
29
29
|
},
|
30
|
-
"gitHead": "
|
30
|
+
"gitHead": "14ebd5c2d2e0f284397c331f909e533c47f2ec62"
|
31
31
|
}
|
@@ -1,69 +0,0 @@
|
|
1
|
-
import { describe, expect, it } from '@jest/globals';
|
2
|
-
|
3
|
-
import {
|
4
|
-
firebase,
|
5
|
-
getInstallations,
|
6
|
-
deleteInstallations,
|
7
|
-
getId,
|
8
|
-
getToken,
|
9
|
-
onIdChange,
|
10
|
-
} from '../lib';
|
11
|
-
|
12
|
-
describe('installations()', function () {
|
13
|
-
describe('namespace', function () {
|
14
|
-
it('accessible from firebase.app()', function () {
|
15
|
-
const app = firebase.app();
|
16
|
-
expect(app.installations).toBeDefined();
|
17
|
-
expect(app.installations().app).toEqual(app);
|
18
|
-
});
|
19
|
-
|
20
|
-
it('supports multiple apps', async function () {
|
21
|
-
expect(firebase.installations().app.name).toEqual('[DEFAULT]');
|
22
|
-
expect(firebase.installations(firebase.app('secondaryFromNative')).app.name).toEqual(
|
23
|
-
'secondaryFromNative',
|
24
|
-
);
|
25
|
-
expect(firebase.app('secondaryFromNative').installations().app.name).toEqual(
|
26
|
-
'secondaryFromNative',
|
27
|
-
);
|
28
|
-
});
|
29
|
-
});
|
30
|
-
|
31
|
-
describe('modular', function () {
|
32
|
-
it('`getInstallations` function is properly exposed to end user', function () {
|
33
|
-
expect(getInstallations).toBeDefined();
|
34
|
-
});
|
35
|
-
|
36
|
-
it('`deleteInstallations` function is properly exposed to end user', function () {
|
37
|
-
expect(deleteInstallations).toBeDefined();
|
38
|
-
});
|
39
|
-
|
40
|
-
it('`getId` function is properly exposed to end user', function () {
|
41
|
-
expect(getId).toBeDefined();
|
42
|
-
});
|
43
|
-
|
44
|
-
it('`getToken` function is properly exposed to end user', function () {
|
45
|
-
expect(getToken).toBeDefined();
|
46
|
-
});
|
47
|
-
|
48
|
-
it('`onIdChange` function is properly exposed to end user', function () {
|
49
|
-
expect(onIdChange).toBeDefined();
|
50
|
-
});
|
51
|
-
|
52
|
-
describe('getInstallations', function () {
|
53
|
-
it('returns an instance of Installations', async function () {
|
54
|
-
const installations = getInstallations();
|
55
|
-
expect(installations).toBeDefined();
|
56
|
-
// expect(installations.app).toBeDefined();
|
57
|
-
});
|
58
|
-
});
|
59
|
-
|
60
|
-
describe('onIdChange', function () {
|
61
|
-
it('throws an unsupported error', async function () {
|
62
|
-
const installations = getInstallations();
|
63
|
-
expect(() => onIdChange(installations, () => {})).toThrow(
|
64
|
-
'onIdChange() is unsupported by the React Native Firebase SDK.',
|
65
|
-
);
|
66
|
-
});
|
67
|
-
});
|
68
|
-
});
|
69
|
-
});
|
package/type-test.ts
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
import firebase from '.';
|
2
|
-
|
3
|
-
// checks module exists at root
|
4
|
-
console.log(firebase.installations().app.name);
|
5
|
-
|
6
|
-
// checks module exists at app level
|
7
|
-
console.log(firebase.app().installations().app.name);
|
8
|
-
|
9
|
-
// checks statics exist
|
10
|
-
console.log(firebase.installations.SDK_VERSION);
|
11
|
-
|
12
|
-
// checks firebase named export exists on module
|
13
|
-
console.log(firebase.SDK_VERSION);
|
14
|
-
|
15
|
-
// checks multi-app support exists
|
16
|
-
console.log(firebase.installations(firebase.app()).app.name);
|
17
|
-
|
18
|
-
// checks default export supports app arg
|
19
|
-
console.log(firebase(firebase.app()).app.name);
|