I am new to android developing and building an app. I am trying pop a notification whenever an announcement is recorded into my database. However, not everyone likes notifications therefore there should be an option which disables/enables notifications only for my app. I am wondering if this can be done for the android versions 2.1 and upper.
Thanks in advance.
Of course. Just use a boolean variable to check if user has set notifications enabled or disabled and store it in your SharedPreferences.
Each time you need to launch a notification, check the variable; Launch the notification if it’s true and don’t launch it if it’s false.