@react-native-firebase/installations 20.2.1 → 20.4.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 +8 -0
- package/__tests__/installations.test.ts +28 -12
- package/lib/modular/index.d.ts +6 -7
- package/lib/modular/index.js +6 -6
- package/lib/version.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@
|
|
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
|
+
## [20.4.0](https://github.com/invertase/react-native-firebase/compare/v20.3.0...v20.4.0) (2024-08-13)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @react-native-firebase/installations
|
9
|
+
|
10
|
+
## [20.3.0](https://github.com/invertase/react-native-firebase/compare/v20.2.1...v20.3.0) (2024-07-19)
|
11
|
+
|
12
|
+
**Note:** Version bump only for package @react-native-firebase/installations
|
13
|
+
|
6
14
|
## [20.2.1](https://github.com/invertase/react-native-firebase/compare/v20.2.0...v20.2.1) (2024-07-17)
|
7
15
|
|
8
16
|
**Note:** Version bump only for package @react-native-firebase/installations
|
@@ -1,6 +1,13 @@
|
|
1
1
|
import { describe, expect, it } from '@jest/globals';
|
2
2
|
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
firebase,
|
5
|
+
getInstallations,
|
6
|
+
deleteInstallations,
|
7
|
+
getId,
|
8
|
+
getToken,
|
9
|
+
onIdChange,
|
10
|
+
} from '../lib';
|
4
11
|
|
5
12
|
describe('installations()', function () {
|
6
13
|
describe('namespace', function () {
|
@@ -22,23 +29,32 @@ describe('installations()', function () {
|
|
22
29
|
});
|
23
30
|
|
24
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
|
+
|
25
52
|
describe('getInstallations', function () {
|
26
53
|
it('returns an instance of Installations', async function () {
|
27
54
|
const installations = getInstallations();
|
28
55
|
expect(installations).toBeDefined();
|
29
56
|
// expect(installations.app).toBeDefined();
|
30
57
|
});
|
31
|
-
|
32
|
-
// it('supports multiple apps', async function () {
|
33
|
-
// const app = firebase.app();
|
34
|
-
// const secondaryApp = firebase.app('secondaryFromNative');
|
35
|
-
|
36
|
-
// const installations = getInstallations();
|
37
|
-
// const installationsForApp = getInstallations(secondaryApp);
|
38
|
-
|
39
|
-
// expect(installations.app).toEqual(app);
|
40
|
-
// expect(installationsForApp.app).toEqual(secondaryApp);
|
41
|
-
// });
|
42
58
|
});
|
43
59
|
|
44
60
|
describe('onIdChange', function () {
|
package/lib/modular/index.d.ts
CHANGED
@@ -1,30 +1,29 @@
|
|
1
1
|
import { ReactNativeFirebase } from '@react-native-firebase/app';
|
2
2
|
import { FirebaseInstallationsTypes } from '../index';
|
3
3
|
|
4
|
+
import FirebaseInstallations = FirebaseInstallationsTypes.Module;
|
4
5
|
/**
|
5
6
|
* Returns an instance of Installations associated with the given FirebaseApp instance.
|
6
7
|
*/
|
7
8
|
export declare function getInstallations(
|
8
9
|
app?: ReactNativeFirebase.FirebaseApp,
|
9
|
-
):
|
10
|
+
): FirebaseInstallations;
|
10
11
|
|
11
12
|
/**
|
12
13
|
* Deletes the Firebase Installation and all associated data.
|
13
14
|
*/
|
14
|
-
export declare function deleteInstallations(
|
15
|
-
installations?: FirebaseInstallationsTypes.Module,
|
16
|
-
): Promise<void>;
|
15
|
+
export declare function deleteInstallations(installations?: FirebaseInstallations): Promise<void>;
|
17
16
|
|
18
17
|
/**
|
19
18
|
* Creates a Firebase Installation if there isn't one for the app and returns the Installation ID.
|
20
19
|
*/
|
21
|
-
export declare function getId(installations:
|
20
|
+
export declare function getId(installations: FirebaseInstallations): Promise<string>;
|
22
21
|
|
23
22
|
/**
|
24
23
|
* Returns a Firebase Installations auth token, identifying the current Firebase Installation.
|
25
24
|
*/
|
26
25
|
export declare function getToken(
|
27
|
-
installations:
|
26
|
+
installations: FirebaseInstallations,
|
28
27
|
forceRefresh?: boolean,
|
29
28
|
): Promise<string>;
|
30
29
|
|
@@ -37,6 +36,6 @@ declare type IdChangeUnsubscribeFn = () => void;
|
|
37
36
|
* Sets a new callback that will get called when Installation ID changes. Returns an unsubscribe function that will remove the callback when called.
|
38
37
|
*/
|
39
38
|
export declare function onIdChange(
|
40
|
-
installations:
|
39
|
+
installations: FirebaseInstallations,
|
41
40
|
callback: IdChangeCallbackFn,
|
42
41
|
): IdChangeUnsubscribeFn;
|
package/lib/modular/index.js
CHANGED
@@ -18,9 +18,9 @@
|
|
18
18
|
import { firebase } from '..';
|
19
19
|
|
20
20
|
/**
|
21
|
-
* @
|
22
|
-
* @returns {import("..").FirebaseInstallationsTypes.Module}
|
21
|
+
* @typedef {import('..').FirebaseInstallationsTypes.Module} FirebaseInstallation
|
23
22
|
*/
|
23
|
+
|
24
24
|
export function getInstallations(app) {
|
25
25
|
if (app) {
|
26
26
|
return firebase.app(app.name).installations();
|
@@ -29,7 +29,7 @@ export function getInstallations(app) {
|
|
29
29
|
}
|
30
30
|
|
31
31
|
/**
|
32
|
-
* @param {
|
32
|
+
* @param {FirebaseInstallation} installations
|
33
33
|
* @returns {Promise<void>}
|
34
34
|
*/
|
35
35
|
export function deleteInstallations(installations) {
|
@@ -37,7 +37,7 @@ export function deleteInstallations(installations) {
|
|
37
37
|
}
|
38
38
|
|
39
39
|
/**
|
40
|
-
* @param {
|
40
|
+
* @param {FirebaseInstallation} installations
|
41
41
|
* @returns {Promise<string>}
|
42
42
|
*/
|
43
43
|
export function getId(installations) {
|
@@ -45,7 +45,7 @@ export function getId(installations) {
|
|
45
45
|
}
|
46
46
|
|
47
47
|
/**
|
48
|
-
* @param {
|
48
|
+
* @param {FirebaseInstallation} installations
|
49
49
|
* @param {boolean | undefined} forceRefresh
|
50
50
|
* @returns {Promise<string>}
|
51
51
|
*/
|
@@ -54,7 +54,7 @@ export function getToken(installations, forceRefresh) {
|
|
54
54
|
}
|
55
55
|
|
56
56
|
/**
|
57
|
-
* @param {
|
57
|
+
* @param {FirebaseInstallation} installations
|
58
58
|
* @param {(string) => void} callback
|
59
59
|
* @returns {() => void}
|
60
60
|
*/
|
package/lib/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
// Generated by genversion.
|
2
|
-
module.exports = '20.
|
2
|
+
module.exports = '20.4.0';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-native-firebase/installations",
|
3
|
-
"version": "20.
|
3
|
+
"version": "20.4.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": "20.
|
25
|
+
"@react-native-firebase/app": "20.4.0"
|
26
26
|
},
|
27
27
|
"publishConfig": {
|
28
28
|
"access": "public"
|
29
29
|
},
|
30
|
-
"gitHead": "
|
30
|
+
"gitHead": "3ac3e9623674a8db52c111b4aa0a85a883260116"
|
31
31
|
}
|