Looking at the docs I can see methods for checking all the attributes of a notification channel, but I couldn't find a way to check if the channel itself is enabled or disabled.
Am I missing something?
The Official Documentation has your answer:
You can call the following two methods to discover the settings a user has applied to a notification channel:
- o retrieve a single notification channel, you can call
getNotificationChannel()
.- To retrieve all notification channels belonging to your app, you can call
getNotificationChannels()
.After you have the NotificationChannel, you can use methods such as
getVibrationPattern()
andgetSound()
to find out what settings the user currently has. To find out if a user blocked a notification channel, you can callgetImportance()
. If the notification channel is blocked,getImportance()
returns IMPORTANCE_NONE.
So getImportance()
will tell you if notification channel is blocked or not.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments