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

Overview
flutter ios 16 live activities

Live Activities

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

🧐 What is it ?

This plugin use iOS ActivityKit API.

live_activities can be used to show dynamic live notification & implement dynamic island feature on the iPhone 14 Pro / Max ⚫️

⚠️ live_activities is only intended to use with iOS 16.1+ ! It will simply do nothing on other platform & < iOS 16.1

flutter ios 16 live activities logo

👻 Getting started

Due to some technical restriction, it's not currently possible to only use Flutter 🫣.

You need to implement in your Flutter iOS project a Widget Extension & develop in Swift/Objective-C your own Live Activity / Dynamic Island design.

ℹ️ You can check into the example repository for a full example app using Live Activities & Dynamic Island

🧵 Native

  • 📱 Create natively your Live Activity view tutorial

    • ⚫️ (Opt.) Create natively a Dynamic Island tutorial
  • 🛎 Enable push notification capabilities.

enable push notification capabilities

  • ⛹️ Enable live activities for both your app & widget extension.

enable live activity

💙 Flutter

  • 🔌 Import the plugin.
import 'package:live_activities/live_activities.dart';
  • 📣 Create your dynamic activity.
final Map<String, String> activityModel = {
  'name': 'Margherita',
  'ingredient': 'tomato, mozzarella, basil',
  'quantity': '1',
};

_liveActivitiesPlugin.createActivity(activityModel.toMap());

⚠️ For now you can only pass values as String.

📘 Documentation

Name Description Returned value
.createActivity() Create an iOS live activity, String The activity identifier
.updateActivity() Update the live activity data by using the activityId provided Future When the activity was updated
.endActivity() End the live activity by using the activityId provided Future When the activity was ended

🎯 Roadmap

  • Support multiple type instead of String (Date, Number etc.).
  • Inject a Widget inside the notification with Flutter Engine ?
Comments
  • Live Activities don't shows on Lock Screen and dynamic Island

    Live Activities don't shows on Lock Screen and dynamic Island

    Hello! I have basic knowledge of swift, so I tried to follow step by step the doc. I face that its not enough clear as I except but searching in internet, I could finally create my own widget with the property configuration (or this was that I thought)

    • I create a widget following the official documentation (enabling live activities)
    • I create my custom app group following the next documentation: https://developer.apple.com/documentation/xcode/configuring-app-groups
    • I set iOS Deployment target to 16.1

    But when I tried to use create activity it shows me XPCErrors] [BSXPCServiceConnectionProxy] Unable to register method "requestActivityWithRequest:error:" on class "BSXPCServiceConnectionProxy" [XPCErrors] [BSXPCServiceConnectionProxy] Unable to register method "endActivityWithIdentifier:payload:options:" on class "BSXPCServiceConnectionProxy" [XPCErrors] [BSXPCServiceConnectionProxy] Unable to register method "updateActivityWithIdentifier:payload:" on class "BSXPCServiceConnectionProxy" [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(LIVE_ACTIVITY_ERROR, can't launch live activity, The operation couldn’t be completed. (com.apple.ActivityKit.ActivityInput error 1.), null)

    I copy paste your example in my custom app, so Im certainly sure that I miss something... PD: Im not using URL Scheme because I don't want to share native info to flutter

    here is my widgetBundle created in Swift:

    `import WidgetKit import SwiftUI

    @main struct check_in_widgetBundle: WidgetBundle { var body: some Widget { //check_in_widget() if #available(iOS 16.1, *) { PizzaDeliveryApp() } } } `

    The UI of the widget is the same except by the group name (that I change by my own group name created) and from removing link (where you share native code to flutter)

    I have in both (runner target and custom widget Target) the capability of app group I just have in runner target the capability of push notifications I have Enable live activities for both your app & widget extension as your readme.

    My flutter code is the same as you missing the URL Scheme.

    What do Im doing wrong? NOTE: I create my widget following the next steps:

    File>New>Target>Widget Extension I check "include live activity) I remove the check from "include configuration intent" (because I found that it was not necessary)

    When I create the widget it shows me a message for activate scheme I tried with and without scheme (And without scheme I made it work partially because I couldn't see the live activity and my dynamic island shows loading)

    Hope this help

    opened by bichoalexis 4
  • Error at package installing

    Error at package installing

    I started to follow the setup steps as mentioned in the Readme and after installing this package tried running it on iPhone 14 Pro Simulator, I'm facing the following issue:

    Swift Compiler Error (Xcode): No such module 'ActivityKit'

    I have Xcode 14.0.1 version. Can you please guide me on how to solve this issue?

    opened by ShiriNissim 2
  • Developing a universal plugin for Live Activities on Flutter is impractical

    Developing a universal plugin for Live Activities on Flutter is impractical

    I think developing a plugin for Live Activities is impractical because it has to do with the API with which we interact on native side.

    1. First, your plugin won't support work with remote push notifications because you save data on flutter side to UserDefaults and when you render the widget you get this information from UserDefaults. Probably you can resolve this problem, see example https://pub.dev/packages/flutter_live_activities
    2. I saw common problems in plugins. You have only one "universal" attributes, that's mean that you have only one widget for this attribute. And it problem you cannot fix, because ActivityKit work with types Attributes as Generic. That's means that you need to find ways that help you knows about types of attributes in your native side, and ways that will pass types of attributes to your plugin. It seems impossible, but probably you can find a way to fix that. But you will need to get into the thick of Swift runtime, mangled etc. It will be too hard, but if you resolve this problem, your plugin will be great.

    My suggestion for all developers is to write their own plugin to work with Live Activities for their requirements. Because it would be very difficult to make a one-size-fits-all solution

    opened by ADiks09 1
  • Error running the example

    Error running the example

    I followed the setup steps as mentioned in the Readme and tried running it on iPhone 14 Pro Simulator, I'm facing the following issue:

    PlatformException (PlatformException(LIVE_ACTIVITY_ERROR, can't launch live activity, The operation couldn’t be completed. (com.apple.ActivityKit.ActivityInput error 1.), null))
    
    Screenshot 2022-10-02 at 9 15 48 PM

    I have Xcode 14.1 beta 2 with iOS 16.1 Simulator. Can you please guide me on how to solve this issue?

    opened by sbis04 1
  • Live Activities Extension 'Undefined symbol'

    Live Activities Extension 'Undefined symbol'

    Hello,

    I have already set up the configuration according to your docs, however, when I try to build the iOS app with the extension I get a few errors that suggest there are some issues with Flutter packages.

    image

    I use MacBook with M1 and the latest version of XCode (Also I try to run the app on the physical device with the latest iOS version). What should I do? Have you ever seen these messages when building an app with an extension? Thank you in advance!

    opened by jakublebiedzinski 11
  • Debugging the activity widget

    Debugging the activity widget

    Thanks for that amazing package. Example app works great, however when I tried to connect to my app, I wasn't able to run the activities.

    I follow the README from scratch 3 times, but no luck. init works, and I can print the id of live activity. When I debug, I can also see that create activity works. But I don't see anything with initial widget code or the package's code(football one), dynamic island is just black from my app.

    Is there any additional step to connect live activity widget to app? (I've created the target, add the group ids)

    opened by mirkancal 5
Owner
Dimitri Dessus
Mobile and web developer 👨‍💻
Dimitri Dessus
A simple iPhone calculator clone with Flutter

Flutter - iPhone Calculator Clone I made a simple iPhone calculator clone with Flutter. What will be add ❓ [] . Button [] Multiple transactions Screen

Yılmaz Yağız Dokumacı 3 Apr 13, 2022
Dynamic var - Dart dilinde dynamic ve var veri tiplerini anlamanızı kolaylaştıracak örnektir.

dynamic ve var arasındaki fark dynamic Tanımlanan değişkenin tipi daha sonra kod içerisinde değişebilir. Örneğin int olarak tanımlanan bir a değişkeni

Abdullah Sevmez 0 Jan 1, 2022
A Flutter plugin for the native FingerprintJS Pro libraries

FingerprintJS Pro Flutter Official Flutter plugin for 100% accurate device identification, created for the FingerprintJS Pro Server API. This plugin c

FingerprintJS 25 Dec 24, 2022
Flutterbodydetection - A flutter plugin that uses MLKit on iOS/Android platforms to enable body pose and mask detection using Pose Detection and Selfie Segmentation APIs for both static images and live camera stream.

body_detection A flutter plugin that uses MLKit on iOS/Android platforms to enable body pose and mask detection using Pose Detection and Selfie Segmen

null 18 Dec 5, 2022
A Flutter application to plan personal activities and routines that uses Supabase for the backend.

Flutter Planner Generated by the Very Good CLI ?? A Flutter application to plan personal activities and routines that uses Supabase for the backend. P

Ivan 15 Dec 29, 2022
App to control your health activities like calorie, water, medicine consumption, sleeping and weight control.

Handy Configuration for yourself This project contains google-services.json file of my own. You can connect your own firebase project using the follow

KanZa Studio 104 Jan 3, 2023
Clash Pro For Flutter

Clash Pro For Flutter

null 16 Nov 4, 2022
Open-source mobilní aplikace pro přístup do systému iCanteen

OpenCanteen Open-Source neoficiální iCanteen klient Co umí Aplikace vás přihlásí do instance iCanteen pokud ji podporuje canteenlib, jinak experimentá

Matyáš Caras 5 Dec 15, 2022
Flutter plugin to simply integrate Agora Video Calling or Live Video Streaming to your app with just a few lines of code.

Agora UI Kit for Flutter Instantly integrate Agora video calling or video streaming into your Flutter application. Getting started Requirements An Ago

Agora.io Community 106 Dec 16, 2022
This is a flutter plugin to detect edges in a live camera, take the picture of detected edges object, crop it, and save.

edge_detection A flutter plugin to detect edges of objects, scan paper, detect corners, detect rectangles. It allows cropping of the detected object i

Sawan Kumar Bundelkhandi 180 Dec 28, 2022
Flutter plugin for creating static & dynamic app shortcuts on the home screen.

Flutter Shortcuts Show some ❤️ and ⭐ the repo Why use Flutter Shortcuts? Flutter Shortcuts Plugin is known for : Flutter Shortcuts Fast, performant &

Divyanshu Shekhar 39 Sep 26, 2022
Flutter plugin for creating static & dynamic app shortcuts on the home screen.

Flutter Shortcuts Compatibility ✅ Android ❌ iOS (active issue: iOS support for quick actions) Show some ❤️ and ⭐ the repo Why use Flutter Shortcuts? F

Devs On Flutter 39 Sep 26, 2022
A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package. Built after react apollo

Flutter GraphQL Table of Contents Flutter GraphQL Table of Contents About this project Installation Usage GraphQL Provider [Graphql Link and Headers]

Snowball Digital 45 Nov 9, 2022
A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.

GraphQL Flutter ?? Bulletin See the v3 -> v4 Migration Guide if you're still on v3. Maintenance status: Low. Follow #762 for updates on the planned ar

Zino & Co. 3.1k Jan 5, 2023
Flutter talk - Repository with a live coding from a talk about Flutter

Don't do drugs, do Flutter! Repository with a live coding from a talk about Flutter.

null 12 Dec 17, 2022
Live portfolio designed using Flutter 2.0 available for android and web.

DevFolio - Portfolio for Developers Designed live portfolio using Flutter 2.0. Available for Android and Web. ?? How to install? Before these steps ma

Muhammad Hamza 533 Jan 7, 2023
Arispewdie - Flutter app to watch LIVE subscriber count of PewDiePie vs T-Series

PewDiePie VS T-Series Flutter app to watch LIVE subscriber count of PewDiePie vs

Behruz Hurramov 1 Jan 10, 2022
Sport-pluse - A live score and blogging flutter mobile app

sport-pluse A live score and blogging flutter mobile app

Marshal Greatness 0 Jan 1, 2022
Face Mask Detection mobile application built with Flutter and TensorFlow lite in order to detect face masks using images and live camera.

Face Mask Detector App Face Mask Detection mobile application built with Flutter and TensorFlow lite in order to detect face masks using images and li

Yousef Shaban 3 Aug 15, 2022