From 50c449159bd108f25aeabc7aea1d8a1075f9d34e Mon Sep 17 00:00:00 2001 From: Diego Costa Date: Fri, 29 Oct 2021 00:37:11 -0300 Subject: [PATCH] feat: adds support to macOS --- README.md | 2 +- lib/src/siren.dart | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index db34073..d0096ee 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ The Flutter port of the popular [Siren](https://github.com/ArtSabintsev/Siren), one way to notify users when a new version of your app is available and prompt them to upgrade. -🚀 Supports iOS and Android. +🚀 Supports iOS, Android and MacOS. ## Install Add this to your package's pubspec.yaml file: diff --git a/lib/src/siren.dart b/lib/src/siren.dart index 14525ed..bace93f 100644 --- a/lib/src/siren.dart +++ b/lib/src/siren.dart @@ -15,11 +15,15 @@ class Siren { SirenStoreResponse(version: '', package: '', url: ''); static SirenStoreService _getStoreClient() { - if (Platform.isIOS) { + if (Platform.isAndroid) { + return SirenGooglePlayStore(); + } + + if (Platform.isIOS || Platform.isMacOS) { return SirenAppleAppStore(); } - return SirenGooglePlayStore(); + throw UnimplementedError('This lib only supports Android, iOS and MacOS'); } // This method checks for an update in the application store and returns if there is a newer version than the local one.