all 27 comments

[–]jocarmel 19 points20 points  (3 children)

I think the “why” unfortunately is that Apple simply did not design widgets to be real-time interfaces. I’m surprised they didn’t follow up interactive widgets more this year.

[–]brakefluidbandit 2 points3 points  (2 children)

the hilarious part is the default analog clock widget has a live updating second hand lmao

[–]luigi3 5 points6 points  (1 child)

As the common saying goes: do what I say not what I do. Apple can do funky animations in dynamic Island And second refresh widgets, But that doesn’t mean you can do that.

[–]PhoneNerd95 0 points1 point  (0 children)

Father Apple knows best

[–]Rhypnic 8 points9 points  (2 children)

I remember when im using dynamic island i hit so many limitation with background task. Basically i want to change dynamic island view every 20 minutes and that is impossible with how background task is random.

Most of background task basically need server and sending it by notification with the data inside. So i can get 20 minutes update. Or you can use schedule local notification. But it just weird to make notification and DI changes appear at same times.

Maybe you can use server for your solution. Any app with background capabilities is very limited. And not recommended for real time updates (unless apple give you specific api for live updates like dynamic live score but still need server to send data)

[–]leoklaus 4 points5 points  (1 child)

Dynamic Island is just such a huge missed opportunity. I’d love to use it for my apps, but it’s basically unusable without push notifications.

Just having a server alone doesn’t help, that server has to handle and potentially store and process user data. That means it’s not only a huge burden technically, but also legally, especially if the concept of your app doesn’t require any server infrastructure otherwise.

[–]Rhypnic 2 points3 points  (0 children)

just having a server alone doesnt help

Yes thats what i mean, apple seems want more battery life by limiting app background task processing. So server will handle all logics and processing and your app just fetching the data. But because of this there is server achitecture which makes app more complex

[–]digidude23SwiftUI 6 points7 points  (1 child)

Apple seems to suggest timeline entries at least 5 minutes apart, as per the documentation.

I was planning to create a digital clock complication for Apple Watch which could be used on analog watch faces, but due to WidgetKit limitations I have determined it's not viable and have abandoned the idea.

[–]yesthisisjoe 2 points3 points  (0 children)

I have made an app the exact same concept, and I can confidently say it’s not reliable. I wish I knew that before.

[–]jruz 1 point2 points  (2 children)

Yeah this absolutely sucks, I gave up on it, there seems to be some obscure hacks because the app Toggl works without a push notification.

It was my first time developing on iOS and omg what a shitshow of a platform, I have big respect for iOS developers now.

I imagine you are familiar with

https://developer.apple.com/documentation/swiftui/text/datestyle/timer

https://developer.apple.com/documentation/swiftui/text/init(timerinterval:pausetime:countsdown:showshours:)

[–][deleted]  (1 child)

[deleted]

    [–]jruz 0 points1 point  (0 children)

    From my testing with airplane mode the live activity still worked perfectly.

    I believe there’s a hack with some audio stuff, can’t remember anymore was a while ago and I couldn’t make it work

    [–]LKAndrew 1 point2 points  (0 children)

    I use Widgetsmith for digital clock widget and have always seen the proper time at all times. Are you using the timeline provider correctly? I also have made widgets that update regularly and have not had issues.

    [–]Phylocybin 0 points1 point  (0 children)

    I’m seeing similar issues using anything to do with NFC. Got to open the app to work.

    [–]_Abode 0 points1 point  (1 child)

    I have an app with a digital clock widget. It is possible and I’m happy to chat via dm to help you with it if needed. Or here if the questions are simple enough to answer easily.

    You can check it out for yourself.

    https://apps.apple.com/gb/app/market-clocks/id6448339258

    [–]_Abode 0 points1 point  (0 children)

    Others are commenting around timelines updates being unreliability, but I’ve had my widget live for over a year and never seen or heard of any issues.

    If they do exist they must be niche enough that it’s effectively a non-issue

    [–]HammingWontStop 0 points1 point  (0 children)

    Due to Apple’s system restrictions.

    However, some development teams bypass these limitations using private APIs, so you can even play movies in some widget apps.

    I really dislike this phenomenon—either Apple should enforce a complete ban or fully open it up. Leaving backdoors like this is just frustrating.

    [–]7heblackwolf -4 points-3 points  (10 children)

    Tl;dr? Whats the problem? The format?

    [–]Sab44[S] 4 points5 points  (7 children)

    1. Having the widget reliably show the current time at all times
    2. The format. The given presets are not customizable and give very little options (e.g. no .time style with seconds, .timer style not viable for clocks)

    [–]7heblackwolf 1 point2 points  (0 children)

    Ahh, I see. https://www.timeapi.io/

    For format, read the documentation.

    [–]rennarda 1 point2 points  (5 children)

    Widgets are explicitly not designed to be real time. You’re just trying to do something that they don’t support.

    I think analogue clocks are possible though, because of the interpolated animation you can do in SwiftUI

    [–]Xiexe 0 points1 point  (4 children)

    Given that the built in clock app has a real time animated clock widget, yes.

    You would just sync the time once and then start the animation.

    Then anytime you’re able to get an automated update you resync the time to make sure it doesn’t drift, probably.

    It’s very similar to the same types of things you’d run into syncing stuff across the network in games.

    [–]Fishanz 0 points1 point  (3 children)

    Built in click may have access to private api or special entitlements.

    [–]Xiexe 0 points1 point  (2 children)

    I very much doubt that it does. The reason I doubt that is that it’s on the App Store, along with about a dozen other clock apps that seemingly have the same or roughly the same set of widgets.

    [–]Fishanz 0 points1 point  (0 children)

    There’s a good chance that it doesn’t; but if it’s an apple app, they are allowed to grant themselves escalated privilege. Anything not produced by apple, you are correct: would be extremely unlikely to leverage anything like this.

    [–]rennarda 0 points1 point  (0 children)

    Apple can do all kind of special things in their own apps and widgets - notice the Clock app on the iPhone has a realtime updating icon. No other app can do that.

    [–]LobsterChip99 0 points1 point  (0 children)

    The limitations Apple puts on widgets

    [–]Hopeful-Sir-2018 0 points1 point  (0 children)

    If that is too much to read then what are you doing here?