Live Activity Not Working on Physical Device

I am playing around with Live Activities and got everything working on the iOS 16.1 beta 2 simulator using Xcode 14.1 beta 2 (14B5024i).

However, running the same code on a real physical device (iPhone X) running iOS 16.1 beta 2 does not show the Live Activity on the lock screen at all. 😵

Did anyone get their Live Activity working on a real device yet, or is this an issue with the current beta?

Things I have already checked:

  • ActivityAuthorizationInfo().areActivitiesEnabled returns true on my physical device
  • let activity = try Activity.request(...) successfully completes without throwing and I can see the activity.id printed to the console
  • Other live activities - such as the iOS system timer activity - do show up on my physical device just fine
Answered by oddis98 in 729817022

Had this issue, and turns out this if statement was the issue. Probably a bug since Apple has this listed in their documentation, but removing this and just return an EmptyWidgetConfiguration if the system is lower than 16.1 seems to have fixed it.

I have the same problem so I'm guessing it's an IOS 16.1 Beta 2 issue.

Accepted Answer

Had this issue, and turns out this if statement was the issue. Probably a bug since Apple has this listed in their documentation, but removing this and just return an EmptyWidgetConfiguration if the system is lower than 16.1 seems to have fixed it.

Thanks a lot! It worked!

With beta 3 this issue is come back. The wa is not working.

UPDATE

It stopped working with beta 3, beta 4 is also not working for me.

Can someone confirm that Live Activities show up on a physical device running beta 4?

Any workarounds?

not working with beta 3, any updates?

in beta 4 they worked here until yesterday. All other betas were also fine. if i subscribe to state changes i see "activity.activityStateUpdates": "active" and a few ms after "dismissed". Again the dismissed was not happening yesterday by itself, only if the user has really dismissed it.. no idea what is going on. It has been working fine in all the betas.

I'm seeing the same thing, I've raised feedback FB11699078. I also bought it up in the slack chat that Apple hosted yesterday. No reply as yet.

I figured it out. I had a new image which was a pdf. If I change tick the "Resizing: Preserve Vector Data" box in the asset catalog it works. With it unticked I think it must go over some resource limit and get killed.

To figure it out I replaced all my parent live activity/DI views with simple text fields and then it worked. Then it's a case of adding thing back until you figure out what's over the limit.

Obviously it would be better if apple fed this back to developers in a clear way. And also if the sim more closely modelled the device.

Still not work here with iOS 16.1 RC and Xcode 14.1.0 RC, Could anyone confirm Live Activities works with other widgets all together in physical devices now?

My current situation is that if the ActivityWidget is the only widget in bundle, the Dynamic Island and Live Activities in lock screen works normally. But if I included other widgets in the widget bundle, the Dynamic Island and Live Activities will not show, and other widgets works normally.

The work around mentioned above is not work for me

if the ActivityWidget is the only widget in bundle, the Dynamic Island and Live Activities in lock screen works normally. But if I included other widgets in the widget bundle, the Dynamic Island and Live Activities will not show, and other widgets works normally

Workaround: create a new Widget Extension target and isolate your Live Activity Widget there

I had the same issue as you, the live activity would start, update and end, but wouldn't show(only saw updates on the terminal). The issue turned out to be 'Minimum deployment target' in the Widget Target, it was set by default to a higher version than my physical device, but my simulator showed it because it was on the desired version.

I had the same issue. In my case replacing the options in app.xcschme

enableAddressSanitizer = "YES"
enableASanStackUseAfterReturn = "YES"

with

enableThreadSanitizer = "YES"

helped.

I am experiencing this running iOS 17.4 on my device... the Live Activity appears fine in the simulator, doesn't appear on my device on the Lock Screen or in Standby Mode.

Have tried removing the #available checks and targeting 16.1 but no dice.

I had the same issue, what I did to fix the issue, in the Widgets IntentTimelineProvider I had initialised the NSManagedContext in the constructor, just trying to remove this initialisation and putting it in the timeline method did fix the issue for me. I didn't have to separate the live activity in its own target and now both live activity and widgets are on the same target and working.

If you initialise something like CoreData in the constructor of your IntentTimelineProvider in one the widgets you have try to move it out of there maybe it will fix your issue.

Live Activity Not Working on Physical Device
 
 
Q