-
Notifications
You must be signed in to change notification settings - Fork 616
notification_open never reported if onCreate of MainActivity was not called #3799
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
Comments
I found a few problems with this issue:
|
Thanks for reporting, @kevin-zqw. I used the Firebase quickstart, and simulated the issue with the steps you've provided, however I'm able to receive the |
Hi @argzdev I just managed to reproduce this bug with
Test result:
Test result:
The Last but not least, the Thanks! |
Thanks for the detailed explanation, @kevin-zqw! I overlooked the Looking at the Android documentations.
Thank you for reporting this, but I can't say though if this is a bug or intended behavior, since if a new instance is not created due to the behavior of However, I do think this is something that needs to be supported in the future. That being said, I'll notify our engineers and see what we can do here. |
This appears to be a bug as it's intended that opening a notification should log notification_open, if enabled. Unfortunately ActivityLifecycleCallbacks doesn't have a callback for onNewIntent(), so the FCM SDK would not be able to log notification open in that way. There may be some other ways to try to handle this, but even if we decide on a fix, I don't know how long it might take to be included in a release. In the meantime, I think that you should be able to work around this by copying logNotificationOpen() from FcmLifecycleCallbacks and calling it in your Activity's onNewIntent(). Line 79 in a283019
|
Thanks so much! Hope Firebase will fix this bug in the future. In the mean time, as @gsakakihara said, I have solved this issue in my App by calling |
A quick update. We're looking into seeing if we can make notification logging more seamless in cases like this, but there's a good chance that it could take some time and may not work on existing versions, so for now the best choice is probably to continue calling logNotificationOpen() in onNewIntent(). |
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 Just to add, the callbacks do not only not recognize Use Case Example:
If the LaunchActivity blindly forwards it's Intent data to the "SomeOtherActivity" for any reasons, 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 Have a great day, |
Hi @SteveBurkert, I opened a new ticket (#6091) referencing the issue you raised for better tracking. Moving forward, you can check on the issue #6091 for updates. Thanks! |
Problems
My app has only one
MainActivity
, and it's singleTask.When I received the notification and tap it to bring my app to foreground, the
MainActivity
was not recreated and itsonCreate
method was not called.So
FcmLifecycleCallbacks
had no chance to report the notification_open event.Steps to reproduce:
MainActivity
singleTask, and don't callfinish
, just send it to backgroundRelevant Code:
FcmLifecycleCallbacks
code below will never be called
The text was updated successfully, but these errors were encountered: