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
[WEB-671]: Setup TriggerCapiEventInput GraphQL Mutation #1792
Conversation
9ef485a
to
019c00a
Compare
Generated by π« Danger |
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.
Left some review comments, let's go over in our 1-1, feel free to correct before our meeting too :)
Codecov Report
@@ Coverage Diff @@
## main #1792 +/- ##
==========================================
- Coverage 85.24% 85.23% -0.01%
==========================================
Files 1277 1281 +4
Lines 116682 116753 +71
Branches 30801 30823 +22
==========================================
+ Hits 99462 99519 +57
- Misses 16146 16160 +14
Partials 1074 1074
π£ Weβre building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Almost perfect, just add a test class for TriggerCapiEventInput.swift
and use the example of CreatePaymentSourceSetupIntentInputTests
to write a quick test.
@msadoon not sure why some files are being added/not added by git. The original test file that I had already done should be in here now. Sorry about that. Also my charles wan't consistently seeing the call being emitted during testing. if you have time to test that it would be helpful! |
XCTAssertNotNil(input["appData"]) | ||
XCTAssertNotNil(input["customData"]) |
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.
Since GraphAPI.AppDataInput
& GraphAPI.CustomDataInput
don't conform to Equatable and they're auto generated for us, I opted to just assert that the are not nil here.
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 fine for now. I didn't test it via Charles, but it's probably better if you get Charles successfully logging calls so you can see the results for yourself or in the future with new network calls.
There's a bunch of tutorials online. One I found here seems pretty detailed - https://www.kodeco.com/21931256-charles-proxy-tutorial-for-ios
If you want we can pair to configure this on your mac.
π² What
Before we can send CAPI events, we need to implement a mutation that will allow us to send the relevant data to our server.
This mutation will be called in the following cases when:
sendMetaCapiEvents
property set to trueEvent Cases:
π€ Why
If Facebook app users decline permission for FB to track them for advertising purposes, then our KS Facebook Pixel will be rendered useless. Using Facebook's Conversions API (CAPI) is the recommended workaround.
π How
The web team will be handling the actual events to Facebook's Conversions API and has added this new mutation so that we can notify them about what data and which events to send.
β Acceptance criteria