LiveActivity UI not showing in flutter ios app

I'm implementing iOS Live Activities in my Flutter app using the live_activities package. While the activity seems to be created (I can get the activity token, and clicking the Dynamic Island opens the app), the LiveActivity UI does not show up as expected.

Logs: The following errors/warnings appear in the logs:

Not updating lastKnownShmemState in CFPrefsPlistSource<0x6000006bc7e0> (Domain: group.powerdock.sessionactivity, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): 34 -> 33

What Works: The activity token is created successfully. Clicking the Dynamic Island opens my app.

What Does Not Work: The LiveActivity UI does not display on the lock screen or elsewhere.

When testing you will want to enable frequent updates otherwise you run into situations like this.

To debug:

1)Plug the devices that aren’t showing the activities in to your computer and monitor with Console.app 2) Look for logs relating to your processes (target names), apd (the apns daemon) and the topic you are using for push. 3) filter by Budget and if you see : priority(0), budget(0) or running-not-visible, the system has decided to not show your activity.

Some reasons why this may occur:

  1. low battery mode
  2. bad data in the push(es)
  3. too many pushes in a short period of time
  4. Your archived file is over 2 MB

The only way to remedy this (because you cannot manually do this) is to wait for the system to add budget which can take up to 24 hours, and as you’ve seen, resetting the device doesn’t work.

There is also a chance the tokens you are using for testing aren’t matching the apns environment they should be used with. As example, tokens generated from test flight builds are actually production tokens and not sandbox as some would expect.

If there are specific pushes with timestamps and topics you can provide, I should be able to get more information, but Console.app will usually shed enough light to remedy any issues.

Hopefully this helps.

Rico


WWDR | DTS | Software Engineer

LiveActivity UI not showing in flutter ios app
 
 
Q