Last active
February 2, 2023 11:58
-
-
Save SteveOye/a460ca2fbccdc049e8272f116103865e to your computer and use it in GitHub Desktop.
cloud messaging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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