I am using the following code to display the notification and launching the activity when user taps on the notification. Everything is working as expected when the app is in