3

I started to use in app messaging. After the first time it didn't work. When I look to logs it says display event listener removed (just after after opening the app).

2019-11-07 10:44:26.800 973-973/ I/FIAM.Headless: Setting display event listener
2019-11-07 10:44:27.460 973-973/ I/FIAM.Headless: went foreground
2019-11-07 10:44:28.690 973-973/ I/FIAM.Headless: Removing display event listener

When I recreate app with( recreate () ) method. It works well. I am using splash screen in my app. As far as I understand activity life cycle used by the SDK to decide when to add or remove display listener. I am not sure if the problem is associated with the beta version of the in-app messaging.

Any help is appreciated.

Eren Tüfekçi
  • 2,463
  • 3
  • 16
  • 35

1 Answers1

0
I was facing same problem, I fixed it by following below steps:
1. Do not call finish() while starting the MainActivity. 
2. Start MainActivity using startActivityForResult(intent, 100).
3. onBackPress() of MainActivity call setResult(100) before call finish(). 
4. In onActivityResult() of SplashActivity check if response code is equal to 100 then call finish().
Please up-vote if you found helpful to you.
Harish Sharma
  • 1,189
  • 1
  • 8
  • 19