I only see the answer after post this comment, so forget about this.
Using Xcode 12 beta 5, still having this issue: Widget works locally on a device from Xcode but not after I distribute it through TestFlight, it just disappeared. Any ideas?
Below is my codes:
Code Block swiftstruct Provider: IntentTimelineProvider { |
typealias Entry = ScreenTimeEntry |
|
typealias Intent = ConfigurationIntent |
|
func placeholder(with: Context) -> ScreenTimeEntry { |
let entry = ScreenTimeEntry.sample |
return entry |
} |
|
public func snapshot(for configuration: ConfigurationIntent, with context: Context, completion: @escaping (ScreenTimeEntry) -> ()) { |
let entry = ScreenTimeEntry(date: Date(), configuration: configuration) |
completion(entry) |
} |
|
public func timeline(for configuration: ConfigurationIntent, with context: Context, completion: @escaping (Timeline<Entry>) -> ()) { |
let currentDate = Date() |
|
let entries: [ScreenTimeEntry] = [ |
ScreenTimeEntry(date: currentDate, configuration: configuration) |
] |
|
let timeline = Timeline(entries: entries, policy: .atEnd) |
completion(timeline) |
} |
} |