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

docs: Adding updated install and update information #85

Merged
merged 4 commits into from
Apr 23, 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
15 changes: 15 additions & 0 deletions .changeset/rotten-items-beam.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,18 @@
More reliability fixes for the JS Engine used in the Background Runner:
- (Android) Fixes in runtime during background execution
- (Android) Improvements in native lib handling for testing

When updating, if you have an existing Android app, be sure to delete the `android-js-engine-release.aar` from `android/src/main/libs`, and add the following to `android/app/build.gradle`:

```diff
...

repositories {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
+ dirs '../../node_modules/@capacitor/background-runner/android/src/main/libs', 'libs'
}
}
...

```
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,23 @@ Read about [Configuring `Info.plist`](https://capacitorjs.com/docs/ios/configura

## Android

Insert the following line to `android/app/build.gradle`:

```diff
...

repositories {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
+ dirs '../../node_modules/@capacitor/background-runner/android/src/main/libs', 'libs'
}
}
...

```

If you are upgrading from 1.0.5 with an existing Android project, be sure to delete the `android-js-engine-release.aar` from `android/src/main/libs`.

### Geolocation

This API requires the following permissions be added to your `AndroidManifest.xml`:
Expand Down Expand Up @@ -151,6 +168,8 @@ addEventListener('remoteNotification', (resolve, reject, args) => {

Calling `resolve()` \ `reject()` is **required** within every event handler called by the runner. Failure to do this could result in your runner being killed by the OS if your event is called while the app is in the background. If the app is in the foreground, async calls to `dispatchEvent` may not resolve.

For more real world examples of using Background Runner, check out the [Background Runner Test App](https://github.com/ionic-team/background-runner-testapp).

## Configuring Background Runner

<docgen-config>
Expand Down Expand Up @@ -256,6 +275,7 @@ It’s not possible to run persistent, always running background services on mob

- Each invocation of your task has approximately up to 30 seconds of runtime before you must call `completed()` or your task is killed.
- While you can set an interval to define when your task runs after the app is backgrounded, or how often it should run, this is not guaranteed. iOS will determine when and how often you task will ultimately run, determined in part by how often you app is used.
- Background tasks are not executed in the simulator.

### Android

Expand Down
20 changes: 20 additions & 0 deletions packages/capacitor-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,23 @@ Read about [Configuring `Info.plist`](https://capacitorjs.com/docs/ios/configura

## Android

Insert the following line to `android/app/build.gradle`:

```diff
...

repositories {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
+ dirs '../../node_modules/@capacitor/background-runner/android/src/main/libs', 'libs'
}
}
...

```

If you are upgrading from 1.0.5 with an existing Android project, be sure to delete the `android-js-engine-release.aar` from `android/src/main/libs`.

### Geolocation

This API requires the following permissions be added to your `AndroidManifest.xml`:
Expand Down Expand Up @@ -151,6 +168,8 @@ addEventListener('remoteNotification', (resolve, reject, args) => {

Calling `resolve()` \ `reject()` is **required** within every event handler called by the runner. Failure to do this could result in your runner being killed by the OS if your event is called while the app is in the background. If the app is in the foreground, async calls to `dispatchEvent` may not resolve.

For more real world examples of using Background Runner, check out the [Background Runner Test App](https://github.com/ionic-team/background-runner-testapp).

## Configuring Background Runner

<docgen-config>
Expand Down Expand Up @@ -256,6 +275,7 @@ It’s not possible to run persistent, always running background services on mob

- Each invocation of your task has approximately up to 30 seconds of runtime before you must call `completed()` or your task is killed.
- While you can set an interval to define when your task runs after the app is backgrounded, or how often it should run, this is not guaranteed. iOS will determine when and how often you task will ultimately run, determined in part by how often you app is used.
- Background tasks are not executed in the simulator.

### Android

Expand Down
Loading