Skip to content
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

[MBL-1147] Track push notifications #1943

Merged
merged 3 commits into from
Feb 14, 2024
Merged

[MBL-1147] Track push notifications #1943

merged 3 commits into from
Feb 14, 2024

Conversation

ifosli
Copy link
Contributor

@ifosli ifosli commented Feb 13, 2024

📲 What

Track push notifications by telling braze/appboy when they're opened.

Note: In order to do this smoothly, Appboy.sharedInstance() is moved out of the helper function we had it in. I've verified that the shared instance that exists in that helper is different from the one that exists in AppDelegate (but within each file, they're consistent). I'm not sure why that's the case, but I'd theorize it has something to do with different targets or the helper function being static or that it lives within a SEG class and is itself a SEG class. In any case, moving these lines of code out means that Appboy.sharedInstance() is consistent from when we add it to the configuration to when we need it for reporting push notifications.

(In the original commit, I stored appboyHelper instead to make it consistent between the config and the push notification report, since I hadn't tried to investigate why they were different yet. This solution is much cleaner.)

🤔 Why

Direct opens for push notifications weren't being tracked; now they will be!

👀 See

Jira

✅ Acceptance criteria

  • Direct opens are now tracked

@ifosli ifosli self-assigned this Feb 13, 2024
@ifosli ifosli changed the title Store appboyHelper in order to track push notifications [MBL-1147] Track push notifications Feb 14, 2024
@ifosli ifosli marked this pull request as ready for review February 14, 2024 19:16
Copy link
Contributor

@amy-at-kickstarter amy-at-kickstarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Yeah, the question about why the instance was broken is interesting - it looks like it's using dispatch_once under the hood, which I would expect to be immutable? But regardless of why it was broken, this change makes sense. I suppose if you wanted to be extra cautious you could just have the app delegate keep its own reference to the instance you need to recycle.

@ifosli ifosli merged commit 7b522b7 into main Feb 14, 2024
5 checks passed
@ifosli ifosli deleted the trackBrazePush branch February 14, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants