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

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
116
4d
[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
147
1w
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
146
1w
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
173
5d
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
247
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
237
3w
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
349
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
220
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
338
1w
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
318
1w
Live Activities
I work on an App that uses Live Activities and shows a countdown. We want to use it without the seconds. We are currently using Text(getDate(), style: .relative). Is there a new method in Swift to show the countdown on a Live Activity without seconds being displayed.
1
0
207
Jun ’24
Live Activity Widget -
Hi, I'm developing a Live Activity Widget that shows a count down timer. In the current solution I have a stop watch that is responsible for handling the start, stop, resume, reset function. When the stop watch starts I have timer that calls on an updateTime function every 0.2 seconds. This works well. The problems comes when I try to use my stop watch in the Live Activity Widget. I have a timer that updates the live activity attributes with content every 0.5 second. // Start the activity let activity = try? Activity.request(... DispatchQueue.main.async { self.logger.log("Start internal timer") self.timer = Timer.scheduledTimer(withTimeInterval:0.5, repeats: true) { _ in self.logger.log("Update activity widget.") self.updateActivity() } } Is this a correct approach? If not what should I use to implement a stop watch with a count down timer and a corresponding progress bar/view?
1
0
270
1w