Flutter iOS How to show download notification success?

Viewed 1220

I am downloading a file using FlutterDownloader .

final taskId = await FlutterDownloader.enqueue(
  url: url,
  savedDir: (await getApplicationDocumentsDirectory()).path,
  showNotification:
      true, // show download progress in status bar (for Android)
  openFileFromNotification:
      true, // click on notification to open downloaded file (for Android)
);

In Android, the notification shows in the notification bar. But in iOS no notification shows even though the file is successfully downloaded and is showing in the "Files" app under the project name.

Solution needed: How to show the download notification in iOS or a snackbar with the link to the iOS phone "Files" app under the project folder.

Any help will be highly appreciated. Thank you.

1 Answers

I added This line in the "AppDelegate.swift" inside didFinishLaunchingWithOptions method and it solved my issue:

if #available(iOS 10.0, *) {
    UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
}

Documentation Link: https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications#%EF%B8%8F-ios-setup


// I found this in the documentation of the plugin, hopefully it solves your issue!

Related