-
Notifications
You must be signed in to change notification settings - Fork 665
Open
Labels
Description
Bug Report
Plugin(s)
LocalNotifications
Capacitor Version
Capacitor Doctor
Latest Dependencies:
@capacitor/cli: 7.4.4
@capacitor/core: 7.4.4
@capacitor/android: 7.4.4
@capacitor/ios: 7.4.4
Installed Dependencies:
@capacitor/cli: 7.4.3
@capacitor/core: 7.4.3
@capacitor/ios: 7.4.3
@capacitor/android: 7.4.3
[success] Android looking great! 👌
[error] Xcode is not installed
Platform(s)
Android
Current Behavior
type Importance = 3 | 1 | 2 | 4 | 5
Expected Behavior
type Importance = 3 | 1 | 2 | 4 | 5 | 0
Other Technical Details
When users disable notifications for a channel, the Importance value Android returns is IMPORTANCE_NONE which has a value of 0. I confirmed that Capacitor LocalNotifications returns 0 in this case as well, which is confusing since the docs and the return type state the only valid return values are 1-5.
const { channels } = await LocalNotifications.listChannels();
const defaultChannel = channels.find(channel => channel.id === DEFAULT_ANDROID_CHANNEL_ID);
const importance = defaultChannel.importance; // value of 0 when default channel has notifications disabled.
Additional Context
I'm new... probably didn't contribute correctly, just trying to take a few minutes to help someone else.