Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void showNotification(message) async {
- var androidPlatformChannelSpecifics = new AndroidNotificationDetails(
- Platform.isAndroid ? 'com.dfa.flutterchatdemo' : 'com.duytq.flutterchatdemo',
- 'Flutter chat demo',
- 'your channel description',
- playSound: true,
- enableVibration: true,
- importance: Importance.Max,
- priority: Priority.High,
- );
- var iOSPlatformChannelSpecifics = new IOSNotificationDetails();
- var platformChannelSpecifics =
- new NotificationDetails(androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
- await flutterLocalNotificationsPlugin.show(
- 0, message['title'].toString(), message['body'].toString(), platformChannelSpecifics,
- payload: json.encode(message));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement