Skip to content

Instantly share code, notes, and snippets.

@SteveOye
Last active February 2, 2023 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SteveOye/a460ca2fbccdc049e8272f116103865e to your computer and use it in GitHub Desktop.
Save SteveOye/a460ca2fbccdc049e8272f116103865e to your computer and use it in GitHub Desktop.
cloud messaging
//add the method to NotificationApi class
static pushNotification(
RemoteMessage message,
) async {
var androidPlatformChannelSpecifics = const AndroidNotificationDetails(
'channed id',
'channel name',
channelDescription: 'channel description',
importance: Importance.max,
priority: Priority.high,
);
var iOSPlatformChannelSpecifics = const DarwinNotificationDetails();
var platformChannelSpecifics = NotificationDetails(
android: androidPlatformChannelSpecifics,
iOS: iOSPlatformChannelSpecifics,
);
await _notification.show(
'id',
message.notification!.title,
message.notification!.body,
platformChannelSpecifics);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment