diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef5a69cd9..077322011 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-14] + os: [ubuntu-latest, macos-15] timeout-minutes: 30 outputs: plugins: ${{ steps.packages.outputs.paths }} @@ -49,7 +49,7 @@ jobs: files: ${{ steps.catjson.outputs.FILES_JSON }} lint-scripts: - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 needs: - setup @@ -70,7 +70,7 @@ jobs: - run: npm run lint lint: - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 needs: - setup @@ -97,7 +97,7 @@ jobs: working-directory: ${{ matrix.plugin }} verify-ios: - runs-on: macos-14 + runs-on: macos-15 if: needs.setup.outputs.plugins != '[]' timeout-minutes: 30 needs: @@ -107,7 +107,7 @@ jobs: strategy: matrix: xcode: - - /Applications/Xcode_15.0.app + - /Applications/Xcode_16.app plugin: ${{ fromJson(needs.setup.outputs.plugins) }} steps: - run: sudo xcode-select --switch ${{ matrix.xcode }} diff --git a/.github/workflows/publish-ios.yml b/.github/workflows/publish-ios.yml index 13d99ac42..8506fb313 100644 --- a/.github/workflows/publish-ios.yml +++ b/.github/workflows/publish-ios.yml @@ -8,14 +8,14 @@ on: required: true jobs: publish-ios: - runs-on: macos-14 + runs-on: macos-15 if: github.event.inputs.plugins != '[]' timeout-minutes: 30 strategy: matrix: plugin: ${{ fromJson(github.event.inputs.plugins) }} steps: - - run: sudo xcode-select --switch /Applications/Xcode_15.0.app + - run: sudo xcode-select --switch /Applications/Xcode_16.app - uses: actions/setup-node@v4 with: node-version: 20 diff --git a/.github/workflows/publish-npm-alpha.yml b/.github/workflows/publish-npm-alpha.yml index 6240d35f9..96ea717c5 100644 --- a/.github/workflows/publish-npm-alpha.yml +++ b/.github/workflows/publish-npm-alpha.yml @@ -8,7 +8,7 @@ permissions: jobs: deploy-npm-alpha: - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/publish-npm-beta.yml b/.github/workflows/publish-npm-beta.yml index 67680fc41..072dd1e43 100644 --- a/.github/workflows/publish-npm-beta.yml +++ b/.github/workflows/publish-npm-beta.yml @@ -8,7 +8,7 @@ permissions: jobs: deploy-npm-beta: - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/publish-npm-dev.yml b/.github/workflows/publish-npm-dev.yml index 92f48a5cf..ea395eda5 100644 --- a/.github/workflows/publish-npm-dev.yml +++ b/.github/workflows/publish-npm-dev.yml @@ -8,7 +8,7 @@ permissions: jobs: deploy-npm-dev: - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/publish-npm-latest-from-pre.yml b/.github/workflows/publish-npm-latest-from-pre.yml index 735d65387..cb1a2f080 100644 --- a/.github/workflows/publish-npm-latest-from-pre.yml +++ b/.github/workflows/publish-npm-latest-from-pre.yml @@ -16,7 +16,7 @@ permissions: jobs: deploy-npm-latest-from-pre: if: github.ref == 'refs/heads/main' - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/publish-npm-latest.yml b/.github/workflows/publish-npm-latest.yml index 071ab1c3c..504281bcd 100644 --- a/.github/workflows/publish-npm-latest.yml +++ b/.github/workflows/publish-npm-latest.yml @@ -16,7 +16,7 @@ permissions: jobs: deploy-npm-latest: if: github.ref == 'refs/heads/main' - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/publish-npm-nightly.yml b/.github/workflows/publish-npm-nightly.yml index 586444aee..39b6bfae6 100644 --- a/.github/workflows/publish-npm-nightly.yml +++ b/.github/workflows/publish-npm-nightly.yml @@ -11,7 +11,7 @@ permissions: jobs: deploy-npm-nightly: if: github.ref == 'refs/heads/main' - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/publish-npm-rc.yml b/.github/workflows/publish-npm-rc.yml index 16001a126..cb9f71ebf 100644 --- a/.github/workflows/publish-npm-rc.yml +++ b/.github/workflows/publish-npm-rc.yml @@ -8,7 +8,7 @@ permissions: jobs: deploy-npm-rc: - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 diff --git a/action-sheet/README.md b/action-sheet/README.md index 2c9872ed1..b72498423 100644 --- a/action-sheet/README.md +++ b/action-sheet/README.md @@ -13,7 +13,7 @@ npx cap sync This plugin will use the following project variables (defined in your app's `variables.gradle` file): -- `androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.10.0`) +- `androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.12.0`) ## PWA Notes diff --git a/action-sheet/android/build.gradle b/action-sheet/android/build.gradle index 96ceb4473..872de35ad 100644 --- a/action-sheet/android/build.gradle +++ b/action-sheet/android/build.gradle @@ -2,7 +2,7 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' - androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.10.0' + androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.12.0' androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } diff --git a/action-sheet/package.json b/action-sheet/package.json index a83c01ce0..39b8a403e 100644 --- a/action-sheet/package.json +++ b/action-sheet/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorActionSheet -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorActionSheet -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api ActionSheetPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/action-sheet/rollup.config.js b/action-sheet/rollup.config.mjs similarity index 100% rename from action-sheet/rollup.config.js rename to action-sheet/rollup.config.mjs diff --git a/app-launcher/package.json b/app-launcher/package.json index c3e8fb697..845249951 100644 --- a/app-launcher/package.json +++ b/app-launcher/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorAppLauncher -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorAppLauncher -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api AppLauncherPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^3.0.2", - "rollup": "^2.32.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/app-launcher/rollup.config.js b/app-launcher/rollup.config.mjs similarity index 100% rename from app-launcher/rollup.config.js rename to app-launcher/rollup.config.mjs diff --git a/app/package.json b/app/package.json index 444717da3..f730ce1a2 100644 --- a/app/package.json +++ b/app/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorApp -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorApp -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api AppPlugin --output-readme README.md", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/app/rollup.config.js b/app/rollup.config.mjs similarity index 100% rename from app/rollup.config.js rename to app/rollup.config.mjs diff --git a/browser/README.md b/browser/README.md index 0c6a744d1..ac7553a67 100644 --- a/browser/README.md +++ b/browser/README.md @@ -17,7 +17,7 @@ npx cap sync This plugin will use the following project variables (defined in your app's `variables.gradle` file): -- `androidxBrowserVersion`: version of `androidx.browser:browser` (default: `1.7.0`) +- `androidxBrowserVersion`: version of `androidx.browser:browser` (default: `1.8.0`) ## Example diff --git a/browser/android/build.gradle b/browser/android/build.gradle index d5098ac19..dae05b3a4 100644 --- a/browser/android/build.gradle +++ b/browser/android/build.gradle @@ -4,7 +4,7 @@ ext { androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' - androidxBrowserVersion = project.hasProperty('androidxBrowserVersion') ? rootProject.ext.androidxBrowserVersion : '1.7.0' + androidxBrowserVersion = project.hasProperty('androidxBrowserVersion') ? rootProject.ext.androidxBrowserVersion : '1.8.0' } buildscript { diff --git a/browser/package.json b/browser/package.json index d6640a042..b8d899028 100644 --- a/browser/package.json +++ b/browser/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorBrowser -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorBrowser -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api BrowserPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/browser/rollup.config.js b/browser/rollup.config.mjs similarity index 100% rename from browser/rollup.config.js rename to browser/rollup.config.mjs diff --git a/camera/README.md b/camera/README.md index 49a48d096..9ad234eee 100644 --- a/camera/README.md +++ b/camera/README.md @@ -68,8 +68,8 @@ Additionally, because the Camera API launches a separate Activity to handle taki This plugin will use the following project variables (defined in your app's `variables.gradle` file): -- `androidxExifInterfaceVersion`: version of `androidx.exifinterface:exifinterface` (default: `1.3.6`) -- `androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.10.0`) +- `androidxExifInterfaceVersion`: version of `androidx.exifinterface:exifinterface` (default: `1.3.7`) +- `androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.12.0`) ## PWA Notes diff --git a/camera/android/build.gradle b/camera/android/build.gradle index 34bda0ae0..98f17df6a 100644 --- a/camera/android/build.gradle +++ b/camera/android/build.gradle @@ -3,9 +3,9 @@ ext { junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' - androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.3.6' + androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.3.7' androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' - androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.10.0' + androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.12.0' } buildscript { diff --git a/camera/package.json b/camera/package.json index 5e0abc02f..bbf2d7f36 100644 --- a/camera/package.json +++ b/camera/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorCamera -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorCamera -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api CameraPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/camera/rollup.config.js b/camera/rollup.config.mjs similarity index 100% rename from camera/rollup.config.js rename to camera/rollup.config.mjs diff --git a/clipboard/package.json b/clipboard/package.json index cb7134259..18c5d7654 100644 --- a/clipboard/package.json +++ b/clipboard/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorClipboard -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorClipboard -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api ClipboardPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/clipboard/rollup.config.js b/clipboard/rollup.config.mjs similarity index 100% rename from clipboard/rollup.config.js rename to clipboard/rollup.config.mjs diff --git a/device/README.md b/device/README.md index 56c7d3947..39b6c154f 100644 --- a/device/README.md +++ b/device/README.md @@ -9,39 +9,6 @@ npm install @capacitor/device npx cap sync ``` -## Apple Privacy Manifest Requirements - -Apple mandates that app developers now specify approved reasons for API usage to enhance user privacy. By May 1st, 2024, it's required to include these reasons when submitting apps to the App Store Connect. - -When using this specific plugin in your app, you must create a `PrivacyInfo.xcprivacy` file in `/ios/App` or use the VS Code Extension to generate it, specifying the usage reasons. - -For detailed steps on how to do this, please see the [Capacitor Docs](https://capacitorjs.com/docs/ios/privacy-manifest). - -**For this plugin, the required dictionary key is [NSPrivacyAccessedAPICategoryDiskSpace](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api#4278397) and the recommended reason is [85F4.1](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api#4278397).** - -### Example PrivacyInfo.xcprivacy - -```xml - - - - - NSPrivacyAccessedAPITypes - - - - NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategoryDiskSpace - NSPrivacyAccessedAPITypeReasons - - 85F4.1 - - - - - -``` - ## Example Plugin Usage ```typescript @@ -176,10 +143,6 @@ Get the device's current language locale tag. | **`manufacturer`** | string | The manufacturer of the device. | 1.0.0 | | **`isVirtual`** | boolean | Whether the app is running in a simulator/emulator. | 1.0.0 | | **`memUsed`** | number | Approximate memory used by the current app, in bytes. Divide by 1048576 to get the number of MBs used. | 1.0.0 | -| **`diskFree`** | number | How much free disk space is available on the normal data storage path for the os, in bytes. On Android it returns the free disk space on the "system" partition holding the core Android OS. On iOS this value is not accurate. | 1.0.0 | -| **`diskTotal`** | number | The total size of the normal data storage path for the OS, in bytes. On Android it returns the disk space on the "system" partition holding the core Android OS. | 1.0.0 | -| **`realDiskFree`** | number | How much free disk space is available on the normal data storage, in bytes. | 1.1.0 | -| **`realDiskTotal`** | number | The total size of the normal data storage path, in bytes. | 1.1.0 | | **`webViewVersion`** | string | The web view browser version | 1.0.0 | diff --git a/device/android/src/main/java/com/capacitorjs/plugins/device/Device.java b/device/android/src/main/java/com/capacitorjs/plugins/device/Device.java index 477268c10..40d997550 100644 --- a/device/android/src/main/java/com/capacitorjs/plugins/device/Device.java +++ b/device/android/src/main/java/com/capacitorjs/plugins/device/Device.java @@ -7,8 +7,6 @@ import android.content.pm.PackageManager; import android.os.BatteryManager; import android.os.Build; -import android.os.Environment; -import android.os.StatFs; import android.provider.Settings; import android.webkit.WebView; @@ -26,26 +24,6 @@ public long getMemUsed() { return usedMem; } - public long getDiskFree() { - StatFs statFs = new StatFs(Environment.getRootDirectory().getAbsolutePath()); - return statFs.getAvailableBlocksLong() * statFs.getBlockSizeLong(); - } - - public long getDiskTotal() { - StatFs statFs = new StatFs(Environment.getRootDirectory().getAbsolutePath()); - return statFs.getBlockCountLong() * statFs.getBlockSizeLong(); - } - - public long getRealDiskFree() { - StatFs statFs = new StatFs(Environment.getDataDirectory().getAbsolutePath()); - return statFs.getAvailableBlocksLong() * statFs.getBlockSizeLong(); - } - - public long getRealDiskTotal() { - StatFs statFs = new StatFs(Environment.getDataDirectory().getAbsolutePath()); - return statFs.getBlockCountLong() * statFs.getBlockSizeLong(); - } - public String getPlatform() { return "android"; } diff --git a/device/android/src/main/java/com/capacitorjs/plugins/device/DevicePlugin.java b/device/android/src/main/java/com/capacitorjs/plugins/device/DevicePlugin.java index 9fed0725d..13f621353 100644 --- a/device/android/src/main/java/com/capacitorjs/plugins/device/DevicePlugin.java +++ b/device/android/src/main/java/com/capacitorjs/plugins/device/DevicePlugin.java @@ -32,10 +32,6 @@ public void getInfo(PluginCall call) { JSObject r = new JSObject(); r.put("memUsed", implementation.getMemUsed()); - r.put("diskFree", implementation.getDiskFree()); - r.put("diskTotal", implementation.getDiskTotal()); - r.put("realDiskFree", implementation.getRealDiskFree()); - r.put("realDiskTotal", implementation.getRealDiskTotal()); r.put("model", android.os.Build.MODEL); r.put("operatingSystem", "android"); r.put("osVersion", android.os.Build.VERSION.RELEASE); diff --git a/device/ios/Sources/DevicePlugin/Device.swift b/device/ios/Sources/DevicePlugin/Device.swift index cf2a0e832..22c194609 100644 --- a/device/ios/Sources/DevicePlugin/Device.swift +++ b/device/ios/Sources/DevicePlugin/Device.swift @@ -21,48 +21,6 @@ import UIKit } } - /** - * Get free disk space - */ - public func getFreeDiskSize() -> Int64? { - let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) - if let dictionary = try? FileManager.default.attributesOfFileSystem(forPath: paths.last!) { - if let freeSize = dictionary[FileAttributeKey.systemFreeSize] as? NSNumber { - return freeSize.int64Value - } - } - return nil - } - - /** - * Get real free disk space - */ - public func getRealFreeDiskSize() -> Int64? { - do { - let values = try URL(fileURLWithPath: NSHomeDirectory() as String).resourceValues(forKeys: [URLResourceKey.volumeAvailableCapacityForImportantUsageKey]) - if let available = values.volumeAvailableCapacityForImportantUsage { - return available - } else { - return nil - } - } catch { - return nil - } - } - - /** - * Get total disk size - */ - public func getTotalDiskSize() -> Int64? { - let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) - if let dictionary = try? FileManager.default.attributesOfFileSystem(forPath: paths.last!) { - if let freeSize = dictionary[FileAttributeKey.systemSize] as? NSNumber { - return freeSize.int64Value - } - } - return nil - } - public func getLanguageCode() -> String { return String(Locale.preferredLanguages[0].prefix(2)) } diff --git a/device/ios/Sources/DevicePlugin/DevicePlugin.swift b/device/ios/Sources/DevicePlugin/DevicePlugin.swift index 7b18c82ef..b340a7468 100644 --- a/device/ios/Sources/DevicePlugin/DevicePlugin.swift +++ b/device/ios/Sources/DevicePlugin/DevicePlugin.swift @@ -34,17 +34,10 @@ public class DevicePlugin: CAPPlugin, CAPBridgedPlugin { #endif let memUsed = implementation.getMemoryUsage() - let diskFree = implementation.getFreeDiskSize() ?? 0 - let realDiskFree = implementation.getRealFreeDiskSize() ?? 0 - let diskTotal = implementation.getTotalDiskSize() ?? 0 let systemVersionNum = implementation.getSystemVersionInt() ?? 0 call.resolve([ "memUsed": memUsed, - "diskFree": diskFree, - "diskTotal": diskTotal, - "realDiskFree": realDiskFree, - "realDiskTotal": diskTotal, "name": UIDevice.current.name, "model": modelName, "operatingSystem": "ios", diff --git a/device/package.json b/device/package.json index c2188cfbc..151e3976c 100644 --- a/device/package.json +++ b/device/package.json @@ -32,7 +32,7 @@ "scripts": { "test": "uvu -r esm -r ts-node/register src/__tests__", "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorDevice -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorDevice -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build && npm test", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -41,7 +41,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api DevicePlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -60,7 +60,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "ts-node": "^9.1.1", "typescript": "~4.1.5", diff --git a/device/rollup.config.js b/device/rollup.config.mjs similarity index 100% rename from device/rollup.config.js rename to device/rollup.config.mjs diff --git a/device/src/__tests__/useragent.spec.ts b/device/src/__tests__/useragent.spec.ts index 35fa58c59..69df133b1 100644 --- a/device/src/__tests__/useragent.spec.ts +++ b/device/src/__tests__/useragent.spec.ts @@ -1,11 +1,9 @@ -import type { WebPluginConfig } from '@capacitor/core'; import { test } from 'uvu'; import * as assert from 'uvu/assert'; import { DeviceWeb } from '../web'; -const config: WebPluginConfig = { name: 'DevicePlugin' }; -const web = new DeviceWeb(config); +const web = new DeviceWeb(); test('Chrome', () => { // Mock empty navigator/window objects diff --git a/device/src/definitions.ts b/device/src/definitions.ts index fd64be9a2..bbe39d611 100644 --- a/device/src/definitions.ts +++ b/device/src/definitions.ts @@ -99,44 +99,6 @@ export interface DeviceInfo { */ memUsed?: number; - /** - * How much free disk space is available on the normal data storage - * path for the os, in bytes. - * - * On Android it returns the free disk space on the "system" - * partition holding the core Android OS. - * On iOS this value is not accurate. - * - * @deprecated Use `realDiskFree`. - * @since 1.0.0 - */ - diskFree?: number; - - /** - * The total size of the normal data storage path for the OS, in bytes. - * - * On Android it returns the disk space on the "system" - * partition holding the core Android OS. - * - * @deprecated Use `realDiskTotal`. - * @since 1.0.0 - */ - diskTotal?: number; - - /** - * How much free disk space is available on the normal data storage, in bytes. - * - * @since 1.1.0 - */ - realDiskFree?: number; - - /** - * The total size of the normal data storage path, in bytes. - * - * @since 1.1.0 - */ - realDiskTotal?: number; - /** * The web view browser version * diff --git a/dialog/package.json b/dialog/package.json index d9d9d561f..c2b5c97ec 100644 --- a/dialog/package.json +++ b/dialog/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorDialog -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorDialog -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api DialogPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/dialog/rollup.config.js b/dialog/rollup.config.mjs similarity index 100% rename from dialog/rollup.config.js rename to dialog/rollup.config.mjs diff --git a/filesystem/package.json b/filesystem/package.json index 273829c14..ae1eb214c 100644 --- a/filesystem/package.json +++ b/filesystem/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorFilesystem -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorFilesystem -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api FilesystemPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/filesystem/rollup.config.js b/filesystem/rollup.config.mjs similarity index 100% rename from filesystem/rollup.config.js rename to filesystem/rollup.config.mjs diff --git a/geolocation/README.md b/geolocation/README.md index 2c2f86313..e390eac52 100644 --- a/geolocation/README.md +++ b/geolocation/README.md @@ -36,7 +36,7 @@ Read about [Setting Permissions](https://capacitorjs.com/docs/android/configurat This plugin will use the following project variables (defined in your app's `variables.gradle` file): -- `playServicesLocationVersion` version of `com.google.android.gms:play-services-location` (default: `21.1.0`) +- `playServicesLocationVersion` version of `com.google.android.gms:play-services-location` (default: `21.3.0`) ## Example diff --git a/geolocation/android/build.gradle b/geolocation/android/build.gradle index 31e2b7564..013a6ff4d 100644 --- a/geolocation/android/build.gradle +++ b/geolocation/android/build.gradle @@ -4,7 +4,7 @@ ext { androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' - playServicesLocationVersion = project.hasProperty('playServicesLocationVersion') ? rootProject.ext.playServicesLocationVersion : '21.1.0' + playServicesLocationVersion = project.hasProperty('playServicesLocationVersion') ? rootProject.ext.playServicesLocationVersion : '21.3.0' } buildscript { diff --git a/geolocation/package.json b/geolocation/package.json index a4fd7438f..691e1cd35 100644 --- a/geolocation/package.json +++ b/geolocation/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorGeolocation -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorGeolocation -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api GeolocationPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/geolocation/rollup.config.js b/geolocation/rollup.config.mjs similarity index 100% rename from geolocation/rollup.config.js rename to geolocation/rollup.config.mjs diff --git a/haptics/android/src/main/java/com/capacitorjs/plugins/haptics/Haptics.java b/haptics/android/src/main/java/com/capacitorjs/plugins/haptics/Haptics.java index e9f182e68..392aa4190 100644 --- a/haptics/android/src/main/java/com/capacitorjs/plugins/haptics/Haptics.java +++ b/haptics/android/src/main/java/com/capacitorjs/plugins/haptics/Haptics.java @@ -10,12 +10,10 @@ public class Haptics { - private Context context; private boolean selectionStarted = false; private final Vibrator vibrator; Haptics(Context context) { - this.context = context; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { VibratorManager vibratorManager = (VibratorManager) context.getSystemService(Context.VIBRATOR_MANAGER_SERVICE); this.vibrator = vibratorManager.getDefaultVibrator(); @@ -43,8 +41,8 @@ private void vibratePre26(int duration) { } @SuppressWarnings({ "deprecation" }) - private void vibratePre26(long[] pattern, int repeat) { - vibrator.vibrate(pattern, repeat); + private void vibratePre26(long[] pattern) { + vibrator.vibrate(pattern, -1); } public void selectionStart() { @@ -65,7 +63,7 @@ public void performHaptics(HapticsVibrationType type) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { vibrator.vibrate(VibrationEffect.createWaveform(type.getTimings(), type.getAmplitudes(), -1)); } else { - vibratePre26(type.getOldSDKPattern(), -1); + vibratePre26(type.getOldSDKPattern()); } } } diff --git a/haptics/package.json b/haptics/package.json index 043969b1e..177571f72 100644 --- a/haptics/package.json +++ b/haptics/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorHaptics -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorHaptics -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api HapticsPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/haptics/rollup.config.js b/haptics/rollup.config.mjs similarity index 100% rename from haptics/rollup.config.js rename to haptics/rollup.config.mjs diff --git a/haptics/src/definitions.ts b/haptics/src/definitions.ts index 01389a6d6..aa9f61b8f 100644 --- a/haptics/src/definitions.ts +++ b/haptics/src/definitions.ts @@ -124,27 +124,3 @@ export interface VibrateOptions { */ duration: number; } - -/** - * @deprecated Use `ImpactOptions`. - * @since 1.0.0 - */ -export type HapticsImpactOptions = ImpactOptions; - -/** - * @deprecated Use `NotificationOptions`. - * @since 1.0.0 - */ -export type HapticsNotificationOptions = NotificationOptions; - -/** - * @deprecated Use `NotificationType`. - * @since 1.0.0 - */ -export const HapticsNotificationType = NotificationType; - -/** - * @deprecated Use `ImpactStyle`. - * @since 1.0.0 - */ -export const HapticsImpactStyle = ImpactStyle; diff --git a/keyboard/package.json b/keyboard/package.json index 27bc05787..6668c8551 100644 --- a/keyboard/package.json +++ b/keyboard/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorKeyboard -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorKeyboard -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api KeyboardPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -59,7 +59,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/keyboard/rollup.config.js b/keyboard/rollup.config.mjs similarity index 100% rename from keyboard/rollup.config.js rename to keyboard/rollup.config.mjs diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationManager.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationManager.java index a1c896f39..0b826a546 100644 --- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationManager.java +++ b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationManager.java @@ -382,13 +382,13 @@ private void setExactIfPossible( "Capacitor/LocalNotification", "Exact alarms not allowed in user settings. Notification scheduled with non-exact alarm." ); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && schedule.allowWhileIdle()) { + if (schedule.allowWhileIdle()) { alarmManager.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, trigger, pendingIntent); } else { alarmManager.set(AlarmManager.RTC, trigger, pendingIntent); } } else { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && schedule.allowWhileIdle()) { + if (schedule.allowWhileIdle()) { alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, trigger, pendingIntent); } else { alarmManager.setExact(AlarmManager.RTC, trigger, pendingIntent); diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationsPlugin.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationsPlugin.java index 6bdd2c0e6..c9f09e59c 100644 --- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationsPlugin.java +++ b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationsPlugin.java @@ -123,33 +123,31 @@ public void areEnabled(PluginCall call) { @PluginMethod public void getDeliveredNotifications(PluginCall call) { JSArray notifications = new JSArray(); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications(); + StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications(); - for (StatusBarNotification notif : activeNotifications) { - JSObject jsNotif = new JSObject(); + for (StatusBarNotification notif : activeNotifications) { + JSObject jsNotif = new JSObject(); - jsNotif.put("id", notif.getId()); - jsNotif.put("tag", notif.getTag()); + jsNotif.put("id", notif.getId()); + jsNotif.put("tag", notif.getTag()); - Notification notification = notif.getNotification(); - if (notification != null) { - jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE)); - jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT)); - jsNotif.put("group", notification.getGroup()); - jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY)); + Notification notification = notif.getNotification(); + if (notification != null) { + jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE)); + jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT)); + jsNotif.put("group", notification.getGroup()); + jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY)); - JSObject extras = new JSObject(); + JSObject extras = new JSObject(); - for (String key : notification.extras.keySet()) { - extras.put(key, notification.extras.getString(key)); - } - - jsNotif.put("data", extras); + for (String key : notification.extras.keySet()) { + extras.put(key, notification.extras.getString(key)); } - notifications.put(jsNotif); + jsNotif.put("data", extras); } + + notifications.put(jsNotif); } JSObject result = new JSObject(); diff --git a/local-notifications/package.json b/local-notifications/package.json index 9944a26d9..e40c0d6a4 100644 --- a/local-notifications/package.json +++ b/local-notifications/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorLocalNotifications -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorLocalNotifications -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api LocalNotificationsPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -59,7 +59,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/local-notifications/rollup.config.js b/local-notifications/rollup.config.mjs similarity index 100% rename from local-notifications/rollup.config.js rename to local-notifications/rollup.config.mjs diff --git a/motion/package.json b/motion/package.json index 68b0011a9..81244df44 100644 --- a/motion/package.json +++ b/motion/package.json @@ -33,7 +33,7 @@ "eslint": "eslint . --ext ts", "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "docgen": "docgen --api MotionPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build" @@ -49,7 +49,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "typescript": "~4.1.5" }, "peerDependencies": { diff --git a/motion/rollup.config.js b/motion/rollup.config.mjs similarity index 100% rename from motion/rollup.config.js rename to motion/rollup.config.mjs diff --git a/network/package.json b/network/package.json index ce2de22a7..564cbf724 100644 --- a/network/package.json +++ b/network/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorNetwork -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorNetwork -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api NetworkPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/network/rollup.config.js b/network/rollup.config.mjs similarity index 100% rename from network/rollup.config.js rename to network/rollup.config.mjs diff --git a/preferences/package.json b/preferences/package.json index ed1b109ac..9682d44dc 100644 --- a/preferences/package.json +++ b/preferences/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorPreferences -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorPreferences -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api PreferencesPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/preferences/rollup.config.js b/preferences/rollup.config.mjs similarity index 100% rename from preferences/rollup.config.js rename to preferences/rollup.config.mjs diff --git a/push-notifications/README.md b/push-notifications/README.md index 22d5fe7dd..5f7847719 100644 --- a/push-notifications/README.md +++ b/push-notifications/README.md @@ -35,7 +35,7 @@ Android 13 requires a permission check in order to receive push notifications. This plugin will use the following project variables (defined in your app's `variables.gradle` file): -- `firebaseMessagingVersion` version of `com.google.firebase:firebase-messaging` (default: `23.3.1`) +- `firebaseMessagingVersion` version of `com.google.firebase:firebase-messaging` (default: `24.1.0`) --- diff --git a/push-notifications/android/build.gradle b/push-notifications/android/build.gradle index d63f5c0d0..b965d0f36 100644 --- a/push-notifications/android/build.gradle +++ b/push-notifications/android/build.gradle @@ -4,7 +4,7 @@ ext { androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' - firebaseMessagingVersion = project.hasProperty('firebaseMessagingVersion') ? rootProject.ext.firebaseMessagingVersion : '23.3.1' + firebaseMessagingVersion = project.hasProperty('firebaseMessagingVersion') ? rootProject.ext.firebaseMessagingVersion : '24.1.0' } buildscript { diff --git a/push-notifications/android/src/main/java/com/capacitorjs/plugins/pushnotifications/PushNotificationsPlugin.java b/push-notifications/android/src/main/java/com/capacitorjs/plugins/pushnotifications/PushNotificationsPlugin.java index 761c3331c..8b6823179 100644 --- a/push-notifications/android/src/main/java/com/capacitorjs/plugins/pushnotifications/PushNotificationsPlugin.java +++ b/push-notifications/android/src/main/java/com/capacitorjs/plugins/pushnotifications/PushNotificationsPlugin.java @@ -126,33 +126,31 @@ public void unregister(PluginCall call) { @PluginMethod public void getDeliveredNotifications(PluginCall call) { JSArray notifications = new JSArray(); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications(); + StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications(); - for (StatusBarNotification notif : activeNotifications) { - JSObject jsNotif = new JSObject(); + for (StatusBarNotification notif : activeNotifications) { + JSObject jsNotif = new JSObject(); - jsNotif.put("id", notif.getId()); - jsNotif.put("tag", notif.getTag()); + jsNotif.put("id", notif.getId()); + jsNotif.put("tag", notif.getTag()); - Notification notification = notif.getNotification(); - if (notification != null) { - jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE)); - jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT)); - jsNotif.put("group", notification.getGroup()); - jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY)); + Notification notification = notif.getNotification(); + if (notification != null) { + jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE)); + jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT)); + jsNotif.put("group", notification.getGroup()); + jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY)); - JSObject extras = new JSObject(); + JSObject extras = new JSObject(); - for (String key : notification.extras.keySet()) { - extras.put(key, notification.extras.getString(key)); - } - - jsNotif.put("data", extras); + for (String key : notification.extras.keySet()) { + extras.put(key, notification.extras.getString(key)); } - notifications.put(jsNotif); + jsNotif.put("data", extras); } + + notifications.put(jsNotif); } JSObject result = new JSObject(); diff --git a/push-notifications/package.json b/push-notifications/package.json index 8d24773f2..7661e9cec 100644 --- a/push-notifications/package.json +++ b/push-notifications/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorPushNotifications -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorPushNotifications -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api PushNotificationsPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -59,7 +59,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/push-notifications/rollup.config.js b/push-notifications/rollup.config.mjs similarity index 100% rename from push-notifications/rollup.config.js rename to push-notifications/rollup.config.mjs diff --git a/screen-orientation/package.json b/screen-orientation/package.json index 81cf43c50..f507e7fe5 100644 --- a/screen-orientation/package.json +++ b/screen-orientation/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorScreenOrientation -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorScreenOrientation -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api ScreenOrientationPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/screen-orientation/rollup.config.js b/screen-orientation/rollup.config.mjs similarity index 100% rename from screen-orientation/rollup.config.js rename to screen-orientation/rollup.config.mjs diff --git a/screen-reader/package.json b/screen-reader/package.json index 2146e5130..13c20e59d 100644 --- a/screen-reader/package.json +++ b/screen-reader/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorScreenReader -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorScreenReader -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api ScreenReaderPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/screen-reader/rollup.config.js b/screen-reader/rollup.config.mjs similarity index 100% rename from screen-reader/rollup.config.js rename to screen-reader/rollup.config.mjs diff --git a/share/android/build.gradle b/share/android/build.gradle index 84ad0e448..5b4703486 100644 --- a/share/android/build.gradle +++ b/share/android/build.gradle @@ -2,7 +2,7 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' - androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.13.1' + androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.15.0' androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } diff --git a/share/package.json b/share/package.json index be2119323..460a3df05 100644 --- a/share/package.json +++ b/share/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorShare -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorShare -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api SharePlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/share/rollup.config.js b/share/rollup.config.mjs similarity index 100% rename from share/rollup.config.js rename to share/rollup.config.mjs diff --git a/splash-screen/package.json b/splash-screen/package.json index 127f59cad..957f30fd5 100644 --- a/splash-screen/package.json +++ b/splash-screen/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorSplashScreen -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorSplashScreen -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api SplashScreenPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -59,7 +59,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.32.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/splash-screen/rollup.config.js b/splash-screen/rollup.config.mjs similarity index 100% rename from splash-screen/rollup.config.js rename to splash-screen/rollup.config.mjs diff --git a/status-bar/android/build.gradle b/status-bar/android/build.gradle index 161c6362c..ca75910d2 100644 --- a/status-bar/android/build.gradle +++ b/status-bar/android/build.gradle @@ -1,7 +1,7 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.13.1' + androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.15.0' androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' diff --git a/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBar.java b/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBar.java index 1a903d133..a6570d4c1 100644 --- a/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBar.java +++ b/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBar.java @@ -1,9 +1,11 @@ package com.capacitorjs.plugins.statusbar; import android.graphics.Color; +import android.os.Build; import android.util.DisplayMetrics; import android.view.View; import android.view.Window; +import android.view.WindowInsets; import android.view.WindowManager; import androidx.appcompat.app.AppCompatActivity; import androidx.core.view.ViewCompat; @@ -113,15 +115,19 @@ private String getStyle() { } private int getStatusBarHeight() { - int statusbarHeight = 0; - int resourceId = activity.getApplicationContext().getResources().getIdentifier("status_bar_height", "dimen", "android"); - if (resourceId > 0) { - statusbarHeight = (int) activity.getApplicationContext().getResources().getDimension(resourceId); + DisplayMetrics metrics = activity.getResources().getDisplayMetrics(); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + WindowInsets insets = activity.getWindowManager().getCurrentWindowMetrics().getWindowInsets(); + return (int) (insets.getInsets(WindowInsets.Type.statusBars()).top / metrics.density); } - DisplayMetrics metrics = activity.getApplicationContext().getResources().getDisplayMetrics(); - float densityDpi = metrics.density; + WindowInsets insets = activity.getWindow().getDecorView().getRootWindowInsets(); + if (insets != null) { + return (int) (insets.getSystemWindowInsetTop() / metrics.density); + } - return (int) (statusbarHeight / densityDpi); + // Fallback if the insets are not available + return 0; } } diff --git a/status-bar/package.json b/status-bar/package.json index 8a2987164..6642be573 100644 --- a/status-bar/package.json +++ b/status-bar/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorStatusBar -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorStatusBar -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api StatusBarPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/status-bar/rollup.config.js b/status-bar/rollup.config.mjs similarity index 100% rename from status-bar/rollup.config.js rename to status-bar/rollup.config.mjs diff --git a/text-zoom/package.json b/text-zoom/package.json index 550990c9b..2d352e1e1 100644 --- a/text-zoom/package.json +++ b/text-zoom/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorTextZoom -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorTextZoom -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api TextZoomPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/text-zoom/rollup.config.js b/text-zoom/rollup.config.mjs similarity index 100% rename from text-zoom/rollup.config.js rename to text-zoom/rollup.config.mjs diff --git a/text-zoom/src/ios.ts b/text-zoom/src/ios.ts index 6aa7ec0a5..3b307a244 100644 --- a/text-zoom/src/ios.ts +++ b/text-zoom/src/ios.ts @@ -1,11 +1,4 @@ -import { Plugins } from '@capacitor/core'; - -import type { - GetPreferredResult, - GetResult, - SetOptions, - TextZoomPlugin, -} from './definitions'; +import type { GetResult, SetOptions, TextZoomPlugin } from './definitions'; export class TextZoomIOS implements TextZoomPlugin { static readonly TEXT_SIZE_REGEX = /(\d+)%/; @@ -17,8 +10,8 @@ export class TextZoomIOS implements TextZoomPlugin { return { value }; } - async getPreferred(): Promise { - return Plugins.TextZoom.getPreferred(); + async getPreferred(): Promise { + throw 'Native implementation will be used'; } async set(options: SetOptions): Promise { diff --git a/toast/package.json b/toast/package.json index fdcdcb95b..9bb1b19c5 100644 --- a/toast/package.json +++ b/toast/package.json @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorToast -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorToast -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,7 +40,7 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api ToastPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", @@ -58,7 +58,7 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^6.0.1", - "rollup": "^2.29.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, diff --git a/toast/rollup.config.js b/toast/rollup.config.mjs similarity index 100% rename from toast/rollup.config.js rename to toast/rollup.config.mjs