I'm trying to use a custom font in my Live Activitiy view. To do so, I copy the TTF file into the bundle in the Copy Bundle Resources build phase and add a corresponding entry in the UIAppFonts dictionary in my widget extension's Info.plist. I specify a custom font for one of my Text views as follows: Font.custom("RobotoMono-Bold", size: 12), where the string is equal to the TTF file name. This approach works fine in SwiftUI previews and the custom font renders as expected, but when I try requesting an Activity from my app, the Live Activity never starts. The Activity.request(attributes:contentState:) completes successfully but neither the Dynamic Island, nor the Lock Screen or Notification Center show the activity. Inspecting the simulator's logs in Console.app, I see a suspicious error:
Task [2] [my.app.bundle.WidgetExtension:Attributes type: MyActivityAttributes:35E934FB-D3BF-4929-B7A0-90E0886E1F1E] Reload failed; 1 retries remaining: com.apple.chrono.activites.content (1) ChronoKit.PlatterFetchingError(targetIdentifer: [my.app.bundle.WidgetExtension:Attributes type: MyActivityAttributes:35E934FB-D3BF-4929-B7A0-90E0886E1F1E], contentErrors: [ChronoKit.PlatterContentError(code: Returned timeline could not be accepted, targetIdentifer: [my.app.bundle.WidgetExtension:Attributes type: MyActivityAttributes:35E934FB-D3BF-4929-B7A0-90E0886E1F1E], contentIdentifer: [w:fix-373.00-h:dyn-64.00-160.00-cr:12.0], destinationURL: nil, underlyingError: Optional(ChronoKit.RequestCompletionOperation.Error.archiveTooLarge(fileSize: 2591912.0 B)))])
Note the archiveTooLarge(fileSize:) error type at the end that indicates some archive's size to be about 2.5 MB. I'm not sure which archive this error is referring to and how I can influence it. My WidgetExtension.appex bundle is 704 KB in size before adding the custom font and 857 KB afterwards. The TTF file itself is 109 KB in size.
Is using a custom font in a Live Activity this way supposed to work, am I just doing something wrong, or am I running into a limitation of the system here?
Post
Replies
Boosts
Views
Activity
I have a use-case where I want to display a remote image in a Live Activity. The image can only be downloaded when the user starts the activity.
I wonder if there is a recommended way to do this. I tried using AsyncImage in the widget view, but I assume it's not working because of the network connectivity limitation of Live Activities. I also tried downloading the image beforehand in the main app and passing it as a parameter of my ActivityAttributes, however requesting the Activity results in a nondescript error: Error Domain=com.apple.ActivityKit.ActivityInput Code=1 "(null)".
The only other way to achieve this I could think of is using app groups and storing the image on disk for the widget extension to load it again, which seems unnecessarily error-prone.
I haven't tried this last approach yet, because I wanted to gather some feedback first. I'm happy about any tips and pointers you might have!
On macOS in the Safari 14 Beta 2, Safari defaults to displaying all tabs in the new compact style (only the favicon visible) whenever Show website icons in tabs in Preferences > Tabs is selected and a lot of tabs are open.
As this doesn't fit at all with my style of using Safari, I was looking for a way to disable this while leaving icons in tabs enabled.
Is there a way to disable the above mentioned behavior, maybe using the defaults cli command?