Message is not showing!
See original GitHub issueHi, I have a similar problem issue 977 with two activities. Message is not showing on second activity after first has destroyed.
I suppose, there is a problem with calling FirebaseInAppMessaging.clearDisplayListener()
in FirebaseInAppMessagingDisplay.onActivityDestroyed
without checking which activity has destroyed (current or previous). As a result, the app can skip messages.
I use firebase-inappmessaging-display:19.0.2
Reproducible example here
Steps:
- Get example app’s Instance ID
- Close example app
- send test in-app message from firebase console
- open app (open FirstActivity)
- FirstActivity open SecondActivity
- FirstActivity has finished.
- SecondActivity still opened.
- The message was received but not showing.
Logcat report:
2019-12-24 13:01:07.241 17432-17432/com.master8.experimentalproject D/FIAM.Display: Created activity: com.master8.experimentalproject.FirstActivity
2019-12-24 13:01:07.292 17432-17432/com.master8.experimentalproject D/FIAM.Display: Started activity: com.master8.experimentalproject.FirstActivity
2019-12-24 13:01:07.292 17432-17432/com.master8.experimentalproject I/FIAM.Headless: Setting display event listener
2019-12-24 13:01:07.295 17432-17432/com.master8.experimentalproject I/FIAM.Headless: went foreground
2019-12-24 13:01:07.295 17432-17432/com.master8.experimentalproject D/FIAM.Headless: Event Triggered: ON_FOREGROUND
2019-12-24 13:01:07.295 17432-17432/com.master8.experimentalproject D/FIAM.Display: Resumed activity: com.master8.experimentalproject.FirstActivity
2019-12-24 13:01:07.297 17432-17533/com.master8.experimentalproject I/FIAM.Headless: Forcing fetch from service rather than cache. Test Device: true | App Fresh Install: true
2019-12-24 13:01:07.297 17432-17533/com.master8.experimentalproject I/FIAM.Headless: Recoverable exception while reading cache: /data/user/0/com.master8.experimentalproject/files/fiam_impressions_store_file (No such file or directory)
2019-12-24 13:01:07.300 17432-17533/com.master8.experimentalproject I/FIAM.Headless: Fetching campaigns from service.
2019-12-24 13:01:07.322 17432-17432/com.master8.experimentalproject I/FIAM.Headless: Removing display event listener
2019-12-24 13:01:07.322 17432-17432/com.master8.experimentalproject D/FIAM.Display: Pausing activity: com.master8.experimentalproject.FirstActivity
2019-12-24 13:01:07.352 17432-17432/com.master8.experimentalproject D/FIAM.Display: Created activity: com.master8.experimentalproject.SecondActivity
2019-12-24 13:01:07.389 17432-17432/com.master8.experimentalproject D/FIAM.Display: Started activity: com.master8.experimentalproject.SecondActivity
2019-12-24 13:01:07.389 17432-17432/com.master8.experimentalproject I/FIAM.Headless: Setting display event listener
2019-12-24 13:01:07.392 17432-17432/com.master8.experimentalproject D/FIAM.Display: Resumed activity: com.master8.experimentalproject.SecondActivity
2019-12-24 13:01:07.524 17432-17432/com.master8.experimentalproject D/FIAM.Display: Stopped activity: com.master8.experimentalproject.FirstActivity
2019-12-24 13:01:07.526 17432-17432/com.master8.experimentalproject I/FIAM.Headless: Removing display event listener
2019-12-24 13:01:07.526 17432-17432/com.master8.experimentalproject D/FIAM.Display: Destroyed activity: com.master8.experimentalproject.FirstActivity
2019-12-24 13:01:07.681 17432-17533/com.master8.experimentalproject I/FIAM.Headless: Successfully fetched 1 messages from backend
2019-12-24 13:01:07.682 17432-17533/com.master8.experimentalproject D/FIAM.Headless: Updating contextual triggers for the following analytics events: []
2019-12-24 13:01:07.690 17432-17533/com.master8.experimentalproject D/FIAM.Headless: Decoding message: # com.google.firebase.inappmessaging.MessagesProto$Content@533ba749
banner {
background_hex_color: "#3ca9ff"
body {
hex_color: "#ffffff"
text: "\320\242\320\265\320\272\321\201\321\202 \321\201\320\276\320\276\320\261\321\211\320\265\320\275\320\270\321\217"
}
title {
hex_color: "#ffffff"
text: "\320\227\320\260\320\263\320\276\320\273\320\276\320\262\320\276\320\272"
}
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:25 (7 by maintainers)
Top Results From Across the Web
Fix problems sending, receiving or connecting to Messages
If you can't send or receive messages, or have trouble connecting to Messages on web, try the following suggestions below. Fix problems sending...
Read more >Is your messaging app not working? Try these fixes
Is your messaging app not working? Try these fixes · Outages and reception · Is Airplane mode on? · Restart the phone to...
Read more >Is iMessage not working? Here's how to fix it on your iPhone ...
Check you're set to send and receive iMessages by going to Settings > Messages and checking that iMessage is turned on. If when...
Read more >How to Fix It When You're Not Receiving Texts on Android
Text messaging has three components: the devices, the app, and the network. These components have multiple points of failure. The device may not...
Read more >6 Ways to Fix “Android Messaging App Not Working” Issue
How to Fix “ Message App Not Working” on Android · Tip 1. Restart Your Android Phone · Tip 2. Force Stop Message...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey folks, we are aware of this and I am currently working on a solution. Yeah the issue is exactly as you folks describe, the way we hook into the activity lifecycle doesn’t work well for apps with splash screens. The problem is that not doing this has resulted in callbacks referencing dead activities and crashing apps. I am going to be prioritizing investigating this issue this week.
The real solution would be to either: