Skip to content

notification_open logs twice when passing the intent to another Activity #6091

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

Closed
lehcar09 opened this issue Jul 10, 2024 · 1 comment
Closed

Comments

@lehcar09
Copy link
Contributor

Issue is created on behalf of the Developer.

Originally posted by @SteveBurkert in #3799 (comment)


@gsakakihara 

Hey there,

I don't want to open a new ticket for this, since my problem is kind of coming from the same source, the 
`FcmLifecycleCallbacks`. 

Just to add, the callbacks do not only not recognize `onNewIntent` calls, but they also do not recognize
if the same intent was already used for logging.

Use Case Example: 

1. LaunchActivity (which is called by fcm notification with data in Intent) 
2. SomeOtherActivity which is called from LaunchActivity

If the LaunchActivity blindly forwards it's Intent data to the "SomeOtherActivity" for any reasons,
the `notification_open` event will be tracked twice, because the `FcmLifecycleCallbacks` is invoked
two times.

This can easily be avoided, but was not easy to find. So this is more an additional info for you.

Maybe it's a good idea to check if the intent from `onCreate` is coming from an activity 
with `category.LAUNCHER` Intent-filter first, before pushing the fcm event. But thats not 
to me to decide.

Have a great day,
Cheers
@lehcar09
Copy link
Contributor Author

Hey @SteveBurkert, thank you for reaching out. I was able to reproduce the issue you reported. I'll notify our engineers about this and also the possible fix you suggested. Thank you for that. I'll get back to you once I hear from them.

gsakakihara added a commit that referenced this issue Jul 18, 2024
- Changed to use the message ID when checking for duplicate notification_open logging instead of the Activity's Intent. This should avoid logging again when an app starts another activity using a copy of the notification's intent (#6091).
@looptheloop88 looptheloop88 added the type: bug Something isn't working label Aug 6, 2024
gsakakihara added a commit that referenced this issue Aug 7, 2024
…6112)

- Changed to use the message ID when checking for duplicate
notification_open logging instead of the Activity's Intent. This should
avoid logging again when an app starts another activity using a copy of
the notification's intent
(#6091).
@firebase firebase locked and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants