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

Notification color on Samsung device #2310

Open
danielL22 opened this issue Apr 21, 2024 · 0 comments
Open

Notification color on Samsung device #2310

danielL22 opened this issue Apr 21, 2024 · 0 comments

Comments

@danielL22
Copy link

danielL22 commented Apr 21, 2024

Hello everyone,
on samsung phones you can choose between a short and a detailed notification style. The detailed is like the normal notification style for android while the short one is an one liner with settings for a light effect on the screen border. This effect can have a color by setting one or let the system set an automatic color for your app.
Now I set the notification color in my showLocalNotification-function to a pink. This works with the detailed-style but as soon as I set it to the short style the color stays green for some reason. In the notification settings the color is set to be choosen automatically

This is the code for showing the notification:

void showLocalNotification(String title, String body) {
    debugPrint("Trying to notify");
    try{
      const androidNotificationDetail = AndroidNotificationDetails(
        '0', //channel Id
        'general', //channel name,
        importance: Importance.max,
        priority: Priority.high,
        ticker: 'ticker',
        color: Color(0xFFFF5B9E),
      );
      const iosNotificatonDetail = DarwinNotificationDetails();
      const notificationDetails = NotificationDetails(
        iOS: iosNotificatonDetail,
        android: androidNotificationDetail,
      );
      _flutterLocalNotificationsPlugin.show(0, title, body, notificationDetails, payload: "test");
    }catch(e){
      debugPrint(e.toString());
    }
  }

Screenshot_20240421_232627
Screenshot_20240421_232702

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant