Open Jasco07122021 opened 1 year ago
Is the callback invoked by the widget?
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?
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);
}
}