Post

Replies

Boosts

Views

Activity

Unreliable Network Requests with Interactive Widgets in Production Environment
We've noticed that network requests triggered when a user interacts with our widget are very unreliable. In development, they almost always work, but in production, many of them never reach the server, especially when many requests are performed in a row. The requests are performed using the URLSession.shared singleton instance: let session = URLSession.shared let task = session.dataTask(with: request) { data, response, error in ... } task.resume() Are there any limitations or restrictions on Interactive Widgets in a production environment that might cause this behavior? Is there a different way to implement or configure widgets to ensure network requests are reliably performed? Thank you.
1
0
497
Oct ’23
How to provide dynamic default values for a Parameter in a WidgetConfigurationIntent?
struct MyIntentConfiguration: WidgetConfigurationIntent { static var title: LocalizedStringResource = "Habit Selector" static var description: IntentDescription = IntentDescription("Select Habits") @Parameter(title: "Select Habits", size: 9) var habits: [HabitEntity] } The previous code correctly allows the user to pick the 9 habits they want to track in the widget. But initially the widget is empty. How can I define default values for the Parameter "habits" taking into account that the values are dynamic?
0
0
502
Jul ’23
Are Background Tasks supposed to work on Mac Catalyst?
I have an iOS application which uses both Silent Push Notifications and Background Tasks to keep the application up to date, both wake up the app even if it's killed and allow to run code on the background. Now I've turned this app into a Mac Catalyst app. I've managed to get Push Notification working, but I'm only receiving them when the app is opened, the app doesn't wake up if it's closed. Also, the Background Tasks don't work at all, the UIBackgroundRefreshStatus is always UIBackgroundRefreshStatusDenied. Is there any further configuration needed to run background code on Mac Catalyst? or is it not possible at all? Thanks.
1
0
1k
Feb ’21