The widgets works perfectly fine when debug built on a simulator. But when release scheme is built on a real device, it shows blank with some placeholder view, and editing widget does not work.
Using Xcode Version 12.4 (12D4e)
Real device(SE 2) running iOS 14.4
TestFlight build also having the same issue.
Have a configurable widget with the builder configuration as follows
In the real device'c console I could see some errors:
2. Error after adding
Here is my getTimeline implementation:
I have tried this solution, but with no luck!
I would appreciate any help,
Thanks in advance!
Using Xcode Version 12.4 (12D4e)
Real device(SE 2) running iOS 14.4
TestFlight build also having the same issue.
Have a configurable widget with the builder configuration as follows
Code Block swift struct SensorWidgetBuilderUIView: Widget { let kind: String = "SensorWidget" var body: some WidgetConfiguration { IntentConfiguration(kind: kind, intent: SensorWidgetIntent.self, provider: SensorProvider()) { entry in SensorWidgetEntryView(entry: entry) } .configurationDisplayName(LocalizedStringKey("sensor_widget")) .description("dummy") .supportedFamilies([.systemSmall]) } }
In the real device'c console I could see some errors:
Error on adding widget to homescreen
Code Block shell Can't create SBHWidgetConfigurationInteraction because missing widgetDescriptor (<private>) or widgetIntent ((null))
2. Error after adding
Code Block shell No intent in timeline(for:with:completion:) [com.telldus.live.mobile.HomescreenWidget:SensorWidget] reload: failed with error The operation couldn’t be completed. (CHSErrorDomain error 1101.))
Here is my getTimeline implementation:
Code Block swift func getTimeline(for configuration: SensorWidgetIntent, in context: Context, completion: @escaping (Timeline<Entry>) -> ()) { let date = Calendar.current.date(byAdding: .minute, value: SensorProvider.updateIntervalInMinutes, to: Date())! WidgetUtils().getSensorSimpleEntry(configuration: configuration) {sensorWidgetStructure in let entry = SensorSimpleEntry(date: date, sensorWidgetStructure: sensorWidgetStructure) let timeline = Timeline(entries: [entry], policy: .atEnd) completion(timeline) } }
I have tried this solution, but with no luck!
I would appreciate any help,
Thanks in advance!
The issue is resolved, it was a mistake at my side.
I missed to enable "App groups" for the intent extension. The app group id is used by my SQLite db manager, and some SQL queries were being executed when a user add a widget, and also when press edit, which to my surprise caused no issues at all while development, only popped up in release builds
I missed to enable "App groups" for the intent extension. The app group id is used by my SQLite db manager, and some SQL queries were being executed when a user add a widget, and also when press edit, which to my surprise caused no issues at all while development, only popped up in release builds