Skip to content

Commit

Permalink
Update app version, CHANGELOG and README
Browse files Browse the repository at this point in the history
  • Loading branch information
wasinnimlaor committed Jan 12, 2024
1 parent 51963c6 commit 2b531e1
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 11 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
39 changes: 29 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 2b531e1

Please sign in to comment.