Skip to content

Start using flutter_local_notifications for displaying notifications #293

@epou

Description

@epou

Also adjust the icon to be used and set priority to high

Stop using the package overlay_support

Example (https://github.com/firebase/flutterfire/blob/6c0eb6c7f4415838b8ebcbf796499dd2ef59da43/packages/firebase_messaging/firebase_messaging/example/lib/main.dart#L95)

void showFlutterNotification(RemoteMessage message) {
  RemoteNotification? notification = message.notification;
  AndroidNotification? android = message.notification?.android;
  if (notification != null && android != null && !kIsWeb) {
    flutterLocalNotificationsPlugin.show(
      notification.hashCode,
      notification.title,
      notification.body,
      NotificationDetails(
        android: AndroidNotificationDetails(
          channel.id,
          channel.name,
          channelDescription: channel.description,
          // TODO add a proper drawable resource to android, for now using
          //      one that already exists in example app.
          icon: 'launch_background',
        ),
      ),
    );
  }
}

Sub-issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions