Flutter Local Notification is silent

Viewed 489

Sorry in advance for the bad code but I did anything and the notification I am sending comes with no sound.

scheduleNotification({@required int id,@required String title,@required String body,@required String payload,
      Color color,Importance importance,bool permanent, @required DateTime dateTime})async{

    if(permanent==null)permanent=false;

    var androidPlatformChannelSpecifics =
    AndroidNotificationDetails(channelId,
        channelName, channelDescription,color: color,indeterminate: permanent,ongoing: permanent,
        autoCancel: !permanent,importance: importance??Importance.Default,
      priority: importance==Importance.Max?Priority.Max:Priority.Default, icon: "effectivenezz_logo",
      sound: RawResourceAndroidNotificationSound('sound'));
    var iOSPlatformChannelSpecifics =
    IOSNotificationDetails(presentSound: importance==Importance.Max,presentAlert: importance==Importance.Max,);
    NotificationDetails platformChannelSpecifics = NotificationDetails(
        androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
    await flutterLocalNotificationsPlugin.schedule(
        id,
        title,
        body,
        dateTime,
        platformChannelSpecifics);
  }
0 Answers
Related