Post

Replies

Boosts

Views

Activity

Reply to We have limit timeline updates, why all the popular widget apps in the market get update at least every minute?
@pdpoblivion Thank you for the reply. I tried by providing 60 timeline entries, one for each minute, and refresh timeline after one hour. It's updating, but not very accurate, it has few minutes delay. var updateDateTime = Date() for _ in 1...60 { 		entries.append(TimelineEntry(date: updateDateTime, record: record)) 		updateDateTime = Calendar.current.date(byAdding: .minute, value: 1, to: timelineDate)! } completion(Timeline(entries: entries, policy: .after(updateDateTime))) Another way is provide one single entry for the timeline, and ask for refresh one minute later by using refresh policy .after(Date), it has few minutes delays to update as well. Anyway, from the tutorial, this policy is not for accurate update, it tells the earlier time that can refresh the timeline, so is the .atEnd policy. It looks like Timeline is not a proper approach to achieve accurate time update. Maybe it's a timer inside widget view? Every widget app from app store, they can update time accurately, I think I must missed something.
Nov ’20
Reply to widgetURL is override inside Foreach
Widgets support one widgetURL modifier in their view hierarchy. If multiple views have widgetURL modifiers, the behavior is undefined. @Claude31 Thanks for the reply, you are right. The record is a list of data structure, with unique identifier for each record, like struct UserRecord { 		id: String 		title: String } The deep link url looks like this: wig://1602639386. Manually open one url is working. Hmmm, let me see if any other approach can achieve this.
Oct ’20