diff --git a/CHANGELOG.md b/CHANGELOG.md index 479d008..fdbd223 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # manUp +## [7.0.0] + +- **Breaking change** Separate service into `HttpManUpService` and `FireBaseRemoteConfigManUpService` + + - Extract `HttpManUpService` from `ManUpService` and create `FireBaseRemoteConfigManUpService` to support fetching app config with HTTP and Firebase remote config + - Now, the user who use `ManUpService` in previous release + + ```dart + ManUpService service = ManUpService('https://example.com/manup.json', client: http.Client()); + ``` + + will need to change to + + ```dart + HttpManUpService service = HttpManUpService('https://example.com/manup.json', client: http.Client()); + ``` + ## [6.0.0] - **Breaking change** Update version check logic diff --git a/README.md b/README.md index 1ad8569..d523493 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,16 @@ does. ## Usage -### Remote File +You can select the method to store and fetch app config file with the following options -You need a hosted json file that contains the version metadata. This _could_ be part of your API. However, -often the reason for maintenance mode is because your API is down. An s3 bucket may be a safer bet, -even though it means a little more work in maintaining the file. +- HTTP (`HttpManUpService`) + - you need a hosted json file that contains the version metadata. This _could_ be part of your API. However, + often the reason for maintenance mode is because your API is down. An s3 bucket may be a safer bet, + even though it means a little more work in maintaining the file. +- Firebase remote config (`FireBaseRemoteConfigManUpService`) + - you need to setup firebase project and remote config, then [Add Firebase to your Flutter app](https://firebase.google.com/docs/flutter/setup?platform=ios). + +App config file structure ```json { @@ -42,13 +47,27 @@ If `"ios"` or `"android"` configurations are omitted, it will treat the device a ### Using the Service Directly -You can use `ManUpService` directly in your code. As part of your app startup logic, use the service to validate the running version. +You can use service directly in your code. As part of your app startup logic, use the service to validate the running version. -```dart -ManUpService service = ManUpService('https://example.com/manup.json', client: http.Client()); -ManUpStatus result = await service.validate(); -service.close(); -``` +- `HttpManUpService` + + ```dart + HttpManUpService service = HttpManUpService('https://example.com/manup.json', client: http.Client()); + ManUpStatus result = await service.validate(); + service.close(); + ``` + +- `FireBaseRemoteConfigManUpService` + + ```dart + FireBaseRemoteConfigManUpService service = FireBaseRemoteConfigManUpService( + remoteConfig: FirebaseRemoteConfig.instance, + // Parameter name (key) in remote config + paramName: 'configName', + ); + ManUpStatus result = await service.validate(); + service.close(); + ``` `ManUpStatus` will let you know how the version of the app running compares to the metadata: diff --git a/pubspec.yaml b/pubspec.yaml index efdae7b..277e98f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: manup description: Mandatory update for Flutter Apps that prompts or forces app update by querying a hosted JSON file. -version: 6.0.0 +version: 7.0.0 homepage: https://github.com/NextFaze/flutter_manup environment: