@capacitor/background-runner 1.0.0-rc.1 → 1.0.1-dev-20230721T105145.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ Copyright 2020-present Ionic
2
+ https://ionic.io
3
+
4
+ MIT License
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining
7
+ a copy of this software and associated documentation files (the
8
+ "Software"), to deal in the Software without restriction, including
9
+ without limitation the rights to use, copy, modify, merge, publish,
10
+ distribute, sublicense, and/or sell copies of the Software, and to
11
+ permit persons to whom the Software is furnished to do so, subject to
12
+ the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be
15
+ included in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -14,13 +14,13 @@ Background Runner has support for various device APIs that require permission fr
14
14
 
15
15
  On iOS you must enable the Background Modes capability.
16
16
 
17
- ![Enable Background Mode Capability in Xcode](docs/enable_background_mode_capability.png)
17
+ ![Enable Background Mode Capability in Xcode](https://github.com/ionic-team/capacitor-background-runner/raw/main/docs/enable_background_mode_capability.png)
18
18
 
19
19
  Once added, you must enable the `Background fetch` and `Background processing` modes at a minimum to enable the ability to register and schedule your background tasks.
20
20
 
21
21
  If you will be making use of Geolocation or Push Notifications, enable `Location updates` or `Remote notifications` respectively.
22
22
 
23
- ![Configure Background Modes in Xcode](docs/configure_background_modes.png)
23
+ ![Configure Background Modes in Xcode](https://github.com/ionic-team/capacitor-background-runner/raw/main/docs/configure_background_modes.png)
24
24
 
25
25
  After enabling the Background Modes capability, add the following to your app's `AppDelegate.swift`:
26
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/background-runner",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.0.1-dev-20230721T105145.0",
4
4
  "description": "Capacitor Background Runner",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -11,6 +11,7 @@
11
11
  "android/build.gradle",
12
12
  "dist/",
13
13
  "ios/Plugin/",
14
+ "scripts/install_libs.js",
14
15
  "CapacitorBackgroundRunner.podspec"
15
16
  ],
16
17
  "author": "Ionic Team",
@@ -43,7 +44,7 @@
43
44
  "clean": "rimraf ./dist",
44
45
  "watch": "tsc --watch",
45
46
  "prepublishOnly": "npm run build",
46
- "postinstall": "mkdir -p $INIT_CWD/android/app/libs/ && cp -f android/src/main/libs/android-js-engine-release.aar $INIT_CWD/android/app/libs/"
47
+ "postinstall": "node ./scripts/install_libs.js"
47
48
  },
48
49
  "devDependencies": {
49
50
  "@capacitor/android": "^5.2.1",
@@ -77,5 +78,6 @@
77
78
  "android": {
78
79
  "src": "android"
79
80
  }
80
- }
81
+ },
82
+ "gitHead": "93219258eb254c84e386f0efaa6327f4be0ef3f8"
81
83
  }
@@ -0,0 +1,23 @@
1
+ const fs = require("fs");
2
+ const path = require('path');
3
+
4
+ console.log(process.env.INIT_CWD);
5
+
6
+ let workingDir = process.env.INIT_CWD;
7
+ if (!workingDir) {
8
+ workingDir = ".";
9
+ }
10
+
11
+ if (!fs.existsSync(path.join(workingDir, "android"))) {
12
+ throw new Error("cannot install android-js-engine library, not in correct parent directory.");
13
+ }
14
+
15
+ const releaseAARPath = path.join("android/src/main/libs/android-js-engine-release.aar");
16
+
17
+ const fullPath = path.join(workingDir, "android/app/libs")
18
+ fs.mkdirSync(fullPath);
19
+ fs.copyFileSync(releaseAARPath, path.join(fullPath, "android-js-engine-release.aar"))
20
+
21
+ console.log(`copied android-js-engine-release.aar to ${fullPath}`)
22
+
23
+