The phone is OnePlus3T. The oxygen OS build is 4.1.6. App receives notification when the app is in foreground on in background but in the memory. But does not receive notifi
This looks like a problem of the specific device.
To check run this command while your app is closed (after a reboot or after swiping)
adb shell dumpsys package MY-PACKAGE | grep stopped
if you can read stopped=true it means that the manufacturer of your device implemented a non standard behavior consisting in "force-stopping" applications when they are swiped.
force-stopping is very similar to disabling the app until the user opens it again.
When the app is in that state many other Android API will not work!
(broadcasts, alarms..)
If this is the problem, please please contact the manufacturer and request that they fix the device!