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
Post
Replies
Boosts
Views
Activity
Here you can see, we add Spacer in the bottom HStack, but the timer Text still expands and takes up all the horizontal space. There’s a discussion, but no one has the solution.
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.