live_activities 2.3.0 copy "live_activities: ^2.3.0" to clipboard
live_activities: ^2.3.0 copied to clipboard

A Flutter plugin to use iOS 16.1+ Live Activities & iPhone 14 Pro Dynamic Island features

2.3.0 #

  • 🏗️ Move to Swift Package Manager.
  • 🏗️ Regenerate example app.
  • ⬆️ Upgrade dependencies.

2.2.0 #

  • ✨ Added a new method createOrUpdateActivity(), you can use it to create or update by passing an activity ID (thanks to @Clon1998 👍).
  • ⬆️ Upgrade dependencies.

2.1.0 #

  • ✨ You can now send generic files instead of just pictures.

To send a file you can do the following on the Dart code:

LiveActivityFileFromAsset('assets/files/rules.txt')

And in your Swift code:

let ruleFile = sharedDefault.string(forKey: context.attributes.prefixedKey("yourFileKey"))!
let rule = (try? String(contentsOfFile: ruleFile, encoding: .utf8)) ?? ""

Check the example for a full demo.

BREAKING CHANGES

You must replace your images to:

  • LiveActivityFileFromAsset.image()
  • LiveActivityFileFromMemory.image()
  • LiveActivityFileFromUrl.image()

In order to use resizeFactor you must do the following now:

LiveActivityFileFromAsset.image(
  'assets/images/chelsea.png',
  imageOptions: LiveActivityImageFileOptions(
    resizeFactor: 0.2
  )
),
  • 🐛 Example works again with scheme.

2.0.1 #

  • 🐛 Fix channel message sent from native to Flutter on a non-platform thread (thanks to @aswanath 👍)
  • 🗑️ Clean some code.

2.0.0 #

  • ✨ Use new custom iOS App Group Directory dependency (this will fix namespace for Android gradle builds).
  • ✨ Removed deprecated flutter_native_image dependency and replaced by image (thanks to @SnapDrive 👍)
  • ⬆️ Upgrade dependencies.

1.9.5 #

  • 🐛 Fix areActivitiesEnabled() on unsupported devices.

1.9.4 #

  • 🍱 Convert images to webp.
  • ⬆️ Upgrade dependencies.

1.9.3 #

  • 🐛 Force returning false for areActivitiesEnabled() when no iOS devices.

1.9.2 #

  • ✨ Simplified fetching of ActivityState of all created live activities (thanks to @Clon1998 👍).
  • 🐛 Fixes background thread invocation of event streams (thanks to @ggirotto 👍).
  • 🐛 Replaced getImageProperties with dart buffer and descriptor (thanks to @anumb 👍).
  • 🐛 Fix tests.
  • ⬆️ Upgrade dependencies.

1.9.1 #

  • ✨ Add update with alert config (thanks @charlesRmajor 👍).
  • ✨ Add an option to use preloaded images (thanks @Niklas-Sommer 👍).
  • ✨ Add Android support - currently only used to check if live activities is supported (thanks @ggirotto 👍).
  • ✨ Example app support Material 3.
  • 🐛 Fix tests.
  • 📝 Update README.md.
  • ⬆️ Upgrade dependencies.

1.9.0 #

  • BREAKING CHANGE: Add the ability to handle multiple live notification (thanks @Clon1998 👍).

Please follow this tutorial to add implement it:

  • Add the following Swift extension at the end of your extension code:
extension LiveActivitiesAppAttributes {
  func prefixedKey(_ key: String) -> String {
    return "\(id)_\(key)"
  }
}
  • For each keys on your native Swift code, please changes the following lines:
let myVariableFromFlutter = sharedDefault.string(forKey: "myVariableFromFlutter") // repleace this by ...
let myVariableFromFlutter = sharedDefault.string(forKey: context.attributes.prefixedKey("myVariableFromFlutter")) // <-- this
  • 🐛 Fix stall state for unknown activityId (thanks @Clon1998 👍).
  • 🐛 Now return null value when activity is not found in getActivityState().

1.8.0 #

  • ✨ Add url scheme optional argument.
  • ✨ Add sinks unregister on engine end (thanks @ggirotto 👍).
  • 🐛 Fix example images size.
  • ⬆️ Upgrade dependencies.

1.7.5 #

  • 🚨 Lint some code.
  • 🐛 Fix deprecated tests.
  • ⬆️ Upgrade dependencies.

1.7.4 #

  • 🐛 Method areActivitiesEnabled() are now callable on iOS < 16.1
  • ✨ Creating an activity can now use stale-date (thanks @arnar-steinthors 👍).

1.7.3 #

  • ✨ ActivityUpdate subclasses are now public along with a new MapOrNull method (thanks @arnar-steinthors 👍).

1.7.2 #

  • ✨ Add missing "stale" activity status.
  • 🐛 When value set to null in map, value is removed from live activity.

1.7.1 #

  • 🐛 Fix missing activityUpdateStream implementation channel on native part.

1.7.0 #

  • ✨🐛 Change method getPushToken() to be synchronous.
  • ⬆️ Upgrade dependencies.

1.6.0 #

  • ✨ Add a way to track push token and the activity status (thanks @arnar-steinthors 👍).
  • ♻️ Format code.

1.5.0 #

  • ✨ Add method to get push token (thanks to @jolamar 👍).
  • ♻️ Rework Swift code.

1.4.2+1 #

  • 📝 Add screenshots in pubspec.yaml

1.4.2 #

  • ✨ End live activity when the app is terminated (thanks to @JulianBissekkou 👍).

1.4.1 #

  • 🐛 Fix a bug where init never completes (thanks to @JulianBissekkou 👍).

1.4.0 #

  • ✨ Can now pass assets between Flutter & Native.
  • 📝 Update README.md.

1.3.0+1 #

  • 📝 Update README.md.

1.3.0 #

  • ✨ Now using App Groups to pass typed data across Flutter & Native !
  • 🗑️ Remove unused code in example.
  • 📝 Improve README.md.

1.2.1 #

  • ✨ Add method to get the activity state (active, ended or dismissed).

1.2.0 #

  • ✨ Add stream to handle url scheme from live activities &/or dynamic island.
  • 📝 Improve README.md
  • ♻️ Rework example

1.1.0 #

  • ✨ Add method to check if live activities are enabled.
  • ✨ Add method to get all activities ids created.
  • ✨ Add method to cancel all activities.
  • 🐛 Fix add result to all methods.

1.0.0 #

  • 🎉 Initial release.
442
likes
160
points
6.81k
downloads
screenshot

Publisher

verified publisherdimitridessus.fr

Weekly Downloads

A Flutter plugin to use iOS 16.1+ Live Activities & iPhone 14 Pro Dynamic Island features

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_app_group_directory, image, path_provider, plugin_platform_interface

More

Packages that depend on live_activities