-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
await calls not working on iOS HomeWidget.registerInteractivityCallback while in background #176
Comments
It also seems that whatever the background method used for the |
Possible workaround is to start an iOS background task when executing the background callback (e.g. with this library https://pub.dev/packages/ui_background_task). I believe the problem is that the iOS can arbitrarily stop the execution of the Dart code when the app is in the background. Background task gives you 30 seconds to complete the operation. |
As a temporary solution I just moved the async tasks from Dart side directly into iOS Swift. Doing this seems to properly fetch any data from the await calls. |
There seems to be an issue on iOS side when clicking the Home Widget button to refresh the data on the Home Screen Widget:
Workmanager().executeTask((task, inputData) async { //API CALL HERE return Future.value(true); });
from the home_widget 'backgroundCallback' set to respond from the home widget button call, but it will fail and the app will just respond with
Is there any way to fetch data from API REST calls using the new method of button clicks on the home widget for iOS?
Android is working fine with the current dart code that I have and is populating the widget UI elements fine from the http requests.
The text was updated successfully, but these errors were encountered: