Skip to content

Commit addcd07

Browse files
Merge branch 'main' into v8-deprecations
2 parents 0ce93c3 + c8b7909 commit addcd07

File tree

96 files changed

+7468
-2080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+7468
-2080
lines changed

.github/workflows/scripts/functions/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
},
1414
"main": "lib/index.js",
1515
"dependencies": {
16-
"firebase-admin": "^12.5.0",
17-
"firebase-functions": "^6.0.1"
16+
"firebase-admin": "^13.0.0",
17+
"firebase-functions": "^6.1.0"
1818
},
1919
"devDependencies": {
2020
"firebase-functions-test": "^3.3.0",
21-
"typescript": "^5.6.2"
21+
"firebase-tools": "^13.25.0",
22+
"typescript": "^5.6.3"
2223
},
2324
"private": true
2425
}

.github/workflows/scripts/functions/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ export { testFunctionCustomRegion } from './testFunctionCustomRegion';
2323
export { testFunctionDefaultRegionV2 } from './testFunctionDefaultRegion';
2424
export { testFunctionRemoteConfigUpdateV2 } from './testFunctionRemoteConfigUpdate';
2525
export { fetchAppCheckTokenV2 } from './fetchAppCheckToken';
26+
export { sendFCM } from './sendFCM';
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
*
3+
* Testing tools for invertase/react-native-firebase use only.
4+
*
5+
* Copyright (C) 2018-present Invertase Limited <[email protected]>
6+
*
7+
* See License file for more information.
8+
*/
9+
10+
import * as functions from 'firebase-functions/v2';
11+
import { CallableRequest } from 'firebase-functions/v2/https';
12+
13+
import { getMessaging, TokenMessage } from 'firebase-admin/messaging';
14+
15+
// Note: this will only work in a live environment, not locally via the Firebase emulator.
16+
export const sendFCM = functions.https.onCall(
17+
async (req: CallableRequest<{ message: TokenMessage; delay?: number }>) => {
18+
const { message, delay } = req.data;
19+
return await new Promise(() => {
20+
functions.logger.info('Sleeping this many milliseconds: ' + (delay ?? 0));
21+
setTimeout(async () => {
22+
functions.logger.info('done sleeping');
23+
const result = await getMessaging().send(message);
24+
return { messageId: result };
25+
}, delay ?? 0);
26+
});
27+
},
28+
);

0 commit comments

Comments
 (0)