I tried to use Notification Listner Extension that is working fine in Foreground and When app is open but when the app is fully closed than it is not working.
So, basically when notification is received I send it to the Firebase. That dose not work when app is fully closed.
The notification listener service runs in the background also if your app is closed. It will listen to all notifications and stores them in TinyDB (aka shared preferences) using the name space TaifunNotificationListener .
The Notification Received event fires only if the app is in the foreground.
You can try to use the background extension to read TinyDB regularly and send the data to Firebase