Fix update checker for iOS
This commit is contained in:
parent
88e34683ee
commit
50b6d95ec2
2 changed files with 7 additions and 3 deletions
|
@ -73,9 +73,13 @@ class UpdateService {
|
|||
return _latestVersion;
|
||||
}
|
||||
|
||||
Future<bool> shouldShowUpdateNoification() async {
|
||||
Future<bool> shouldShowUpdateNotification() async {
|
||||
final shouldUpdate = await this.shouldUpdate();
|
||||
|
||||
if (!shouldUpdate) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final lastNotificationShownTime =
|
||||
_prefs.getInt(kUpdateAvailableShownTimeKey) ?? 0;
|
||||
final now = DateTime.now().microsecondsSinceEpoch;
|
||||
|
@ -87,7 +91,7 @@ class UpdateService {
|
|||
}
|
||||
|
||||
Future<void> showUpdateNotification() async {
|
||||
if (await shouldShowUpdateNoification()) {
|
||||
if (await shouldShowUpdateNotification()) {
|
||||
// ignore: unawaited_futures
|
||||
NotificationService.instance.showNotification(
|
||||
"Update available",
|
||||
|
|
|
@ -195,7 +195,7 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||
},
|
||||
);
|
||||
_initDeepLinks();
|
||||
UpdateService.instance.shouldShowUpdateNoification().then((value) {
|
||||
UpdateService.instance.shouldShowUpdateNotification().then((value) {
|
||||
Future.delayed(Duration.zero, () {
|
||||
if (value) {
|
||||
showDialog(
|
||||
|
|
Loading…
Add table
Reference in a new issue