Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 8.14.0 #295

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## 8.14.0

* [**FEAT**] Support quickboot for HTC devices

## 8.13.0

* [**CHORE**] Downgrade iOS minimumVersion from 13.0 to 12.0
* [**CHORE**] Downgrade iOS minimumVersion from `13.0` to `12.0`

## 8.12.0

Expand All @@ -9,7 +13,7 @@

## 8.11.0

* [**FEAT**] Allow sending Set collection using `FlutterForegroundTask.sendDataToMain`
* [**FEAT**] Allow sending `Set` collection using `FlutterForegroundTask.sendDataToMain`

## 8.10.4

Expand Down
43 changes: 27 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To use this plugin, add `flutter_foreground_task` as a [dependency in your pubsp

```yaml
dependencies:
flutter_foreground_task: ^8.13.0
flutter_foreground_task: ^8.14.0
```

After adding the plugin to your flutter project, we need to declare the platform-specific permissions ans service to use for this plugin to work properly.
Expand Down Expand Up @@ -399,18 +399,19 @@ class FirstTaskHandler extends TaskHandler {
),
callback: updateCallback,
);
} else {
FlutterForegroundTask.updateService(
notificationTitle: 'Hello FirstTaskHandler :)',
notificationText: timestamp.toString(),
);

// Send data to main isolate.
final Map<String, dynamic> data = {
"timestampMillis": timestamp.millisecondsSinceEpoch,
};
FlutterForegroundTask.sendDataToMain(data);
return;
}

FlutterForegroundTask.updateService(
notificationTitle: 'Hello FirstTaskHandler :)',
notificationText: timestamp.toString(),
);

// Send data to main isolate.
final Map<String, dynamic> data = {
"timestampMillis": timestamp.millisecondsSinceEpoch,
};
FlutterForegroundTask.sendDataToMain(data);
}

@override
Expand Down Expand Up @@ -549,10 +550,20 @@ class MyTaskHandler extends TaskHandler {

### :hatched_chick: other example

* [`internal_plugin_service`](https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/internal_plugin_service) (Recommend)
* [`location_service`](https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/location_service)
* [`record_service`](https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/record_service)
* [`geofencing_service`](https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/geofencing_service)
#### [`internal_plugin_service`](https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/internal_plugin_service)
An example of using the platform channel in project with `flutter_foreground_task`.

#### [`location_service`](https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/location_service)
An example of a background location service implementation using `flutter_foreground_task` and `fl_location`.

#### [`record_service`](https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/record_service)
An example of a voice record service implementation using `flutter_foreground_task` and `record`.

#### [`geofencing_service`](https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/geofencing_service)
An example of a background geofencing service implementation using `flutter_foreground_task` and `geofencing_api`.

#### [`pedometer_service`](https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/pedometer_service)
An example of a pedometer service implementation using `flutter_foreground_task` and `pedometer`.

## More Documentation

Expand Down
2 changes: 2 additions & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
<!-- This is required on HTC devices to support their "quickboot" feature -->
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver>
<receiver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class RebootReceiver : BroadcastReceiver() {
val options = ForegroundTaskOptions.getData(context)

// Check whether to start the service at boot intent.
if (intent.action == Intent.ACTION_BOOT_COMPLETED && options.autoRunOnBoot) {
if ((intent.action == Intent.ACTION_BOOT_COMPLETED ||
intent.action == "android.intent.action.QUICKBOOT_POWERON") && options.autoRunOnBoot) {
return startForegroundService(context)
}

Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_foreground_task
description: This plugin is used to implement a foreground service on the Android platform.
version: 8.13.0
version: 8.14.0
homepage: https://github.com/Dev-hwang/flutter_foreground_task

environment:
Expand All @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
plugin_platform_interface: ^2.1.6
plugin_platform_interface: ^2.1.8
shared_preferences: ^2.2.2
platform: ^3.1.4

Expand Down