Unable to send push notification from adb command. Therefore, your process must be authorized to send the broadcast via ADB. But Google does not allow setting permission com.google.android.c2dm.permission.SEND .
If you run below command and try to grant send permission to your package. ./adb shell pm grant com.example.hunted "com.google.android.c2dm.permission.SEND"
You will get the following exception
eration not allowed: java.lang.SecurityException: Package com.example.hunted has not requested permission com.google.android.c2dm.permission.SEND
and even if you add this permission to your package
./adb shell pm grant com.example.hunted com.google.android.c2dm.permission.SEND Operation not allowed: java.lang.SecurityException: Permission com.google.android.c2dm.permission.SEND is not a changeable permission type.
Finally, when sending the broadcast using adb. you will get the following exception.
BroadcastQueue: Permission Denial: broadcasting Intent { flg=0x400010 cmp=com.example.hunted/com.google.firebase.iid.FirebaseInstanceIdReceiver (has extras) } from null (pid=32279, uid=2000) requires com.google.android.c2dm.permission.SEND due to receiver com.example.hunted/com.google.firebase.iid.FirebaseInstanceIdReceiver
Rajesh garg
source share