Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Notification channel 'DefaultChannel' has importance 'Default' - But it is set to high in config #89

Open
NGumby opened this issue Nov 4, 2024 · 5 comments
Assignees
Labels
bug Something isn't working platform/android s/needs-info Issue needs more info from the author

Comments

@NGumby
Copy link

NGumby commented Nov 4, 2024

Description

I get this log when receiving a notification and the app is killed -
2024-11-04 14:15:23.8287|Info|CSNativeApp.App|MainPage ctor
[EOL]
2024-11-04 14:15:24.1098|Info|CSNativeApp.App|WebViewService.Initialize
[EOL]
2024-11-04 14:15:24.4180|Debug|Plugin.FirebasePushNotifications.Platforms.FirebasePushNotificationManager|ConfigurePlatform
[EOL]
2024-11-04 14:15:24.4233|Debug|Plugin.FirebasePushNotifications.Platforms.Channels.NotificationChannels|SetNotificationChannelGroups: notificationChannelGroupRequests=[]
[EOL]
2024-11-04 14:15:24.4295|Debug|Plugin.FirebasePushNotifications.Platforms.Channels.NotificationChannels|DeleteNotificationChannelGroups: groupIds=[]
[EOL]
2024-11-04 14:15:24.4295|Debug|Plugin.FirebasePushNotifications.Platforms.Channels.NotificationChannels|CreateNotificationChannelGroups: notificationChannelGroupRequests=[]
[EOL]
2024-11-04 14:15:24.4354|Debug|Plugin.FirebasePushNotifications.Platforms.Channels.NotificationChannels|SetNotificationChannels: notificationChannelRequests=[DefaultChannel]
[EOL]
2024-11-04 14:15:24.4449|Debug|Plugin.FirebasePushNotifications.Platforms.Channels.NotificationChannels|DeleteNotificationChannels: channelIds=[]
[EOL]
2024-11-04 14:15:24.4511|Debug|Plugin.FirebasePushNotifications.Platforms.Channels.NotificationChannels|CreateNotificationChannels: notificationChannelRequests=[DefaultChannel]
[EOL]
2024-11-04 14:15:24.5004|Debug|Plugin.FirebasePushNotifications.Platforms.PNFirebaseMessagingService|HandleIntent: Action=com.google.android.c2dm.intent.RECEIVE
[EOL]
2024-11-04 14:15:24.5294|Debug|Plugin.FirebasePushNotifications.Platforms.FirebasePushNotificationManager|HandleNotificationReceived
[EOL]
2024-11-04 14:15:24.5465|Debug|Plugin.FirebasePushNotifications.Platforms.FirebasePushNotificationManager|HandleNotificationReceived queues event "NotificationReceived" into PersistentQueue for deferred delivery
[EOL]
2024-11-04 14:15:24.5547|Debug|Plugin.FirebasePushNotifications.Model.Queues.PersistentQueue|WriteQueueFile: fileInfo=/data/user/0/ca.compusport.compusport/files/Documents/FirebaseQueues/notificationReceivedQueue.json
[EOL]
2024-11-04 14:15:25.0419|Debug|CSNativeApp.App|OnReceived AcknowledgeNotification 31446792
[EOL]
2024-11-04 14:15:25.2902|Debug|Plugin.FirebasePushNotifications.Platforms.NotificationBuilder|OnNotificationReceived
[EOL]
2024-11-04 14:15:25.3244|Warn|Plugin.FirebasePushNotifications.Platforms.NotificationBuilder|Notification channel 'DefaultChannel' has importance 'Default' which is lower than notification importance 'High'

But it is set to high in UseFirebasePushNotifications

Steps to Reproduce

Here's my code:
o.Android.DefaultNotificationChannelImportance = Android.App.NotificationImportance.High;
o.Android.UseBigTextStyle = false;
o.Android.DefaultColor = SharedSettings.NotificationColor.ToAndroid();
o.Android.NotificationActivityType = typeof(MainActivity);
var channel =
new Plugin.FirebasePushNotifications.Platforms.Channels.NotificationChannelRequest{
ChannelId = "DefaultChannel",
ChannelName = "General",
Description = "The default notification channel",
LockscreenVisibility = Android.App.NotificationVisibility.Public,
Importance = Android.App.NotificationImportance.High,
LightColor = Android.Graphics.Color.Orange,
VibrationPattern = [0,100,150,150,150,200]
};
o.Android.NotificationChannels = new [] { channel };
o.Android.DefaultNotificationChannelId = channel.ChannelId;

Expected Behavior

To not see this log

Actual Behavior

Basic Information

  • Version with issue: 3.1.6-pre
  • Last known good version: unknown
@NGumby NGumby added the bug Something isn't working label Nov 4, 2024
@thomasgalliker
Copy link
Owner

What was the content of the notification you sent? I tried to reproduce but the warning message was not logged.

@thomasgalliker
Copy link
Owner

If you uninstall the app and reinstall it, does the warning still appear? If no, it would mean that something is wrong with updating existing notification channels.

@thomasgalliker thomasgalliker self-assigned this Nov 7, 2024
@thomasgalliker thomasgalliker added platform/android s/needs-info Issue needs more info from the author labels Nov 7, 2024
@thomasgalliker
Copy link
Owner

I tried to reproduce this issue with following notification message and a default notification channel with Importance=High (just like the one you created). In order to receive this message, I had to subscribe to topic "general" but that shouldn't cause any problems.

{
    "message": {
        "topic": "general",
        "notification": {
            "title": "Medication Intake",
            "body": "Do you want to take your medicine?"
        },
        "data": {
            "priority": "high"
        },
        "android": {
            "notification": {
                "click_action": "medication_intake"
            }
        },
        "apns": {
            "payload": {
                "aps": {
                    "category": "medication_intake"
                }
            }
        }
    }
}

I stepped trough the code when I received the message and the warning Notification channel 'DefaultChannel' has importance 'Default' which is lower than notification importance 'High' did not appear.

If you can help me to reproduce this issue I'll come back to it.

@NGumby
Copy link
Author

NGumby commented Nov 12, 2024 via email

@thomasgalliker
Copy link
Owner

Don‘t worry 👍🏻 Good to hear I‘m not the only one with a tight schedule 🤓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform/android s/needs-info Issue needs more info from the author
Projects
None yet
Development

No branches or pull requests

2 participants