I see some applications like Messenger, Zalo do not need notifications but still work in the background. How to do it. The devices I use are Xiaomi A1 (Android 8) and Nokia 6.1
You can using Service class.
Refer this link, which I found on so: How to make an android app to always run in background?
Fix me if I have any wrong! Hope it can help you.