diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 990d1d300..fb169d339 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-12] + os: [ubuntu-latest, macos-13] timeout-minutes: 30 outputs: plugins: ${{ steps.packages.outputs.paths }} @@ -51,7 +51,7 @@ jobs: files: ${{ steps.catjson.outputs.FILES_JSON }} lint: - runs-on: macos-12 + runs-on: macos-13 timeout-minutes: 30 needs: - setup @@ -74,7 +74,7 @@ jobs: - run: npm run lint verify-ios: - runs-on: macos-12 + runs-on: macos-13 if: needs.setup.outputs.plugins != '[]' timeout-minutes: 30 needs: @@ -83,7 +83,7 @@ jobs: strategy: matrix: xcode: - - /Applications/Xcode_14.2.app + - /Applications/Xcode_15.0.app plugin: ${{ fromJson(needs.setup.outputs.plugins) }} steps: - run: sudo xcode-select --switch ${{ matrix.xcode }} diff --git a/.github/workflows/dev-releases-for-pr.yml b/.github/workflows/dev-releases-for-pr.yml new file mode 100644 index 000000000..c7dbe7dfa --- /dev/null +++ b/.github/workflows/dev-releases-for-pr.yml @@ -0,0 +1,86 @@ +name: Release Dev Build for PR + +on: + pull_request: + types: + - opened + - synchronize + +jobs: + setup: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + timeout-minutes: 30 + outputs: + plugins: ${{ steps.packages.outputs.paths }} + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@ce177499ccf9fd2aded3b0426c97e5434c2e8a73 + with: + access_token: ${{ secrets.GITHUB_TOKEN }} + - name: Get Latest + uses: actions/setup-node@v3 + with: + node-version: 18.18.0 + - uses: actions/checkout@v3 + - name: Restore Dependency Cache + id: cache-modules + uses: actions/cache@v3 + with: + path: | + node_modules + */node_modules + key: ${{ runner.os }}-dependency-caching-${{ hashFiles('package.json', '*/package.json') }} + - run: npm install + - id: files + uses: tj-actions/changed-files@v37 + with: + json: true + write_output_files: true + - id: catjson + run: | + echo "FILES_JSON=$(cat .github/outputs/all_changed_files.json)" >> $GITHUB_OUTPUT + - id: packages + uses: ./.github/actions/changed-packages + with: + files: ${{ steps.catjson.outputs.FILES_JSON }} + + release-dev-of-plugins: + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + pull-requests: write + needs: + - setup + strategy: + matrix: + plugin: ${{ fromJson(needs.setup.outputs.plugins) }} + steps: + - uses: actions/setup-node@v3 + with: + node-version: 18.18.0 + - uses: actions/checkout@v3 + - name: Restore Dependency Cache + id: cache-modules + uses: actions/cache@v3 + with: + path: | + node_modules + */node_modules + key: ${{ runner.os }}-dependency-caching-${{ hashFiles('package.json', '*/package.json') }} + - run: npm install + - env: + PR_NUMBER: ${{ github.event.pull_request.number }} + run: | + npm version prerelease --no-git-tag-version -f --preid dev-$PR_NUMBER-$(date +%Y%m%dT%H%M%S) + npm publish --tag dev --dry-run + working-directory: ${{ matrix.plugin }} + - name: get-npm-version + id: package-version + uses: martinbeentjes/npm-get-version-action@v1.3.1 + with: + path: ${{ matrix.plugin }} + - uses: mshick/add-pr-comment@v2 + with: + message: | + Released dev build of ${{ matrix.plugin }} with dev version: ${{ steps.package-version.outputs.current-version }} diff --git a/.github/workflows/publish-ios.yml b/.github/workflows/publish-ios.yml index 844929b2d..ac633e06c 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-12 + runs-on: macos-13 if: github.event.inputs.plugins != '[]' timeout-minutes: 30 strategy: matrix: plugin: ${{ fromJson(github.event.inputs.plugins) }} steps: - - run: sudo xcode-select --switch /Applications/Xcode_14.2.app + - run: sudo xcode-select --switch /Applications/Xcode_15.0.app - uses: actions/setup-node@v3 with: node-version: 16 diff --git a/.github/workflows/publish-npm-alpha.yml b/.github/workflows/publish-npm-alpha.yml index a3ac53a30..d23ece87b 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-12 + runs-on: macos-13 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 a2bc5cfeb..52c0ea7d8 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-12 + runs-on: macos-13 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 4bd122812..59594db91 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-12 + runs-on: macos-13 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 57844ea3d..1accb8956 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-12 + runs-on: macos-13 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 6eaf7bd45..a0f462a7e 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-12 + runs-on: macos-13 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 b534d771f..e1e5c46d8 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-12 + runs-on: macos-13 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 600e3befd..97e7fb4f7 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-12 + runs-on: macos-13 timeout-minutes: 30 steps: - uses: actions/checkout@v3 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a1fdf57a0..bebcde00e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ See [`CONTRIBUTING.md`](https://github.com/ionic-team/capacitor/blob/HEAD/CONTRI brew install swiftlint ``` -Sometimes, it may be necessary to work on Capacitor in parellel with the plugin(s). In this case, a few extra steps are necessary: +Sometimes, it may be necessary to work on Capacitor in parallel with the plugin(s). In this case, a few extra steps are necessary: 4. Follow the Capacitor repo's [local setup instructions](https://github.com/ionic-team/capacitor/blob/HEAD/CONTRIBUTING.md#local-setup). 5. Toggle each plugin to use your local copy of Capacitor. @@ -47,13 +47,13 @@ To aid in managing these plugins, this repo has a variety of scripts (located in #### `npm run set-capacitor-version ""` -This script is for setting the version (or version range) of Capacitor packages in each plugin's `package.json`. It will also run `lerna bootstrap` for you. +This script is for setting the version (or version range) of Capacitor packages in each plugin's `package.json`. #### `npm run toggle-local` > :memo: Requires [Capacitor](https://github.com/ionic-team/capacitor/) to be cloned in a sibling directory. -This script is for switching between Capacitor packages from npm and Capacitor packages installed locally. It will also run `lerna bootstrap` for you. +This script is for switching between Capacitor packages from npm and Capacitor packages installed locally. > If you get npm errors, you can try installing from scratch: > diff --git a/app/README.md b/app/README.md index 5c0ec03ea..a89622092 100644 --- a/app/README.md +++ b/app/README.md @@ -170,7 +170,7 @@ Only available for Android. ### addListener('appStateChange', ...) ```typescript -addListener(eventName: 'appStateChange', listenerFunc: StateChangeListener) => Promise & PluginListenerHandle +addListener(eventName: 'appStateChange', listenerFunc: StateChangeListener) => Promise ``` Listen for changes in the app or the activity states. @@ -185,7 +185,7 @@ On Web it's fired when the document's visibilitychange gets fired. | **`eventName`** | 'appStateChange' | | **`listenerFunc`** | StateChangeListener | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 @@ -195,7 +195,7 @@ On Web it's fired when the document's visibilitychange gets fired. ### addListener('pause', ...) ```typescript -addListener(eventName: 'pause', listenerFunc: () => void) => Promise & PluginListenerHandle +addListener(eventName: 'pause', listenerFunc: () => void) => Promise ``` Listen for when the app or the activity are paused. @@ -209,7 +209,7 @@ On Web it's fired when the document's visibilitychange gets fired and document.h | **`eventName`** | 'pause' | | **`listenerFunc`** | () => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 4.1.0 @@ -219,7 +219,7 @@ On Web it's fired when the document's visibilitychange gets fired and document.h ### addListener('resume', ...) ```typescript -addListener(eventName: 'resume', listenerFunc: () => void) => Promise & PluginListenerHandle +addListener(eventName: 'resume', listenerFunc: () => void) => Promise ``` Listen for when the app or activity are resumed. @@ -234,7 +234,7 @@ On Web it's fired when the document's visibilitychange gets fired and document.h | **`eventName`** | 'resume' | | **`listenerFunc`** | () => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 4.1.0 @@ -244,7 +244,7 @@ On Web it's fired when the document's visibilitychange gets fired and document.h ### addListener('appUrlOpen', ...) ```typescript -addListener(eventName: 'appUrlOpen', listenerFunc: URLOpenListener) => Promise & PluginListenerHandle +addListener(eventName: 'appUrlOpen', listenerFunc: URLOpenListener) => Promise ``` Listen for url open events for the app. This handles both custom URL scheme links as well @@ -255,7 +255,7 @@ as URLs your app handles (Universal Links on iOS and App Links on Android) | **`eventName`** | 'appUrlOpen' | | **`listenerFunc`** | URLOpenListener | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 @@ -265,7 +265,7 @@ as URLs your app handles (Universal Links on iOS and App Links on Android) ### addListener('appRestoredResult', ...) ```typescript -addListener(eventName: 'appRestoredResult', listenerFunc: RestoredListener) => Promise & PluginListenerHandle +addListener(eventName: 'appRestoredResult', listenerFunc: RestoredListener) => Promise ``` If the app was launched with previously persisted plugin call data, such as on Android @@ -295,7 +295,7 @@ Activities (for example, Camera) to have this event and process handled. | **`eventName`** | 'appRestoredResult' | | **`listenerFunc`** | RestoredListener | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 @@ -305,7 +305,7 @@ Activities (for example, Camera) to have this event and process handled. ### addListener('backButton', ...) ```typescript -addListener(eventName: 'backButton', listenerFunc: BackButtonListener) => Promise & PluginListenerHandle +addListener(eventName: 'backButton', listenerFunc: BackButtonListener) => Promise ``` Listen for the hardware back button event (Android only). Listening for this event will disable the @@ -317,7 +317,7 @@ If you want to close the app, call `App.exitApp()`. | **`eventName`** | 'backButton' | | **`listenerFunc`** | BackButtonListener | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 diff --git a/app/src/definitions.ts b/app/src/definitions.ts index 33f7583ab..072dda507 100644 --- a/app/src/definitions.ts +++ b/app/src/definitions.ts @@ -184,7 +184,7 @@ export interface AppPlugin { addListener( eventName: 'appStateChange', listenerFunc: StateChangeListener, - ): Promise & PluginListenerHandle; + ): Promise; /** * Listen for when the app or the activity are paused. @@ -198,7 +198,7 @@ export interface AppPlugin { addListener( eventName: 'pause', listenerFunc: () => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Listen for when the app or activity are resumed. @@ -213,7 +213,7 @@ export interface AppPlugin { addListener( eventName: 'resume', listenerFunc: () => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Listen for url open events for the app. This handles both custom URL scheme links as well @@ -224,7 +224,7 @@ export interface AppPlugin { addListener( eventName: 'appUrlOpen', listenerFunc: URLOpenListener, - ): Promise & PluginListenerHandle; + ): Promise; /** * If the app was launched with previously persisted plugin call data, such as on Android @@ -254,7 +254,7 @@ export interface AppPlugin { addListener( eventName: 'appRestoredResult', listenerFunc: RestoredListener, - ): Promise & PluginListenerHandle; + ): Promise; /** * Listen for the hardware back button event (Android only). Listening for this event will disable the @@ -266,7 +266,7 @@ export interface AppPlugin { addListener( eventName: 'backButton', listenerFunc: BackButtonListener, - ): Promise & PluginListenerHandle; + ): Promise; /** * Remove all native listeners for this plugin diff --git a/browser/README.md b/browser/README.md index 53acc7322..2b914324f 100644 --- a/browser/README.md +++ b/browser/README.md @@ -80,7 +80,7 @@ No-op on other platforms. ### addListener('browserFinished', ...) ```typescript -addListener(eventName: 'browserFinished', listenerFunc: () => void) => Promise & PluginListenerHandle +addListener(eventName: 'browserFinished', listenerFunc: () => void) => Promise ``` Android & iOS only: Listen for the browser finished event. @@ -91,7 +91,7 @@ It fires when the Browser is closed by the user. | **`eventName`** | 'browserFinished' | | **`listenerFunc`** | () => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 @@ -101,7 +101,7 @@ It fires when the Browser is closed by the user. ### addListener('browserPageLoaded', ...) ```typescript -addListener(eventName: 'browserPageLoaded', listenerFunc: () => void) => Promise & PluginListenerHandle +addListener(eventName: 'browserPageLoaded', listenerFunc: () => void) => Promise ``` Android & iOS only: Listen for the page loaded event. @@ -113,7 +113,7 @@ It is not invoked for any subsequent page loads. | **`eventName`** | 'browserPageLoaded' | | **`listenerFunc`** | () => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 diff --git a/browser/src/definitions.ts b/browser/src/definitions.ts index 6946e5e7f..54474853a 100644 --- a/browser/src/definitions.ts +++ b/browser/src/definitions.ts @@ -26,7 +26,7 @@ export interface BrowserPlugin { addListener( eventName: 'browserFinished', listenerFunc: () => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Android & iOS only: Listen for the page loaded event. @@ -38,7 +38,7 @@ export interface BrowserPlugin { addListener( eventName: 'browserPageLoaded', listenerFunc: () => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Remove all native listeners for this plugin. diff --git a/filesystem/README.md b/filesystem/README.md index 41aa452f0..6d51590f1 100644 --- a/filesystem/README.md +++ b/filesystem/README.md @@ -101,6 +101,7 @@ const readFilePath = async () => { * [`requestPermissions()`](#requestpermissions) * [`downloadFile(...)`](#downloadfile) * [`addListener('progress', ...)`](#addlistenerprogress) +* [`removeAllListeners()`](#removealllisteners) * [Interfaces](#interfaces) * [Type Aliases](#type-aliases) * [Enums](#enums) @@ -365,7 +366,7 @@ Perform a http request to a server and download the file to the specified destin ### addListener('progress', ...) ```typescript -addListener(eventName: 'progress', listenerFunc: ProgressListener) => Promise & PluginListenerHandle +addListener(eventName: 'progress', listenerFunc: ProgressListener) => Promise ``` Add a listener to file download progress events. @@ -375,13 +376,26 @@ Add a listener to file download progress events. | **`eventName`** | 'progress' | | **`listenerFunc`** | ProgressListener | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 5.1.0 -------------------- +### removeAllListeners() + +```typescript +removeAllListeners() => Promise +``` + +Remove all listeners for this plugin. + +**Since:** 5.2.0 + +-------------------- + + ### Interfaces diff --git a/filesystem/src/definitions.ts b/filesystem/src/definitions.ts index d13af5293..5d0bce164 100644 --- a/filesystem/src/definitions.ts +++ b/filesystem/src/definitions.ts @@ -668,7 +668,13 @@ export interface FilesystemPlugin { addListener( eventName: 'progress', listenerFunc: ProgressListener, - ): Promise & PluginListenerHandle; + ): Promise; + /** + * Remove all listeners for this plugin. + * + * @since 5.2.0 + */ + removeAllListeners(): Promise; } /** diff --git a/geolocation/README.md b/geolocation/README.md index 0e478b4c1..6c4750b24 100644 --- a/geolocation/README.md +++ b/geolocation/README.md @@ -13,7 +13,6 @@ npx cap sync Apple requires privacy descriptions to be specified in `Info.plist` for location information: -- `NSLocationAlwaysUsageDescription` (`Privacy - Location Always Usage Description`) - `NSLocationWhenInUseUsageDescription` (`Privacy - Location When In Use Usage Description`) Read about [Configuring `Info.plist`](https://capacitorjs.com/docs/ios/configuration#configuring-infoplist) in the [iOS Guide](https://capacitorjs.com/docs/ios) for more information on setting iOS permissions in Xcode diff --git a/google-maps/CHANGELOG.md b/google-maps/CHANGELOG.md index cfde262fd..edcd9573a 100644 --- a/google-maps/CHANGELOG.md +++ b/google-maps/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [5.3.3](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.3.2...@capacitor/google-maps@5.3.3) (2023-10-04) + +### Bug Fixes + +- **google-maps:** Apply iconAnchor value to Marker anchor on Android ([#1822](https://github.com/ionic-team/capacitor-plugins/issues/1822)) ([ef65656](https://github.com/ionic-team/capacitor-plugins/commit/ef656564518d03624d5d74a3ca173a53594ec4ba)) +- **google-maps:** correctly apply CapacitorGoogleMapsPoint y value ([#1815](https://github.com/ionic-team/capacitor-plugins/issues/1815)) ([3c7e531](https://github.com/ionic-team/capacitor-plugins/commit/3c7e531dc1e49fa2a3267cdae3dda2379e62c005)) +- **google-maps:** use URLSession for remote iconUrl on iOS ([#1818](https://github.com/ionic-team/capacitor-plugins/issues/1818)) ([#1824](https://github.com/ionic-team/capacitor-plugins/issues/1824)) ([73ad64b](https://github.com/ionic-team/capacitor-plugins/commit/73ad64b665406d028cf2e171da89801a0ea9cf78)) + ## [5.3.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.3.1...@capacitor/google-maps@5.3.2) (2023-09-14) **Note:** Version bump only for package @capacitor/google-maps diff --git a/google-maps/README.md b/google-maps/README.md index e63385591..b9b643f37 100644 --- a/google-maps/README.md +++ b/google-maps/README.md @@ -17,7 +17,6 @@ To use the Google Maps SDK on any platform, API keys associated with an account The Google Maps SDK supports the use of showing the users current location via `enableCurrentLocation(bool)`. To use this, Apple requires privacy descriptions to be specified in `Info.plist`: -- `NSLocationAlwaysUsageDescription` (`Privacy - Location Always Usage Description`) - `NSLocationWhenInUseUsageDescription` (`Privacy - Location When In Use Usage Description`) Read about [Configuring `Info.plist`](https://capacitorjs.com/docs/ios/configuration#configuring-infoplist) in the [iOS Guide](https://capacitorjs.com/docs/ios) for more information on setting iOS permissions in Xcode. @@ -900,6 +899,9 @@ For iOS and Android only the config options declared on Logger.debug("Capacitor Google Maps", "Latest Google Maps renderer enabled") + MapsInitializer.Renderer.LEGACY -> Logger.debug("Capacitor Google Maps", "Legacy Google Maps renderer enabled - Cloud based map styling and advanced drawing not available") + } + } + override fun handleOnStart() { super.handleOnStart() maps.forEach { it.value.onStart() } diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapConfig.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapConfig.kt index 6f27d10ab..bc29ae08f 100644 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapConfig.kt +++ b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapConfig.kt @@ -16,6 +16,7 @@ class GoogleMapConfig(fromJSONObject: JSONObject) { var liteMode: Boolean = false var devicePixelRatio: Float = 1.00f var styles: String? = null + var mapId: String? = null init { if (!fromJSONObject.has("width")) { @@ -81,8 +82,14 @@ class GoogleMapConfig(fromJSONObject: JSONObject) { center = LatLng(lat, lng) val cameraPosition = CameraPosition(center, zoom.toFloat(), 0.0F, 0.0F) - googleMapOptions = GoogleMapOptions().camera(cameraPosition).liteMode(liteMode) styles = fromJSONObject.getString("styles") + + mapId = fromJSONObject.getString("androidMapId") + + googleMapOptions = GoogleMapOptions().camera(cameraPosition).liteMode(liteMode) + if (mapId != null) { + googleMapOptions?.mapId(mapId!!) + } } } diff --git a/google-maps/ios/Plugin/GoogleMapConfig.swift b/google-maps/ios/Plugin/GoogleMapConfig.swift index 4905b18e3..ef97fe77b 100644 --- a/google-maps/ios/Plugin/GoogleMapConfig.swift +++ b/google-maps/ios/Plugin/GoogleMapConfig.swift @@ -9,6 +9,7 @@ public struct GoogleMapConfig: Codable { let center: LatLng let zoom: Double let styles: String? + var mapId: String? init(fromJSObject: JSObject) throws { guard let width = fromJSObject["width"] as? Double else { @@ -50,5 +51,7 @@ public struct GoogleMapConfig: Codable { } else { self.styles = nil } + + self.mapId = fromJSObject["iOSMapId"] as? String } } diff --git a/google-maps/ios/Plugin/Map.swift b/google-maps/ios/Plugin/Map.swift index d7315f0e9..71e4a7de9 100644 --- a/google-maps/ios/Plugin/Map.swift +++ b/google-maps/ios/Plugin/Map.swift @@ -13,6 +13,7 @@ class GMViewController: UIViewController { var GMapView: GMSMapView! var cameraPosition: [String: Double]! var minimumClusterSize: Int? + var mapId: String? private var clusterManager: GMUClusterManager? @@ -25,7 +26,13 @@ class GMViewController: UIViewController { let camera = GMSCameraPosition.camera(withLatitude: cameraPosition["latitude"] ?? 0, longitude: cameraPosition["longitude"] ?? 0, zoom: Float(cameraPosition["zoom"] ?? 12)) let frame = CGRect(x: mapViewBounds["x"] ?? 0, y: mapViewBounds["y"] ?? 0, width: mapViewBounds["width"] ?? 0, height: mapViewBounds["height"] ?? 0) - self.GMapView = GMSMapView.map(withFrame: frame, camera: camera) + if let id = mapId { + let gmsId = GMSMapID(identifier: id) + self.GMapView = GMSMapView(frame: frame, mapID: gmsId, camera: camera) + } else { + self.GMapView = GMSMapView(frame: frame, camera: camera) + } + self.view = GMapView } @@ -85,6 +92,7 @@ public class Map { self.config = config self.delegate = delegate self.mapViewController = GMViewController() + self.mapViewController.mapId = config.mapId self.render() } diff --git a/google-maps/package.json b/google-maps/package.json index 685b6f2d4..0991ab49b 100644 --- a/google-maps/package.json +++ b/google-maps/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/google-maps", - "version": "5.3.2", + "version": "5.3.3", "description": "Google maps on Capacitor", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", diff --git a/google-maps/src/definitions.ts b/google-maps/src/definitions.ts index 0c2c92328..57f331c83 100644 --- a/google-maps/src/definitions.ts +++ b/google-maps/src/definitions.ts @@ -191,6 +191,36 @@ export interface GoogleMapConfig extends google.maps.MapOptions { * @since 4.3.0 */ styles?: google.maps.MapTypeStyle[] | null; + /** + * A map id associated with a specific map style or feature. + * + * [Use Map IDs](https://developers.google.com/maps/documentation/get-map-id) + * + * Only for Web. + * + * @since 6.0.0 + */ + mapId?: string; + /** + * A map id associated with a specific map style or feature. + * + * [Use Map IDs](https://developers.google.com/maps/documentation/get-map-id) + * + * Only for Android. + * + * @since 6.0.0 + */ + androidMapId?: string; + /** + * A map id associated with a specific map style or feature. + * + * [Use Map IDs](https://developers.google.com/maps/documentation/get-map-id) + * + * Only for iOS. + * + * @since 6.0.0 + */ + iOSMapId?: string; } /** diff --git a/google-maps/src/web.ts b/google-maps/src/web.ts index b8c6467b8..5b82addec 100644 --- a/google-maps/src/web.ts +++ b/google-maps/src/web.ts @@ -436,6 +436,7 @@ export class CapacitorGoogleMapsWeb async create(_args: CreateMapArgs): Promise { console.log(`Create map: ${_args.id}`); await this.importGoogleLib(_args.apiKey, _args.region, _args.language); + this.maps[_args.id] = { map: new window.google.maps.Map(_args.element, { ..._args.config }), element: _args.element, diff --git a/keyboard/README.md b/keyboard/README.md index 7b91cb501..0a016804a 100644 --- a/keyboard/README.md +++ b/keyboard/README.md @@ -238,7 +238,7 @@ This method is only supported on iOS. ### addListener('keyboardWillShow', ...) ```typescript -addListener(eventName: 'keyboardWillShow', listenerFunc: (info: KeyboardInfo) => void) => Promise & PluginListenerHandle +addListener(eventName: 'keyboardWillShow', listenerFunc: (info: KeyboardInfo) => void) => Promise ``` Listen for when the keyboard is about to be shown. @@ -250,7 +250,7 @@ On Android keyboardWillShow and keyboardDidShow fire almost at the same time. | **`eventName`** | 'keyboardWillShow' | | **`listenerFunc`** | (info: KeyboardInfo) => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 @@ -260,7 +260,7 @@ On Android keyboardWillShow and keyboardDidShow fire almost at the same time. ### addListener('keyboardDidShow', ...) ```typescript -addListener(eventName: 'keyboardDidShow', listenerFunc: (info: KeyboardInfo) => void) => Promise & PluginListenerHandle +addListener(eventName: 'keyboardDidShow', listenerFunc: (info: KeyboardInfo) => void) => Promise ``` Listen for when the keyboard is shown. @@ -272,7 +272,7 @@ On Android keyboardWillShow and keyboardDidShow fire almost at the same time. | **`eventName`** | 'keyboardDidShow' | | **`listenerFunc`** | (info: KeyboardInfo) => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 @@ -282,7 +282,7 @@ On Android keyboardWillShow and keyboardDidShow fire almost at the same time. ### addListener('keyboardWillHide', ...) ```typescript -addListener(eventName: 'keyboardWillHide', listenerFunc: () => void) => Promise & PluginListenerHandle +addListener(eventName: 'keyboardWillHide', listenerFunc: () => void) => Promise ``` Listen for when the keyboard is about to be hidden. @@ -294,7 +294,7 @@ On Android keyboardWillHide and keyboardDidHide fire almost at the same time. | **`eventName`** | 'keyboardWillHide' | | **`listenerFunc`** | () => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 @@ -304,7 +304,7 @@ On Android keyboardWillHide and keyboardDidHide fire almost at the same time. ### addListener('keyboardDidHide', ...) ```typescript -addListener(eventName: 'keyboardDidHide', listenerFunc: () => void) => Promise & PluginListenerHandle +addListener(eventName: 'keyboardDidHide', listenerFunc: () => void) => Promise ``` Listen for when the keyboard is hidden. @@ -316,7 +316,7 @@ On Android keyboardWillHide and keyboardDidHide fire almost at the same time. | **`eventName`** | 'keyboardDidHide' | | **`listenerFunc`** | () => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 diff --git a/keyboard/src/definitions.ts b/keyboard/src/definitions.ts index 7258ad05e..c712c598b 100644 --- a/keyboard/src/definitions.ts +++ b/keyboard/src/definitions.ts @@ -205,7 +205,7 @@ export interface KeyboardPlugin { addListener( eventName: 'keyboardWillShow', listenerFunc: (info: KeyboardInfo) => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Listen for when the keyboard is shown. @@ -217,7 +217,7 @@ export interface KeyboardPlugin { addListener( eventName: 'keyboardDidShow', listenerFunc: (info: KeyboardInfo) => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Listen for when the keyboard is about to be hidden. @@ -229,7 +229,7 @@ export interface KeyboardPlugin { addListener( eventName: 'keyboardWillHide', listenerFunc: () => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Listen for when the keyboard is hidden. @@ -241,7 +241,7 @@ export interface KeyboardPlugin { addListener( eventName: 'keyboardDidHide', listenerFunc: () => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Remove all native listeners for this plugin. diff --git a/local-notifications/README.md b/local-notifications/README.md index 0c1660b98..8cae30e7c 100644 --- a/local-notifications/README.md +++ b/local-notifications/README.md @@ -324,7 +324,7 @@ Request permission to display local notifications. ### addListener('localNotificationReceived', ...) ```typescript -addListener(eventName: 'localNotificationReceived', listenerFunc: (notification: LocalNotificationSchema) => void) => Promise & PluginListenerHandle +addListener(eventName: 'localNotificationReceived', listenerFunc: (notification: LocalNotificationSchema) => void) => Promise ``` Listen for when notifications are displayed. @@ -334,7 +334,7 @@ Listen for when notifications are displayed. | **`eventName`** | 'localNotificationReceived' | | **`listenerFunc`** | (notification: LocalNotificationSchema) => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 @@ -344,7 +344,7 @@ Listen for when notifications are displayed. ### addListener('localNotificationActionPerformed', ...) ```typescript -addListener(eventName: 'localNotificationActionPerformed', listenerFunc: (notificationAction: ActionPerformed) => void) => Promise & PluginListenerHandle +addListener(eventName: 'localNotificationActionPerformed', listenerFunc: (notificationAction: ActionPerformed) => void) => Promise ``` Listen for when an action is performed on a notification. @@ -354,7 +354,7 @@ Listen for when an action is performed on a notification. | **`eventName`** | 'localNotificationActionPerformed' | | **`listenerFunc`** | (notificationAction: ActionPerformed) => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 diff --git a/local-notifications/src/definitions.ts b/local-notifications/src/definitions.ts index fe25c8bcc..178376c2b 100644 --- a/local-notifications/src/definitions.ts +++ b/local-notifications/src/definitions.ts @@ -163,7 +163,7 @@ export interface LocalNotificationsPlugin { addListener( eventName: 'localNotificationReceived', listenerFunc: (notification: LocalNotificationSchema) => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Listen for when an action is performed on a notification. @@ -173,7 +173,7 @@ export interface LocalNotificationsPlugin { addListener( eventName: 'localNotificationActionPerformed', listenerFunc: (notificationAction: ActionPerformed) => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Remove all listeners for this plugin. diff --git a/motion/README.md b/motion/README.md index bdf728134..23f124d4c 100644 --- a/motion/README.md +++ b/motion/README.md @@ -71,7 +71,7 @@ API to understand the data supplied in the 'accel' event. ### addListener('accel', ...) ```typescript -addListener(eventName: 'accel', listenerFunc: AccelListener) => Promise & PluginListenerHandle +addListener(eventName: 'accel', listenerFunc: AccelListener) => Promise ``` Add a listener for accelerometer data @@ -81,7 +81,7 @@ Add a listener for accelerometer data | **`eventName`** | 'accel' | | **`listenerFunc`** | AccelListener | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 @@ -91,7 +91,7 @@ Add a listener for accelerometer data ### addListener('orientation', ...) ```typescript -addListener(eventName: 'orientation', listenerFunc: OrientationListener) => Promise & PluginListenerHandle +addListener(eventName: 'orientation', listenerFunc: OrientationListener) => Promise ``` Add a listener for device orientation change (compass heading, etc.) @@ -101,7 +101,7 @@ Add a listener for device orientation change (compass heading, etc.) | **`eventName`** | 'orientation' | | **`listenerFunc`** | OrientationListener | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 diff --git a/motion/src/definitions.ts b/motion/src/definitions.ts index 16642d336..ccc401581 100644 --- a/motion/src/definitions.ts +++ b/motion/src/definitions.ts @@ -9,7 +9,7 @@ export interface MotionPlugin { addListener( eventName: 'accel', listenerFunc: AccelListener, - ): Promise & PluginListenerHandle; + ): Promise; /** * Add a listener for device orientation change (compass heading, etc.) @@ -19,7 +19,7 @@ export interface MotionPlugin { addListener( eventName: 'orientation', listenerFunc: OrientationListener, - ): Promise & PluginListenerHandle; + ): Promise; /** * Remove all the listeners that are attached to this plugin. diff --git a/network/README.md b/network/README.md index 189aa8b8e..0e3c5022d 100644 --- a/network/README.md +++ b/network/README.md @@ -58,7 +58,7 @@ Query the current status of the network connection. ### addListener('networkStatusChange', ...) ```typescript -addListener(eventName: 'networkStatusChange', listenerFunc: ConnectionStatusChangeListener) => Promise & PluginListenerHandle +addListener(eventName: 'networkStatusChange', listenerFunc: ConnectionStatusChangeListener) => Promise ``` Listen for changes in the network connection. @@ -68,7 +68,7 @@ Listen for changes in the network connection. | **`eventName`** | 'networkStatusChange' | | **`listenerFunc`** | ConnectionStatusChangeListener | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 diff --git a/network/src/definitions.ts b/network/src/definitions.ts index 2355a76b0..ea2a3a1a5 100644 --- a/network/src/definitions.ts +++ b/network/src/definitions.ts @@ -16,7 +16,7 @@ export interface NetworkPlugin { addListener( eventName: 'networkStatusChange', listenerFunc: ConnectionStatusChangeListener, - ): Promise & PluginListenerHandle; + ): Promise; /** * Remove all listeners (including the network status changes) for this plugin. diff --git a/package.json b/package.json index 3c1f295f8..6b8df5511 100644 --- a/package.json +++ b/package.json @@ -23,17 +23,18 @@ "ci:publish:dev": "lerna publish prerelease --conventional-commits --conventional-prerelease --preid dev-$(date +\"%Y%m%dT%H%M%S\") --force-publish --no-changelog --no-git-tag-version --dist-tag dev --no-push --yes" }, "devDependencies": { - "@types/node": "~18.11.19", "@actions/core": "^1.9.1", + "@actions/http-client": "2.1.1", "@ionic/prettier-config": "^1.0.1", + "@types/node": "~18.11.19", "@types/prompts": "^2.0.8", "cross-spawn": "^7.0.3", "esm": "^3.2.25", + "glob": "^10.3.3", "lerna": "^7.1.3", "nx": "^16.3.1", "prettier": "~2.3.0", "prompts": "^2.3.2", - "glob": "^10.3.3", "typescript": "~4.1.5" }, "prettier": "@ionic/prettier-config", diff --git a/push-notifications/README.md b/push-notifications/README.md index d7b56f340..9a3c240b2 100644 --- a/push-notifications/README.md +++ b/push-notifications/README.md @@ -379,7 +379,7 @@ the permission without prompting again. ### addListener('registration', ...) ```typescript -addListener(eventName: 'registration', listenerFunc: (token: Token) => void) => Promise & PluginListenerHandle +addListener(eventName: 'registration', listenerFunc: (token: Token) => void) => Promise ``` Called when the push notification registration finishes without problems. @@ -391,7 +391,7 @@ Provides the push notification token. | **`eventName`** | 'registration' | | **`listenerFunc`** | (token: Token) => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 @@ -401,7 +401,7 @@ Provides the push notification token. ### addListener('registrationError', ...) ```typescript -addListener(eventName: 'registrationError', listenerFunc: (error: RegistrationError) => void) => Promise & PluginListenerHandle +addListener(eventName: 'registrationError', listenerFunc: (error: RegistrationError) => void) => Promise ``` Called when the push notification registration finished with problems. @@ -413,7 +413,7 @@ Provides an error with the registration problem. | **`eventName`** | 'registrationError' | | **`listenerFunc`** | (error: RegistrationError) => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 @@ -423,7 +423,7 @@ Provides an error with the registration problem. ### addListener('pushNotificationReceived', ...) ```typescript -addListener(eventName: 'pushNotificationReceived', listenerFunc: (notification: PushNotificationSchema) => void) => Promise & PluginListenerHandle +addListener(eventName: 'pushNotificationReceived', listenerFunc: (notification: PushNotificationSchema) => void) => Promise ``` Called when the device receives a push notification. @@ -433,7 +433,7 @@ Called when the device receives a push notification. | **`eventName`** | 'pushNotificationReceived' | | **`listenerFunc`** | (notification: PushNotificationSchema) => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 @@ -443,7 +443,7 @@ Called when the device receives a push notification. ### addListener('pushNotificationActionPerformed', ...) ```typescript -addListener(eventName: 'pushNotificationActionPerformed', listenerFunc: (notification: ActionPerformed) => void) => Promise & PluginListenerHandle +addListener(eventName: 'pushNotificationActionPerformed', listenerFunc: (notification: ActionPerformed) => void) => Promise ``` Called when an action is performed on a push notification. @@ -453,7 +453,7 @@ Called when an action is performed on a push notification. | **`eventName`** | 'pushNotificationActionPerformed' | | **`listenerFunc`** | (notification: ActionPerformed) => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 diff --git a/push-notifications/src/definitions.ts b/push-notifications/src/definitions.ts index e744e5ea7..99448b830 100644 --- a/push-notifications/src/definitions.ts +++ b/push-notifications/src/definitions.ts @@ -135,7 +135,7 @@ export interface PushNotificationsPlugin { addListener( eventName: 'registration', listenerFunc: (token: Token) => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Called when the push notification registration finished with problems. @@ -147,7 +147,7 @@ export interface PushNotificationsPlugin { addListener( eventName: 'registrationError', listenerFunc: (error: RegistrationError) => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Called when the device receives a push notification. @@ -157,7 +157,7 @@ export interface PushNotificationsPlugin { addListener( eventName: 'pushNotificationReceived', listenerFunc: (notification: PushNotificationSchema) => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Called when an action is performed on a push notification. @@ -167,7 +167,7 @@ export interface PushNotificationsPlugin { addListener( eventName: 'pushNotificationActionPerformed', listenerFunc: (notification: ActionPerformed) => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Remove all native listeners for this plugin. diff --git a/screen-orientation/README.md b/screen-orientation/README.md index 5eb1a0cce..056b05d40 100644 --- a/screen-orientation/README.md +++ b/screen-orientation/README.md @@ -93,7 +93,7 @@ Unlocks the screen's orientation. ### addListener('screenOrientationChange', ...) ```typescript -addListener(eventName: 'screenOrientationChange', listenerFunc: (orientation: ScreenOrientationResult) => void) => Promise & PluginListenerHandle +addListener(eventName: 'screenOrientationChange', listenerFunc: (orientation: ScreenOrientationResult) => void) => Promise ``` Listens for screen orientation changes. @@ -103,7 +103,7 @@ Listens for screen orientation changes. | **`eventName`** | 'screenOrientationChange' | | **`listenerFunc`** | (orientation: ScreenOrientationResult) => void | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 4.0.0 diff --git a/screen-orientation/src/definitions.ts b/screen-orientation/src/definitions.ts index bb6ac99f2..af3ac5cc1 100644 --- a/screen-orientation/src/definitions.ts +++ b/screen-orientation/src/definitions.ts @@ -38,7 +38,7 @@ export interface ScreenOrientationPlugin { addListener( eventName: 'screenOrientationChange', listenerFunc: (orientation: ScreenOrientationResult) => void, - ): Promise & PluginListenerHandle; + ): Promise; /** * Removes all listeners. diff --git a/screen-reader/README.md b/screen-reader/README.md index b0eeb009b..c3acd9c65 100644 --- a/screen-reader/README.md +++ b/screen-reader/README.md @@ -93,7 +93,7 @@ plugin](https://github.com/capacitor-community/text-to-speech). ### addListener('stateChange', ...) ```typescript -addListener(eventName: 'stateChange', listener: StateChangeListener) => Promise & PluginListenerHandle +addListener(eventName: 'stateChange', listener: StateChangeListener) => Promise ``` Add a listener for when the screen reader is turned on or off. @@ -108,7 +108,7 @@ Readers). | **`eventName`** | 'stateChange' | | **`listener`** | StateChangeListener | -**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle +**Returns:** Promise<PluginListenerHandle> **Since:** 1.0.0 diff --git a/screen-reader/src/definitions.ts b/screen-reader/src/definitions.ts index b8afda1ea..547753305 100644 --- a/screen-reader/src/definitions.ts +++ b/screen-reader/src/definitions.ts @@ -71,7 +71,7 @@ export interface ScreenReaderPlugin { addListener( eventName: 'stateChange', listener: StateChangeListener, - ): Promise & PluginListenerHandle; + ): Promise; /** * Remove all the listeners that are attached to this plugin. diff --git a/scripts/lib/lerna.mjs b/scripts/lib/lerna.mjs index 386a09c07..17eb2c020 100644 --- a/scripts/lib/lerna.mjs +++ b/scripts/lib/lerna.mjs @@ -11,4 +11,3 @@ const runLerna = async (args = []) => export const ls = async () => JSON.parse((await execLerna('ls --json')).stdout); export const exec = async (args = []) => await runLerna(['exec', ...args]); -export const bootstrap = async (args = []) => runLerna(['bootstrap', ...args]); diff --git a/scripts/set-capacitor-version.mjs b/scripts/set-capacitor-version.mjs index e9027abab..91abb060c 100644 --- a/scripts/set-capacitor-version.mjs +++ b/scripts/set-capacitor-version.mjs @@ -1,7 +1,8 @@ import { PROJECTS, PEERPROJECTS } from './lib/capacitor.mjs'; import { execute } from './lib/cli.mjs'; +import { root } from './lib/repo.mjs'; +import { run } from './lib/subprocess.mjs'; import { setLernaPackageDependencies } from './lib/version.mjs'; -import { bootstrap } from './lib/lerna.mjs'; execute(async () => { const packages = Object.fromEntries( @@ -13,5 +14,5 @@ execute(async () => { await setLernaPackageDependencies(packages, 'devDependencies'); await setLernaPackageDependencies(peerPackages, 'peerDependencies'); - await bootstrap(); + await run('npm', ['install'], { cwd: root, stdio: 'inherit' }); }); diff --git a/scripts/toggle-local.mjs b/scripts/toggle-local.mjs index 258fbeb03..4267c658e 100644 --- a/scripts/toggle-local.mjs +++ b/scripts/toggle-local.mjs @@ -4,8 +4,9 @@ import { PROJECTS } from './lib/capacitor.mjs'; import { execute } from './lib/cli.mjs'; import { unlink, readJSON, writeJSON } from './lib/fs.mjs'; import { root } from './lib/repo.mjs'; -import { bootstrap, ls } from './lib/lerna.mjs'; +import { ls } from './lib/lerna.mjs'; import { setPackageJsonDependencies } from './lib/version.mjs'; +import { run } from './lib/subprocess.mjs'; const readMarkerFile = async p => { try { @@ -58,7 +59,7 @@ execute(async () => { ), ); - await bootstrap(); + await run('npm', ['install'], { cwd: root, stdio: 'inherit' }); if (markerFile) { await unlink(markerFilePath); diff --git a/scripts/update-all.mjs b/scripts/update-all.mjs index b3bc60bcb..7c883e73e 100644 --- a/scripts/update-all.mjs +++ b/scripts/update-all.mjs @@ -1,6 +1,7 @@ import { PROJECTS } from './lib/capacitor.mjs'; import { execute } from './lib/cli.mjs'; -import { bootstrap } from './lib/lerna.mjs'; +import { root } from './lib/repo.mjs'; +import { run } from './lib/subprocess.mjs'; import { getLatestVersion, setLernaPackageDependencies, @@ -18,5 +19,5 @@ execute(async () => { await setLernaPackageDependencies(packages, 'devDependencies'); await setLernaPackageDependencies(packages, 'peerDependencies'); - await bootstrap(); + await run('npm', ['install'], { cwd: root, stdio: 'inherit' }); }); diff --git a/share/android/src/main/java/com/capacitorjs/plugins/share/SharePlugin.java b/share/android/src/main/java/com/capacitorjs/plugins/share/SharePlugin.java index 63b3635d4..36171b7e6 100644 --- a/share/android/src/main/java/com/capacitorjs/plugins/share/SharePlugin.java +++ b/share/android/src/main/java/com/capacitorjs/plugins/share/SharePlugin.java @@ -7,6 +7,7 @@ import android.os.Build; import android.webkit.MimeTypeMap; import androidx.activity.result.ActivityResult; +import androidx.core.content.ContextCompat; import androidx.core.content.FileProvider; import com.getcapacitor.JSArray; import com.getcapacitor.JSObject; @@ -41,7 +42,12 @@ public void onReceive(Context context, Intent intent) { } } }; - getActivity().registerReceiver(broadcastReceiver, new IntentFilter(Intent.EXTRA_CHOSEN_COMPONENT)); + ContextCompat.registerReceiver( + getContext(), + broadcastReceiver, + new IntentFilter(Intent.EXTRA_CHOSEN_COMPONENT), + ContextCompat.RECEIVER_EXPORTED + ); } @SuppressWarnings("deprecation") @@ -113,9 +119,12 @@ public void share(PluginCall call) { shareFiles(files, intent, call); } int flags = PendingIntent.FLAG_UPDATE_CURRENT; - if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { flags = flags | PendingIntent.FLAG_MUTABLE; } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + flags = flags | PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT; + } // requestCode parameter is not used. Providing 0 PendingIntent pi = PendingIntent.getBroadcast(getContext(), 0, new Intent(Intent.EXTRA_CHOSEN_COMPONENT), flags);