Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. void showNotification(message) async {
  2. var androidPlatformChannelSpecifics = new AndroidNotificationDetails(
  3. Platform.isAndroid ? 'com.dfa.flutterchatdemo' : 'com.duytq.flutterchatdemo',
  4. 'Flutter chat demo',
  5. 'your channel description',
  6. playSound: true,
  7. enableVibration: true,
  8. importance: Importance.Max,
  9. priority: Priority.High,
  10. );
  11. var iOSPlatformChannelSpecifics = new IOSNotificationDetails();
  12. var platformChannelSpecifics =
  13. new NotificationDetails(androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
  14. await flutterLocalNotificationsPlugin.show(
  15. 0, message['title'].toString(), message['body'].toString(), platformChannelSpecifics,
  16. payload: json.encode(message));
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement