test(messaging): cloud function sendFCM feature for messaging testing #8143
+5,822
−1,712
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I have a large backlog of issues on Notifee, plus a couple issues in react-native-firebase that are related to messaging problems with FCM handling
I can'd diagnose those easily unless I can easily trigger an FCM to a specific device
This PR adds a new cloud function for testing that will take a TokenMessage (basically a regular FCM but with a device token in it) and just reflect that Message right back to the token, with an optional delay
As mentioned in the commit, it will only work if you have the correct google-services files and use the correct package names and even then on iOS it will only work if you have the Xcode developer profile installed for the com.invertase.testing bundle. So I'm not sure how it could be abused, even if you somehow knew some devices "react-native-firebase-testing" project-specific device token
Related issues
Too many to list, but all related to incorrect handling of FCM in various app states on various platforms
Here's one:
Release Summary
All conventional commits, but also none of them will trigger release, they're all build or test
Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
deploy function
cd .github/workflows/scripts/functions && yarn deploy
Execution of function:
watch react-native console logs
watch firebase function logs:
https://console.cloud.google.com/logs/query;query=%2528resource.type%3D%22cloud_function%22%20resource.labels.region%3D%22us-central1%22%2529%20OR%20%2528resource.type%3D%22cloud_run_revision%22%20resource.labels.service_name%3D%2528%22sendfcm%22%2529%20resource.labels.location%3D%22us-central1%22%2529;cursorTimestamp=2024-11-16T18:47:18.873543Z;duration=PT1H?authuser=0&project=react-native-firebase-testing&hl=en&inv=1&invt=AbhpwQ
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter