showSegmentifyNotification function

Future<void> showSegmentifyNotification(
  1. String title,
  2. String body,
  3. String data
)

Implementation

Future<void> showSegmentifyNotification(
    String title, String body, String data) async {
  final randomInt = Random().nextInt(100);
  var androidDetails = const AndroidNotificationDetails(
      pushAndroidChannelId, pushAndroidChannelName,
      channelDescription: pushAndroidChannelDescription,
      importance: Importance.max,
      priority: Priority.high,
      showWhen: true);
  var iOSDetails = const DarwinNotificationDetails();
  var generalNotificationDetails =
      NotificationDetails(android: androidDetails, iOS: iOSDetails);

  await flutterLocalNotificationsPlugin.show(
      randomInt, // Notification ID
      title, // Notification Title
      body, // Notification Body
      generalNotificationDetails, // Notification Details
      payload: data // Payload
      );
}