ActivityKit

RSS for tag

Help people keep track of tasks and events that they care about with Live Activities on the Lock Screen, the Dynamic Island, and in StandBy.

Posts under ActivityKit tag

95 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

How to dismiss live activity notification from Watch?
If you update live activity with alertConfiguration: argument, iPhone shows a notification (or expands dynamic island): await runningActivity.update(content, alertConfiguration: .init(title: "Alert", body: "Done!", sound: .default)) Paired Watch presents a notification as well: I cannot find a way to dismiss that live activity notification from Watch. Is there a way to remove it similarly to UNUserNotifications? UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: [notificationID])
0
0
696
Jul ’23
SwittUI.Text(timerInterval) display as xx:-- in Live Activity when Always-On Display is Active
We notice when iPhone 14’s lock screen goes in Always-On mode, the countdown text in Live Activity: seconds part is displayed as -- minutes part only refresh every minute. Do you have any recommendations on how to improve it? For example, is there any system event or API to let our Live Activity know when lock screen enters/exit Always-On mode? If they are available, we would show something else to the user instead of xx:-- in Always-On lock screen.
2
2
662
Aug ’23
Is Timer disabled in Live Activity / Widget?
In a Live Activity, we have use case to show some countdown for the user o finish some tasks before a deadline. When the deadline reaches, we want to show a different message. We create a timer in our Live Activity codes, listen to it and want to change the text when the timer fires. But, the timer never fires. We write another simple codes to verify: We didn’t see the countdown effect. We are wondering if Timer is disabled in Live Activity, so it never fires or State variable is disabled, so even Timer fires and changes State variable’s value, View cannot pick up the new State variable’s value
1
0
732
Aug ’23
Can Live Activities be updated via `activity.update` in extensions?
I'm trying to build a live activity with the new iOS 17.0 interactivity, and I want a button on the live activity to update the live activity when clicked (e.g. start a timer). This works fine with a widget, but with live activities it doesn't seem like the activity view gets refreshed instantly. As a workaround, I tried putting the activity.update code in the button's intent's perform method. This doesn't seem to work as the intent gets executed from the widget extension, which seems to always have an empty activities (link) array. Question: Is activity.update only meant to be called from the app (either foregrounded or in a background task), or should it also be possible to be called in the WidgetExtension itself? Ideally I'd be able to avoid using push notifications, which seems overkill for e.g. just at timer. Related thread: Changing the live activity without push notification
3
0
1.2k
Aug ’23
Live Activity not working on iOS 16.6
Hey all, I was testing my app on my iPhone that just updated to 16.6. For some reason, when I request to show an Activity, the request goes through, tells me that my live activity is currently running (w/o any errors) yet won't show on the lock screen. When I tested on the Simulator, which is running 16.4, I am able to see the Live Activity perfectly fine. Has there been some change that would prevent me from seeing the Live Activity now?
2
0
1.2k
Aug ’23
how to use Live Acitivity in objective-c project?
I have a history objective-c project, and now i want to use Live Acitivity feature in that objc project. first i implement a live activity in swift project, and it works well on iphone devices. then i copy same codes from swift project to objective-c project, build and run on same iphone device, no error or warning generates, but Live Activity UI can't seen. can someone tell me how to fix it ? and only swift project can support Live Activity ?
1
1
470
Sep ’23
How to integrate Live Activity into Objective C projects ?
I have a food delivery app similar to Uber Eat it was developed in Objective C now the requirement is to implement the Live activity for tracking the Active orders in live Activity. As i tried Live activity over the Swift it is working fine on all IOS Devices but when i implement that swift code into Objective C using all the standards by Bridging between Swift and Obj C copied the same code, There is no Error or Warning i am seeing in Live activity functionality in Objective C, but Live Activity UI can't seen on Lockscreen even i have checked in settings my app is showing that it supports Live Activity but no view. Can somebody help me out in that how to integrate live activity into Objective C project?
0
0
457
Sep ’23
Incorrect compact Dynamic Island layout on iOS 17
Hello, I noticed that the layout of compact Dynamic Island on iOS 17 is incorrect. The edge of the circle shape is unable to be aligned with the edge of Dynamic Island. However, the layout in Xcode Preview is just perfect. And this is also the same layout on previous iOS 16: If you try to workaround the issue by adding an offset to the view, it will be cropped by a misaligned circle.
5
5
1.4k
Oct ’23
Reloading data and rescheduling local notifications, based on AppIntent interaction in iOS 17 Widgets and Live Activities
Hi everyone, I have two questions regarding some issues with the new iOS 17 interactive widgets and live activities. Question 1: How can I update other Widgets and/or Live Activities, based on an AppIntent interaction in either one? I have several widgets that is displaying the same information, but in different sizes (Small, Medium, Large and Lockscreen). Most of our users are using many of them together on their Lockscreen and Home Screen. When they are interacting with the AppIntent button in either the Widget og LiveActivity it does not update and vice-versa. Based on the documentation it's pretty clear that interacting with a Widget it will update the timeline for that specific widget after the .perform() in the AppIntent is returned. Unfortunately, I also need to update the LiveActivity and the other TimeLines for the rest of the widgets. I have tried to use the WidgetCenter.shared.reloadAllTimelines() but it seems like it does not update the LiveActivity or the LockScreen widgets correctly. Question 2: How can I update and reschedule the local notifications based on the interaction in the Widget and Live Activity? The app sends a local notification whenever an activity starts or stops (e.g like a pomodoro timer with intervals). Let's assume the user have setup a 30 minute activity in the app, but now decides to pause the activity from either the widget or live activity. I then want to remove the scheduled local notification that was supposed to be fired in 30 minutes. I haven't been able to read from the documentation if this is possible, but would like to know if there is any way this can be performed. Looking forward to hear if anyone have encountered the same challenges :)
1
0
607
Nov ’23
Content replace transition for SwiftUI?
In session wwdc2023-10194 Design dynamic Live Activities at 04:53, it mentioned that we should use 'content replace transition' for animating in and out graphic elements and text. The video shows some kind of animation combined with blurring and opacity changes. But I can't seem to find code for doing this in SwiftUI or UIKit. Does anyone know the API to achieve this? 🤔 Thank you for your help!
0
0
453
Sep ’23
Dynamic Island Height
I just want to know what is maximum height of dynamic island(expanded). When I just go through the documentation, it is showing 160pt. Here is url: https://developer.apple.com/design/human-interface-guidelines/live-activities#Specifications But as I observed, some of applications have more than 160pt height of dynamic island (expanded). If this is possible, how we can increase height of dynamic island. Even if we go through figma library, it is also showing more height https://www.figma.com/file/YVWH9fn64y36***6jYdks5/Dynamic-Island-iPhone-14-(Community)?node-id=0%3A1&mode=dev
0
0
910
Sep ’23
Tracking pushTokenUpdates and activityStateUpdates when app isn't running
Hello team, I'm looking for advice, please, about how to track updates to Activity.pushTokenUpdates and Activity.activityStateUpdates if my app isn't running. These two async sequences work great when my app is running, but that information is just as important if, for some reason, my app isn't running. In the WWDC video Update Live Activities with push notifications, the presenter says: when the system requests a new push token for an existing activity, your app will be given foreground runtime to handle it accordingly I was hoping that my app to be launched in the background... but I don't see how that would work unless there's a new call via the AppDelegate. Follow-up question... is there any documentation for the scenarios when a push token might be replaced for a live activity? Thank-you! Matthew
0
0
426
Sep ’23
Can't start Live Activity from App Intent if another LA already started
A have a few App intents that conforms to LiveActivityStartingIntent. If there are no active LA, then any of my intents can start live activity. But if there is at least one active LA then requesting LA returns an error: "The operation couldn’t be completed. Target is not foreground" Is there a limit to only 1 LA or I do something wrong?
1
0
590
Sep ’23
Error when running Live Activities
Hi there, This is my first time posting here. I'm working on small projects on Swift and SwiftUI now and then. I'm currently trying to develop an application that gets some bus arrival data using API and displaying them with live activities. The thing is that I'm not quite sure how frequently updates work yet. Still trying to figure out if I can update the live activity everytime the data coming right from the API changes or use push notification updates each minute passing by, but that is another thread that I'm going to focus with more details. Everytime i'm trying to deploy my app on my iphone or a simulator this error keeps popping up and I can't figure out why. Any ideas? Let me know if you need any snippet of my code. SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'com.gregorikouk.MapKitTut.BusWidgetKit' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0xb1282dfe0 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.gregorikouk.MapKitTut.BusWidgetKit)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.gregorikouk.MapKitTut.BusWidgetKit)}}, FBSOpenApplicationRequestID=0xe5da, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}." UserInfo={NSLocalizedDescription=Failed to show Widget 'com.gregorikouk.MapKitTut.BusWidgetKit' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0xb1282dfe0 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.gregorikouk.MapKitTut.BusWidgetKit)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.gregorikouk.MapKitTut.BusWidgetKit)}}, FBSOpenApplicationRequestID=0xe5da, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}., NSUnderlyingError=0xb1281d830 {Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0xb1282dfe0 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.gregorikouk.MapKitTut.BusWidgetKit)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.gregorikouk.MapKitTut.BusWidgetKit)}}, FBSOpenApplicationRequestID=0xe5da, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}}} Domain: DTXMessage Code: 1 User Info: { DVTErrorCreationDateKey = "2023-10-02 21:06:04 +0000"; } -- System Information macOS Version 14.0 (Build 23A344) Xcode 15.0 (22265) (Build 15A240d) Timestamp: 2023-10-03T00:06:04+03:00
3
0
1.1k
Oct ’23
Async operation in LiveActivity
In my App I use Live Activities that are updated using Push Notifications. This works fine and the Live Activities show the correct data. BUT: The data I get with these Push Notifications contain a geo location (latitude and longitude). And for these I want to display two things: 1.) The address that I want to decode using "CLGeocoder" with function "reverseGeocodeLocation", but this function is async and I can't get the app to start any async function. 2.) I would like to display a small Map with a Pin for this location. I want to use "MKMapSnapshotter" for this. But here the same async problem :( So, is there a way to handle this? Perhaps I just use the wrong point to start the async function. I tried ".task{}" and ."onAppear{}" But both are not working :(
0
0
331
Oct ’23