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

Widget not update background when app killed ( home_widget: ^0.4.0-alpha.0 ) #168

Open
Jasco07122021 opened this issue Oct 9, 2023 · 2 comments

Comments

@Jasco07122021
Copy link

My device is Android ( Samsung S10 )

void main() {
HomeWidget.registerInteractivityCallback(backgroundCallbackHomeWidget);
...
}

@pragma('vm:entry-point')
Future backgroundCallbackHomeWidget(Uri? uri) async {
print('uri $uri ${uri?.host}');
await AppWidgetBackground.initCall();
bool isRegistered = locator.isRegistered();
if (!isRegistered) {
try {
await configureDependenciesHomeWidget(envDev);
isRegistered = true;
} catch (e) {
log('Error $e');
AppWidgetBackground.closeWithoutInject();
}
}
if (isRegistered) {
AppWidgetBackground.init(locator, uri);
}
}

@ABausG
Copy link
Owner

ABausG commented Oct 12, 2023

Is the callback invoked by the widget?

@Jasco07122021
Copy link
Author

Sorry, it worked, but the widget refreshes in 3.4 seconds on the first click after the app is closed or the first widget is created. I think it takes time to connect the flutter engine. Can we add a new function for this bad case?

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

No branches or pull requests

2 participants