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

98 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

LiveActivity not starting - error: target does not include NSSupportsLiveActivities plist key
I'm trying to start a live activity that allows a user to see and control a recording from their lock screen. I have an AppIntent that uses a class to start recording the user. The intent is used in a home screen widget. Upon pressing the button in the widget, the intent is called, which then calls the startRecording function within its perform. This function then tries to start the live activity, but it is currently failing with a "Failed to start live activity: The operation couldn’t be completed. Target does not include NSSupportsLiveActivities plist key" error. The relevant code block is this: func startRecording() { print("[RecordingManager] start recording called") isRecording = true let activityAttributes = RecordingControlWidgetAttributes(name: "RecordingManagerActivity") let initialContentState = RecordingControlWidgetAttributes.ContentState(isRecording: true, startTime: Date()) let initialContent = ActivityContent(state: initialContentState, staleDate: nil) if ActivityAuthorizationInfo().areActivitiesEnabled { do { liveActivity = try Activity<RecordingControlWidgetAttributes>.request( attributes: activityAttributes, content: initialContent, pushType: nil ) } catch { print("Failed to start live activity: \(error.localizedDescription)") } } else { print("Live activities are not available") } // TODO: actually start the recording } When this function is run/the button is pressed, the following messages are printed: "[RecordingManager] start recording called Failed to start live activity: The operation couldn’t be completed. Target does not include NSSupportsLiveActivities plist key" However, I have included the NSSupportsLiveActivities key, with value YES, in the target Info in XCode for both the main app target and the WidgetExtension. The following line exists in both the Release and Debug parts of the project.pbxproj file: INFOPLIST_KEY_NSSupportsLiveActivities = YES; I also tried including this key and value directly in the Info.plist file of both targets, but that also didn't work. This issue is occurring both on device and in simulator. I also checked that both my device and the simulator has LiveActivities turned on in Settings for the app. What could be going wrong? Are there any other situations where this error may print?
0
0
33
4h
Widgets & Live activities debug install dosen't work
Hi everyone, Like so many before me, i tried to install my app to test widgets, live activities & dynamic island implementation on a real device or on the simulator (neither works). The problem is that when I try to run the project I get this message : "SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'fr.example.LiveActivities.LiveWidget' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace). [......]". The first thing I tried was looking on Apple's forum and StackOverflow for a solution but after 1hour trying almost eveyrthing, nothing seemed to resolve my problem. Does anyone has an idea of how I could try to fix it ? I would love to show this project in my portfolio in order to find an apprenticeship, but I can't until I find a way to fix this. Thanks a lot!
1
0
84
2h
Interactive Live Activity Bug in iOS 18 - perform not called
In iOS 18 (beta 1-4) when you set openAppWhenRun = false in your AppIntent of your live activity the perform function never gets called. In iOS 16 and 17 my live activities work. I have downloaded other apps and in their live activities any button tab which doesn´t open the app is also doing nothing in iOS 18. Has anyone got this working? Any comments from an Apple engineer on this?
0
0
51
1d
Are push to start APNs tokens the same across different live activity types?
The ActivityKit API requires developers to parameterize calls to pushToStartTokenUpdates by the live activity's attributes, e.g. for await data in Activity<AdventureAttributes>.pushToStartTokenUpdates { // Send token to server. } for await data in Activity<BoringAttributes>.pushToStartTokenUpdates { // Send token to server. } At runtime, I have noticed that the token is the same for the different live activity attribute types we support in our app. Can someone confirm if this behavior is consistent? If the pushToStartToken is the same across different live activity types, it can simplify our database design 🙏🏼.
2
0
157
1w
[Live Activity / Dynamic Island] Countdown Timer issues (ending activity, styling)
Hello! I'm building a Countdown Timer for the Dynamic Island using a Live Activity. I have two issues for which I can't find any solution: We want to display the time in the "X minutes" format, like in this example. I went through the forum but all the answers were wrong, because they were using a Text(:format) which never updates in the live activity, or a Text(:timerInterval) which we can't format. I want the Live Activity to end once the timer gets to zero. I found this staleDate parameter that I thought would helped, but is actually only adding loaders on my design once the date is reached. I tried to implement a solution like the answer of this post, but the if (context.isStale) {...} part is never being rendered. It also looks like the stale sate gets activated only when the app is focus again. I tried several fixes, went through a lot of forum and posts, but I can't find any solution. Thanks!
0
0
172
2w
Live activities on watchOS not working on simulator
Is there a trick to getting the new Live Activities on Apple Watch working via the simulator? I have an iPhone paired to a watch simulator, but live activities created on the phone aren't appearing on the watch Smart Stack. It looks like maybe the Smart Stack isn't functional on the watch simulator, as there are a bunch of blank tiles where the Smart Stack should be.
0
2
169
2w
The button click for real-time activity did not work.
We added a button in the real-time activity that responds within the app upon clicking. Now we're encountering an issue where, if you immediately click this button after swiping down to enter the notification center, it only opens the app without any scheme response. You have to wait for about 1 second after swiping down before the button can respond normally. Could you please tell us why this is happening?
1
0
188
1w
Typography on Apple Watch Live Activity
I'm not quite sure whether this post belongs in a Design forum or here, but with iOS 18 Developer Beta 1 and watchOS 11 Developer Beta 1, when a Live Activity is displayed on an Apple Watch, the system font used is SF Pro rather than SF Compact. I would expect that the design guidance would be to stick with SF Compact while on watchOS, and I would expect that the system font, when displayed on the Apple Watch using .supplementalActivityFamilies([.small]), would appear as SF Compact. To ensure that SF Compact appears on my Live Activity when viewed on Apple Watch, I can set a custom font for use with the small supplemental family, but this seems really clunky; is there any other guidance here?
0
0
264
Jun ’24
Possible to start a live activity on watchOS 11?
I'm excited to bring my Live Activity to Apple Watch via the .supplementalActivityFamilies([.small]) modifier. However, I'm also wondering whether it is possible for my watchOS app, separately, to initiate a Live Activity and receive updates for it via push notification. From my testing it seems like no, but the function call itself can be made, since ActivityKit is available on watchOS. Are there any other recommendations for how to go about initiating a Live Activity from a watchOS app? Would I have to communicate with a companion iOS app to start the Live Activity on the phone instead?
2
0
261
4w
Screen time crashing
So I updated my phone to ios18 beta and ever since then my phone will always crash when I enter screen time but any other application nothing will happen, my phone has gotten so much slower and heats up faster. Lags so much! I dont know what else to do. I have 107gb and my max is 128gb so I don’t see that as the issue. Especially since I can’t enter into my screen time. I waited it out for almost two or one week. it hasn’t changed. restarted my phone and everything. please help asap!!!
3
3
381
Jun ’24
Integrate with the system provided Workout Live Activity in the Apple Watch Smart Stack
When I start a workout in my app, the system shows a Live Activity in the Smart Stack like in the picture. My app opens if I tap on it, but the pause and resume buttons doesn't do anything. I have implemented the PauseWorkoutIntent and ResumeWorkoutIntent which works with the Action Button. I guessed that these would be used from this Live Activity as well, but it seems like not. Has anyone successfully integrated with this? I haven't seen it documented anywhere, although I think it was already included in watchOS 10. This is also shown when using the built in workout app and for that the buttons work as expected.
0
0
233
Jun ’24
Interactive Live Activity in watchOS 11 - not getting AppIntent buttons to work
I have started to work on adding Live Activities to my app in watchOS 11. The app already has interactive Live Activities on the phone that works as expected. I have added a view for the activityFamily: small and it shows up as expected. My problem is that buttons doesn't work. I use the Intent based button, and on the iPhone Lock Screen they work. On the watch, nothing happens. Has anyone got this working? Not sure if I'm missing something or if it's a bug.
3
0
375
2w
Live Activity compact timers
The Human Interface Guidelines for Live Activities provide several examples of compact presentations that have a timer counting down formatted like "3min" or "3m", similar to the timers in the Clock app. Such examples can be found in this Stack Overflow question: https://stackoverflow.com/questions/77551496/is-it-possible-to-make-an-only-minutes-1m-countdown-in-a-live-activity A Timer initialized with init(timerInterval:pauseTime:countsDown:showsHours:) has provided a live countdown timer in widgets and live activities, but the formatting is limited. And since live activities come with limitations that prevent us from using Timers, there's no real way to implement this kind of thing ourselves. What is Apple's official guidance for implementing this kind of timer for the compact presentation?
3
2
342
2w