Skip to content

Commit

Permalink
[ZP-13183] Merge Upstream (#5)
Browse files Browse the repository at this point in the history
* fix(android): update queries in plugin.xml (apache#780)

Solves the issue with duplicate queries elements in AppManifest.xml

apache#779

* fix(ios): preserving EXIF data (apache#712)

* ci(android): update java requirement for cordova-android@11 (apache#798)

* dep(npm): bump package-lock v2 w/ rebuild (apache#800)

* docs(README): Document ANDROIDX_CORE_VERSION variable (apache#808)

* fix(browser): use navigator.mediaDevices.getUserMedia (apache#810)

* ci: sync workflow with paramedic (apache#804)

* fix(android): set applicationId (apache#827)

Co-authored-by: Alexandre Alves <aalves@seamlink.com>

* chore(android): Cleanup obsolete BuildConfig comments (apache#831)

* ci(android): Drop API 22 & 31. Added API 24 & 33 (apache#835)

Co-authored-by: エリス <erisu@users.noreply.github.com>

* chore: bump plugin version 7.0.0-dev (apache#845)

* dep(dev)!: bump @cordova/eslint-config@5.0.0 (apache#846)

* dep(dev)!: bump @cordova/eslint-config@5.0.0
* chore: apply automatic lint fix

* feat(android)!: Android 13 support (apache#844)

* feat(android)!: Android 13 support
* refactor(android): simplify getPermissions logic
* feat(android)!: bump cordova-android requirement to >=12.0.0
* feat(android): update saveAlbumPermission to include Android 9 and below use case

---------

Co-authored-by: ochakov <evgeny@ochakov.com>

* chore: Update SUPPORT_QUESTION.md template (apache#849)

* fix!: remove deprecated platforms (apache#848)

* chore: remove windows/osx from plugin.xml (apache#850)

* ci(gh-action): sync with paramedic configs (apache#851)

* release(camera-v7.0.0): updated version and RELEASENOTES.md

* chore: bump version 7.0.1-dev

---------

Co-authored-by: Marcus Abrahamsson <marcus.abrahamsson13@gmail.com>
Co-authored-by: Scott Murphy <scott@alwaysvip.com>
Co-authored-by: エリス <erisu@users.noreply.github.com>
Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>
Co-authored-by: seamlink-aalves <49952868+seamlink-aalves@users.noreply.github.com>
Co-authored-by: Alexandre Alves <aalves@seamlink.com>
Co-authored-by: Norman Breau <norman@nbsolutions.ca>
Co-authored-by: ochakov <evgeny@ochakov.com>
Co-authored-by: Erisu <erisu@apache.org>
  • Loading branch information
10 people committed Oct 20, 2023
1 parent b3d35a9 commit b567317
Show file tree
Hide file tree
Showing 23 changed files with 3,880 additions and 2,524 deletions.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ For usage and support questions, please check out the resources below. Thanks!

You can get answers to your usage and support questions about **Apache Cordova** on:

* Slack Community Chat: https://cordova.slack.com (you can sign-up at http://slack.cordova.io/)
* GitHub Discussions: https://github.com/apache/cordova/discussions
* Slack Community Chat: https://cordova.slack.com (you can sign-up at https://s.apache.org/cordova-slack)
* StackOverflow: https://stackoverflow.com/questions/tagged/cordova using the tag `cordova`

---
Expand All @@ -22,6 +23,4 @@ If you are using a tool that uses Cordova internally, like e.g. Ionic, check the

* **Ionic Framework**
* [Ionic Community Forum](https://forum.ionicframework.com/)
* [Ionic Worldwide Slack](https://ionicworldwide.herokuapp.com/)
* **PhoneGap**
* [PhoneGap Developer Community](https://forums.adobe.com/community/phonegap)
* [Ionic Discord](https://ionic.link/discord)
45 changes: 17 additions & 28 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
test:
name: Android ${{ matrix.versions.android }} Test
runs-on: macos-latest
continue-on-error: true

# hoist configurations to top that are expected to be updated
env:
Expand All @@ -43,8 +44,8 @@ jobs:

# These are the default Java configurations used by most tests.
# To customize these options, add "java-distro" or "java-version" to the strategy matrix with its overriding value.
default_java-distro: adopt
default_java-version: 8
default_java-distro: temurin
default_java-version: 11

# These are the default Android System Image configurations used by most tests.
# To customize these options, add "system-image-arch" or "system-image-target" to the strategy matrix with its overriding value.
Expand All @@ -55,43 +56,31 @@ jobs:
strategy:
matrix:
versions:
- android: 5.1
android-api: 22

- android: 6
android-api: 23

# Test the lowest minimum supported APIs
- android: 7
android-api: 24

- android: 7.1
android-api: 25

- android: 8
android-api: 26

- android: 8.1
android-api: 27
system-image-target: default

- android: 9
android-api: 28

# Test the last 3-4 supported APIs
- android: 10
android-api: 29

- android: 11
android-api: 30
java-version: 11

- android: 12L
android-api: 32

- android: 13
android-api: 33

timeout-minutes: 60

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
env:
java-version: ${{ matrix.versions.java-version == '' && env.default_java-version || matrix.versions.java-version }}
java-distro: ${{ matrix.versions.java-distro == '' && env.default_java-distro || matrix.versions.java-distro }}
Expand All @@ -113,10 +102,10 @@ jobs:
npm ci
- name: Run paramedic install
if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
run: npm i -g github:apache/cordova-paramedic

- uses: reactivecircus/android-emulator-runner@5de26e4bd23bf523e8a4b7f077df8bfb8e52b50e
- uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b
env:
system-image-arch: ${{ matrix.versions.system-image-arch == '' && env.default_system-image-arch || matrix.versions.system-image-arch }}
system-image-target: ${{ matrix.versions.system-image-target == '' && env.default_system-image-target || matrix.versions.system-image-target }}
Expand All @@ -130,7 +119,7 @@ jobs:
script: echo "Pregenerate the AVD before running Paramedic"

- name: Run paramedic tests
uses: reactivecircus/android-emulator-runner@5de26e4bd23bf523e8a4b7f077df8bfb8e52b50e
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b
env:
system-image-arch: ${{ matrix.versions.system-image-arch == '' && env.default_system-image-arch || matrix.versions.system-image-arch }}
system-image-target: ${{ matrix.versions.system-image-target == '' && env.default_system-image-target || matrix.versions.system-image-target }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/chrome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
node-version: 16

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}

Expand All @@ -61,7 +61,7 @@ jobs:
npm ci
- name: Run paramedic install
if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
run: npm i -g github:apache/cordova-paramedic

- name: Run paramedic tests
Expand Down
27 changes: 11 additions & 16 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
test:
name: iOS ${{ matrix.versions.ios-version }} Test
runs-on: ${{ matrix.versions.os-version }}
continue-on-error: true

# hoist configurations to top that are expected to be updated
env:
Expand All @@ -49,28 +50,28 @@ jobs:
strategy:
matrix:
versions:
- os-version: macos-10.15
ios-version: 12.x
xcode-version: 11.x

- os-version: macos-10.15
- os-version: macos-11
ios-version: 13.x
xcode-version: 11.x

- os-version: macos-10.15
- os-version: macos-11
ios-version: 14.x
xcode-version: 12.x

- os-version: macos-11
ios-version: 15.x
xcode-version: 13.x

- os-version: macos-12
ios-version: 16.x
xcode-version: 14.x

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- uses: maxim-lobanov/setup-xcode@881be567d30efed8fb3f12b5099d68c3fb72aa3d
- uses: maxim-lobanov/setup-xcode@9a697e2b393340c3cacd97468baa318e4c883d98
env:
xcode-version: ${{ matrix.versions.xcode-version == '' && env.default_xcode-version || matrix.versions.xcode-version }}
with:
Expand All @@ -87,14 +88,8 @@ jobs:
npm i -g cordova@latest ios-deploy@latest
npm ci
- name: Run setup iOS 12.x support
if: ${{ matrix.versions.ios-version == '12.x' }}
run: |
sudo mkdir -p /Library/Developer/CoreSimulator/Profiles/Runtimes
sudo ln -s /Applications/Xcode_10.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 12.4.simruntime
- name: Run paramedic install
if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
run: npm i -g github:apache/cordova-paramedic

- name: Run paramedic tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
node-version: 16

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}

Expand Down
30 changes: 8 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,20 @@ Although the object is attached to the global scoped `navigator`, it is not avai

## Installation

This requires cordova 5.0+

cordova plugin add cordova-plugin-camera
Older versions of cordova can still install via the __deprecated__ id

cordova plugin add org.apache.cordova.camera
It is also possible to install via repo url directly ( unstable )

cordova plugin add https://github.com/apache/cordova-plugin-camera.git

## Plugin variables

The plugin uses the `ANDROIDX_CORE_VERSION` variable to configure `androidx.core:core` dependency. This allows to avoid conflicts with other plugins that have the dependency hardcoded.
If no value is passed, it will use `1.6.+` as the default value.

The variable is configured on install time

cordova plugin add cordova-plugin-camera --variable ANDROIDX_CORE_VERSION=1.8.0

## How to Contribute

Expand Down Expand Up @@ -168,8 +172,6 @@ __Supported Platforms__
- Android
- Browser
- iOS
- Windows
- OSX

More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPicture-quirks).

Expand Down Expand Up @@ -472,16 +474,6 @@ displays:
// do your thing here!
}, 0);

#### Windows quirks

On Windows Phone 8.1 using `SAVEDPHOTOALBUM` or `PHOTOLIBRARY` as a source type causes application to suspend until file picker returns the selected image and
then restore with start page as defined in app's `config.xml`. In case when `camera.getPicture` was called from different page, this will lead to reloading
start page from scratch and success and error callbacks will never be called.

To avoid this we suggest using SPA pattern or call `camera.getPicture` only from your app's start page.

More information about Windows Phone 8.1 picker APIs is here: [How to continue your Windows Phone app after calling a file picker](https://msdn.microsoft.com/en-us/library/windows/apps/dn720490.aspx)

## `CameraOptions` Errata <a name="CameraOptions-quirks"></a>

#### Android Quirks
Expand Down Expand Up @@ -567,12 +559,6 @@ function displayImage(imgUri) {
}
```

To display the image on some platforms, you might need to include the main part of the URI in the Content-Security-Policy `<meta>` element in index.html. For example, on Windows 10, you can include `ms-appdata:` in your `<meta>` element. Here is an example.

```html
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: ms-appdata: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
```

## Take a Picture and Return Thumbnails (Resize the Picture) <a name="getThumbnails"></a>

To get smaller images, you can return a resized image by passing both `targetHeight` and `targetWidth` values with your CameraOptions object. In this example, you resize the returned image to fit in a 100px by 100px box (the aspect ratio is maintained, so 100px is either the height or width, whichever is greater in the source).
Expand Down
35 changes: 35 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,41 @@
-->
# Release Notes

### 7.0.0 (Sep 06, 2023)

**Breaking Changes:**

* [GH-848](https://github.com/apache/cordova-plugin-camera/pull/848) fix!: remove deprecated platforms
* [GH-844](https://github.com/apache/cordova-plugin-camera/pull/844) feat(android)!: Android 13 support

**Fixes:**

* [GH-827](https://github.com/apache/cordova-plugin-camera/pull/827) fix(android): set `applicationId`
* [GH-810](https://github.com/apache/cordova-plugin-camera/pull/810) fix(browser): use `navigator.mediaDevices.getUserMedia`
* [GH-712](https://github.com/apache/cordova-plugin-camera/pull/712) fix(ios): preserving `EXIF` data
* [GH-780](https://github.com/apache/cordova-plugin-camera/pull/780) fix(android): update queries in `plugin.xml`

**Chores, Dependencies, Docs:**

* [GH-850](https://github.com/apache/cordova-plugin-camera/pull/850) chore: remove windows/osx from `plugin.xml`
* [GH-849](https://github.com/apache/cordova-plugin-camera/pull/849) chore: Update `SUPPORT_QUESTION.md` template
* [GH-831](https://github.com/apache/cordova-plugin-camera/pull/831) chore(android): Cleanup obsolete `BuildConfig` comments
* [GH-846](https://github.com/apache/cordova-plugin-camera/pull/846) dep(dev)!: bump `@cordova/eslint-config@5.0`
* [GH-800](https://github.com/apache/cordova-plugin-camera/pull/800) dep(npm): bump package-lock v2 w/ rebuild
* [GH-808](https://github.com/apache/cordova-plugin-camera/pull/808) docs(README): Document `ANDROIDX_CORE_VERSION` variable

**CI:**

* [GH-851](https://github.com/apache/cordova-plugin-camera/pull/851) ci(gh-action): sync with `paramedic` configs
* [GH-835](https://github.com/apache/cordova-plugin-camera/pull/835) ci(android): Drop API 22 & 31. Added API 24 & 33
* [GH-804](https://github.com/apache/cordova-plugin-camera/pull/804) ci: sync workflow with `paramedic`
* [GH-798](https://github.com/apache/cordova-plugin-camera/pull/798) ci(android): update java requirement for `cordova-android@11`
* [GH-770](https://github.com/apache/cordova-plugin-camera/pull/770) ci(ios): update workflow w/ iOS 15
* [GH-766](https://github.com/apache/cordova-plugin-camera/pull/766) ci: remove old ci workflow
* [GH-765](https://github.com/apache/cordova-plugin-camera/pull/765) ci: add action-badge
* [GH-764](https://github.com/apache/cordova-plugin-camera/pull/764) ci: remove `travis` & `appveyor`
* [GH-762](https://github.com/apache/cordova-plugin-camera/pull/762) ci: add `gh-actions` workflows

### 6.0.0 (Aug 19, 2021)

**Feature:**
Expand Down

0 comments on commit b567317

Please sign in to comment.