Basically if an app is allowed notifications, it never asks again even if the app is deleted and reinstalled. Where is all this data stored?
Apparently, Push Notifications Permission are reset if the devices are restored or the app is uninstalled for a day.
Extracted from Apple's Technical Note:
Therefore, these preferences must be stored where iOS System Settings are stored.