-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(messaging): add support for setDeliveryMetricsExportToBigQuery #6529
feat(messaging): add support for setDeliveryMetricsExportToBigQuery #6529
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hey! Thanks for your patience on this - I'm still catching up (as fast as I can, but never fast enough...) after summer travels. Queued for review |
Codecov Report
@@ Coverage Diff @@
## main #6529 +/- ##
=============================================
- Coverage 72.30% 54.56% -17.74%
- Complexity 0 682 +682
=============================================
Files 109 208 +99
Lines 4657 10375 +5718
Branches 1048 1645 +597
=============================================
+ Hits 3367 5660 +2293
- Misses 1212 4433 +3221
- Partials 78 282 +204 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. For a little bit I was confused why the iOS implementation wasn't actually doing anything, then I remembered our previous conversation where it came out that on the iOS side you can only send things per-message + on receipt. At which point the property is perfect as it may be queried by an extension
Great work here, all around
@Override | ||
public Map<String, Object> getConstants() { | ||
final Map<String, Object> constants = new HashMap<>(); | ||
constants.put("isAutoInitEnabled", FirebaseMessaging.getInstance().isAutoInitEnabled()); | ||
constants.put("isDeliveryMetricsExportToBigQueryEnabled", FirebaseMessaging.getInstance().deliveryMetricsExportToBigQueryEnabled()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting - I was under the impression that constants were fetched once and cached such that setting new values into constants would not be reflected in future checks, but your test probes this, so, 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same thought at first. Gotta say that the tests were super helpful for a starter 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @mikehardy Hoping to contribute more in future!
v15.6.0 just went out with this feature - good luck with your project! |
@mikehardy @pavan168 in order for an iOS app to export message data to BigQuery, I will still need to make my own Or do the changes introduced in this PR mean that we no longer need to make our own Notification Service Extension? I suppose I am a bit confused about how to use the changes introduced in this PR to send message data to |
I don't believe there is a way to avoid the extension on iOS bec you have to send it every notification. The PR made the status of user acceptance very accessible, but it still requires an extension. If this isn't clear in the docs you can hit the edit button at the top of any page and drop a note in to help future intrepid explorers 😁 |
Description
We have had very specific requirements to send out push notifications using FCM and have implemented an in-house solution using the Firebase Admin SDK. However, we don't get access to the message delivery information in the Firebase Console anymore and want to use BigQuery to analyse this information.
Reading through the documentation we found that the message delivery data export needs to be enabled on the device (after asking for consent of course) and both ios and android native methods are not exposed as per the RNFirebase documentation.
With this PR, we can use
setDeliveryMetricsExportToBigQuery
method to pass down the status (a boolean value) and have useddeliveryMetricsExportToBigQueryEnabled()
method that exist already on android to return the updated status whilst iOS does not have a similar method,isDeliveryMetricsExportToBigQueryEnabled
is introduced that holds the most up-to-date status that can be used as per your requirement.Related issues
n/a
Release Summary
n/a
Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter