I have implemented RECEIVE_BOOT_COMPLETED by making an entry in manifest
and implementing MyBootReceiver.onReceive(..)
.
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
....
<receiver
android:name=".MyBootReceiver"
android:enabled="true"
android:exported="false" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.QUICKBOOT_POWERON"/>
</intent-filter>
</receiver>
It works well when run on an emulator (Pixel 2 API 21). However, when it is run on a API Level 30 or on PHysical device, OnePlus 6 (Oxygen 10.3.7), the BOOT notification isn't received.
But, when phone is restarted, other applications like Whatsapp, Sms etc are able to receive messages from server, possibly using some notification event. How is that possible ?
Am I missing something ?