Widgets & Live Activities

RSS for tag

Discuss how to manage and implement Widgets & Live Activities.

WidgetKit Documentation

Posts under Widgets & Live Activities subtopic

Post

Replies

Boosts

Views

Activity

Live activity custom format timer
We need a live activity to countdown our time in formats like 2h 30m -> 2h 29m -> 2h 28m etc 58m -> 57m I see this kind in pictures in official documentation. to make a functional timer is: Text(context.state.startTime, style: .timer) But it's very limited when it comes to formatting. This timer .relative includes seconds which we don't want Text(futureDate, style: .relative) Also format we need is h instead of hour, m instead of min
0
1
22
2w
WidgetKit: UIImage(named:) Fails to Load Asset After App Upgrade
Attachments: Problem Description: I encountered an issue related to WidgetKit. Inside a widget, I used the following API: UIImage(named: "some_pic_in_asset")! However, in my crash monitoring system, I observed a large number of crashes caused by force-unwrapping a UIImage that could not be loaded. After analyzing the crash reports and the associated app version information, I found that this issue consistently occurs during the app upgrade process. For example: A user installs the app at version A and adds the widget to their Home Screen. Later, the app is upgraded to version A+1. Then, in the monitoring backend, I observe many crashes. The crash itself happens under version A, but the report is uploaded under version A+1. Since crash collection happens in the widget and the report is uploaded by the app, the version mismatch is understandable. I also confirmed that the number of crashes strongly correlates with the number of app version upgrades. Based on this analysis, I believe that in the upgrade scenario described above, UIImage(named: "some_pic_in_asset") sometimes fails to load the image even though it exists in the asset catalog. Please note that the force-unwrapping operation is not the focus of my concern here. Question: Is this a known system issue? If so, is there a plan for fixing it in future iOS updates?
0
0
47
1w
Unable to activate ActivityKit
Appears during code compilation Provisioning profile "iOS Team Provisioning Profile: ..*" doesn't include the com.apple.developer.ActivityKit entitlement, Has anyone encountered or resolved a similar issue where the ActiveKit feature was not found in the developer's identifier, despite not being activated in the developer's system?
0
0
26
1w