Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull inside a SwiftUI widget: does it work for you? #237

Open
kleber-maia opened this issue May 31, 2021 · 0 comments
Open

Pull inside a SwiftUI widget: does it work for you? #237

kleber-maia opened this issue May 31, 2021 · 0 comments

Comments

@kleber-maia
Copy link

kleber-maia commented May 31, 2021

My app has a couple of Today Widget extensions in which I’m successfully invoking mySyncEngine.pull() method, resulting in an awesome user experience, since any remote updates are immediately available for the user.

I’m now working on a new version of such widgets using SwiftUI. I’ve tried a similar approach inside my provider’s getTimeline() and/or getSnapshot() methods, however it doesn’t seem to have any effect: no updates are ever pulled. The widget’s entitlements look the same as the old widgets. The debugger doesn’t show any error messages: but I’m not sure I should trust on that lack of output.

The only good news so far is that, when “Background App Refresh” is enabled on the device, remote updates received via silent push notifications will indeed update my local database and the widget will also reflect such updates on its next snapshot. But relying on that setting alone is not good news for me, since many users disable it and it’s also not available on macOS (while my app has a Mac Catalyst version).

Has anyone been able to pull this feat (pun intended)? 😅 Any tips or suggestions are much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants