-
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(dynamic-links): add support for utmParameters #5593
Conversation
This pull request is being automatically deployed with Vercel (learn more). react-native-firebase-next – ./website_modular🔍 Inspect: https://vercel.com/invertase/react-native-firebase-next/6ujoieM1h3PYrvDv1nrDZ3WaQZgx [Deployment for 15daa15 canceled] react-native-firebase – ./🔍 Inspect: https://vercel.com/invertase/react-native-firebase/2SMWZdH3fYGikgxXYjvjaYQqzwbp |
Codecov Report
@@ Coverage Diff @@
## master #5593 +/- ##
==========================================
+ Coverage 71.11% 74.10% +2.99%
==========================================
Files 107 107
Lines 4420 4420
Branches 942 942
==========================================
+ Hits 3143 3275 +132
+ Misses 1179 1073 -106
+ Partials 98 72 -26 |
1f479af
to
390940f
Compare
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.
Oh this is really cool! Thank you for posting this, it should be really useful.
firebase-js-sdk does not have a links module to compare types with and it seems to me Record<string, string>
is as good as any
My only hesitation - especially since I think it's an easy addition? - is that it could be verified much more strongly in the e2e test
I scanned the test carefully and left two specific notes for the initial / onlink test, and then for the resolve link if you added the params at the top of this one (where minimum version was added) and verified it at the bottom (where minimum version was checked) I think all the work here would be fully verified
The code itself in Java/Objective-C looks great but I remember when I added resolveLink my code also looked great to me then I added verification in e2e and of course there was some subtle problem 😆
If you could try that and see if it really verifies in the e2e test I'd appreciate it and could merge+release straight away
@@ -155,6 +155,7 @@ describe('dynamicLinks()', function () { | |||
|
|||
dynamicLink.should.be.an.Object(); | |||
dynamicLink.url.should.equal('https://rnfirebase.io'); | |||
dynamicLink.utmParameters.should.eql({}); |
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.
With a quick addition of utm params to TEST_LINK the population may be verified I think?
@@ -172,6 +173,7 @@ describe('dynamicLinks()', function () { | |||
|
|||
spy.getCall(0).args[0].should.be.an.Object(); | |||
spy.getCall(0).args[0].url.should.equal('https://invertase.io/hire-us'); | |||
spy.getCall(0).args[0].utmParameters.should.eql({}); |
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.
same here - quick addition of utm params to TEST_LINK2 and this may be verified
There weren't a lot of PRs in flight in the repo so I chose this moment to integrate an auto formatter (#5596) - which necessarily cause all sorts of conflicts in this PR. That was no fault of the PR's of course, so I merged it and I believe I have correctly resolved all the conflicts with the last commit here if you pull it locally |
packages/dynamic-links/ios/RNFBDynamicLinks/RNFBDynamicLinksAppDelegateInterceptor.m
Outdated
Show resolved
Hide resolved
…pDelegateInterceptor.m
.../src/main/java/io/invertase/firebase/dynamiclinks/ReactNativeFirebaseDynamicLinksModule.java
Outdated
Show resolved
Hide resolved
…base/dynamiclinks/ReactNativeFirebaseDynamicLinksModule.java
.../src/main/java/io/invertase/firebase/dynamiclinks/ReactNativeFirebaseDynamicLinksModule.java
Outdated
Show resolved
Hide resolved
…base/dynamiclinks/ReactNativeFirebaseDynamicLinksModule.java
Unfortunately it is not possible to test these cases (or am I missing something?), as apparently Firebase does not rely on the long link and does not parse utm parameters on a short link, it only works with a short link that has utm parameters inside. This should be more understandable:
I think the reasoning behind this is that from the first two links you can always infer the utm parameters by parsing the url (that you can get from the deeplink rather than the dynamic link) |
OK I see what you mean. However, it's possible to generate a short link with utm params, then resolve it isn't it? That's what I meant to suggest. Worst case I have access to the dashboard for the testing project and can make a link with utm params in it, I was just hoping it was testable with completely self contained data fixture |
I had some time to check this while waiting for some other tests to run, if you use buildShortLink in the e2e test then the params do come through - I've got it locally, I'll push to your branch then merge this if I can, or if I mess up the git magic somehow I'll carry the commit in a fresh PR. Either way, all of your native parsing and everything is 💯 - it all checked out first time when I ran it here locally |
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.
the changes needed to do the test with UTM params in it exposed a couple other problems, and fixing those on this branch + in this PR isn't good practice. This appears to be working well in local testing so I'm going to merge it then dig in to the other issues in the area.
Thanks again for posting this!
Description
This adds the information about utm parameters that was setup in the dynamic link. This can be used to then store that information elsewhere or react to it somehow.
Related issues
Might be useful for #4554
Release Summary
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🔥