You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CHANGELOG.md
+9-1
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,12 @@
1
-
## 0.5.0 - 2020-01-03
1
+
## 0.5.1 - 2020-02-19
2
+
3
+
## Minor Breaking Change for iOS Setup
4
+
5
+
*[iOS] It's no longer necessary to `registerBGProcessingTask` in `AppDelegate.m` for tasks registered for use with `#scheduleTask`. The SDK now reads the App `.plist` and automatically registers those tasks found in *"Permitted background task scheduler identifiers"*. Remove **all** code in your `AppDelegate.m` that references `TSBackgroundFetch`.
*[Added][Android] New option `forceAlarmManager` for bypassing `JobScheduler` mechanism in favour of `AlarmManager` for more precise scheduling task execution.
3
11
*[Changed] Migrate iOS deprecated "background-fetch" API to new [BGTaskScheduler](https://developer.apple.com/documentation/backgroundtasks/bgtaskscheduler?language=objc). See new required steps in iOS Setup.
4
12
*[Added] Added new `BackgroundFetch.scheduleTask` method for scheduling custom "onehot" and periodic tasks in addition to the default fetch-task.
Copy file name to clipboardexpand all lines: README.md
+18-14
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,15 @@ By [**Transistor Software**](http://transistorsoft.com), creators of [**Flutter
8
8
9
9
Background Fetch is a *very* simple plugin which will awaken an app in the background about **every 15 minutes**, providing a short period of background running-time. This plugin will execute your provided `callbackFn` whenever a background-fetch event occurs.
10
10
11
+
:new: Background Fetch now provides a [__`scheduleTask`__](#executing-custom-tasks) method for scheduling arbitrary "one-shot" or periodic tasks.
12
+
11
13
### iOS
12
-
There is **no way** to increase the rate which a fetch-event occurs and this plugin sets the rate to the most frequent possible — you will **never** receive an event faster than **15 minutes**. The operating-system will automatically throttle the rate the background-fetch events occur based upon usage patterns. Eg: if user hasn't turned on their phone for a long period of time, fetch events will occur less frequently.
14
+
- There is **no way** to increase the rate which a fetch-event occurs and this plugin sets the rate to the most frequent possible — you will **never** receive an event faster than **15 minutes**. The operating-system will automatically throttle the rate the background-fetch events occur based upon usage patterns. Eg: if user hasn't turned on their phone for a long period of time, fetch events will occur less frequently.
15
+
-[__`scheduleTask`__](#executing-custom-tasks) seems only to fire when the device is plugged into power.
13
16
14
17
### Android
15
-
The Android plugin provides a [Headless](https://pub.dartlang.org/documentation/background_fetch/latest/background_fetch/BackgroundFetchConfig/enableHeadless.html) implementation allowing you to continue handling events even after app-termination.
18
+
- The Android plugin provides a [Headless](https://pub.dartlang.org/documentation/background_fetch/latest/background_fetch/BackgroundFetchConfig/enableHeadless.html) implementation allowing you to continue handling events even after app-termination.
19
+
16
20
17
21
# Contents
18
22
@@ -29,7 +33,7 @@ The Android plugin provides a [Headless](https://pub.dartlang.org/documentation/
- The old command *Debug->Simulate Background Fetch* no longer works with new `BGTaskSCheduler` API.
240
-
- At the time of writing, the new task simulator does not yet work in Simulator; Only real devices.
242
+
#### :new:`BGTaskScheduler` API for iOS 13+
243
+
244
+
-:warning:At the time of writing, the new task simulator does not yet work in Simulator; Only real devices.
241
245
- See Apple docs [Starting and Terminating Tasks During Development](https://developer.apple.com/documentation/backgroundtasks/starting_and_terminating_tasks_during_development?language=objc)
242
246
- After running your app in XCode, Click the `[||]` button to initiate a *Breakpoint*.
- Click the `[ > ]` button to continue. The task will execute and the Callback function provided to **`BackgroundFetch.configure`** will receive the event.
3. If you intend to execute your own custom tasks via **`BackgroundFetch.scheduleTask`**, you must add those custom identifiers as well. For example, if you intend to execute a custom **`taskId: 'com.foo.customtask'`**, you must add the identifier **`com.foo.customtask`** to your *"Permitted background task scheduler identifiers"*, as well.
22
+
3. If you intend to execute your own [custom tasks](#executing-custom-tasks) via **`BackgroundFetch.scheduleTask`**, you must add those custom identifiers as well. For example, if you intend to execute a custom **`taskId: 'com.transistorsoft.customtask'`**, you must add the identifier **`com.transistorsoft.customtask`** to your *"Permitted background task scheduler identifiers"*, as well.
23
+
24
+
:warning: A task identifier can be any string you wish, but it's a good idea to prefix them now with `com.transistorsoft.`— In the future, the `com.transistorsoft` prefix **may become required**.
23
25
24
26
```dart
25
27
BackgroundFetch.scheduleTask(TaskConfig(
26
-
taskId: 'com.foo.customtask',
28
+
taskId: 'com.transistorsoft.customtask',
27
29
delay: 60 * 60 * 1000 // In one hour (milliseconds)
28
30
));
29
31
```
30
-
31
-
## `AppDelegate.m`
32
-
33
-
**If** you added custom *Background Processing* identifier(s) in your `Info.plist` and intend to use **`BackgroundFetch.scheduleTask`**, you must register those custom identifier(s) in your **`AppDelegate`** method **`didFinishLaunchingWithOptions`**:
34
-
35
-
__Note:__ The SDK *automatically* registers its required fetch-task **`com.transistorsoft.fetch`**— You need only register **your own** custom task idenfifiers here.
0 commit comments