This is apparently behavior related to the Android OS that clears all notifications from an app when said app is uninstalled.
Why does making a new debug Android build clear notifications in emulator?
-
29-06-2023 - |
Question
I'm testing sending GCM notifications to my app. Every time I make a debug build on emulator, my notifications disappear on the emulator (I can no longer pull down from status bar to see them). Why does this keep happening? Is there a way to prevent this?
I already made sure I don't use setAutoCancel()
which makes the notification persist through clicks. Is there a way to make it persist through builds?
I'm guessing the notification removal is due to the debug button in Android Studio reinstalling the app which I assume has to do an uninstall under the hood. I thought notifications once received were more a part of the system and app uninstalls wouldn't remove notifications that were already present, but it appears that is incorrect.
Solution