After researching how to obtain permission to send notifications to a device, I have a question.
The procedure, as I understand it, is to request permission to send notifications. If granted, no problem, but if denied, the app should not attempt to send any notifications. You’re supposed to check the permission each time before deciding whether or not to send them, in case the user changed the permission in the Settings app.
This isn’t how I’ve coded my app. I request permission, but ignore the result. I just happily send notifications whenever I need to. If permission was denied, the requests are ignored. Later, if the user enabled notifications for my app, the requests are honored. This has worked for me, although I’ll admit that I never ran my app for any extended length of time while permission was denied.
So, is this a problem? Is attempting to send notifications without permission a bad thing? Can I keep doing it this way or do I have to fall in line and check for permission each time?
The code is so simple this way.