751 Commits

Author SHA1 Message Date
Manuel Beck
59f421982f refactor(ios): processPHPickerImage: and retrieveImage: (#952)
- Remove redundant image processing code in `processPHPickerImage:`, which is already done in `retrieveImage:`
- Improve documentation
2026-02-04 14:57:51 +01:00
Manuel Beck
1848db07ef ios: rename property pickerController to cdvUIImagePickerController (#949)
- Make clear that is a `CDVUIImagePickerController`
2026-01-30 19:19:49 +01:00
Manuel Beck
77e85f2f08 ios! rename CDVCameraPicker to CDVUIImagePickerController (#948)
- Rename to `CDVUIImagePickerController ` since it inherits from `UIImagePickerController` and is not only for taking pictures
- This is a breaking change because it renames an externally visible interface.
2026-01-30 18:41:01 +01:00
Manuel Beck
b75cff893e ios: rename method finalizePHPickerImage: and document it (#947)
- Rename to `processPHPickerImage:` since it does rotating, scaling and cropping and prepare the metadata
- Document the method and code
2026-01-30 17:49:52 +01:00
Manuel Beck
3c1268531e fix(ios): get correctly metadata with PHPicker (#944)
- `pickerResult.assetIdentifier` was wrongly used to get metadata, while `PHPickerConfiguration` was initialized with `init` which will not return any asset identifiers. Only `initWithPhotoLibrary:` would work. Since `init` is more flexible and lets the picker return items that aren’t PHAssets (e.g., cloud/shared providers) we use that and do not rely anymore on `assetIdentifier` to get the image data. The image data will now get by `[NSItemProvider loadDataRepresentationForTypeIdentifier:]` instead of `[PHImageManager requestImageDataAndOrientationForAsset:]`. The image data is needed to get meta data.
2026-01-29 20:11:08 +01:00
Manuel Beck
fe1896cf1e doc(ios): Document PHPickerConfigurationAssetRepresentationModeCurrent (#945) 2026-01-29 19:31:30 +01:00
Manuel Beck
d731cb9ad3 fix(ios): don't copy temporary video file on main thread and cleanup (#942)
- A user commented that`window.resolveLocalFileSystemURL` will fail when using the uri result for picking a video with PHPicker: https://github.com/apache/cordova-plugin-camera/issues/935#issuecomment-3742776758. The temporary video file provided by PHPickerViewController gets deleted when the completion handler exits. The copying of the video file was wrongly done on the main thread, rather than on the completion handler background thread.
- Report error to webview, if the video file could not successful copied to the temp directory

* Code refactoring and documentation

- Renamed `createTmpVideo` to `copyFileToTemp`, since it has no special code for just video files
- Log errors, if something is wrong in `copyFileToTemp `
- Document property `hasPendingOperation`
- Remove `dispatch_async` for returning `CDVPluginResult`. Internally, `CDVCommandDelegate` has a queue of plugin messages to send and it ensures that those are always sent to the webview on the main thread.
- Only use `dispatch_async(dispatch_get_main_queue(), ...` for UI operations
- Some minor code formatting for calling `CDVPluginResult` initializer
- Removed method `urlTransformer` which was deprecated in cordova-ios 8 and has no use anymore
- Removed unused method `integerValueForKey`: This method is legacy and was nowhere used
- Resolve method `processPHPickerImage`. This extra method is not needed
- Replace `IsAtLeastiOSVersion` with `@available`, `IsAtLeastiOSVersion` is deprecated
- Remove `IsAtLeastiOSVersion(@"8.0")` check for [locationManager requestWhenInUseAuthorization]. This plugins supports minimum iOS 11.
- Documentation and small refactoring regarding gettting GPS location for capturing JPEGs
- Use modern code for working with dictionaries
- fix: deprecation of `requestImageDataForAsset:options:resultHandler:`, which was deprecated in iOS 13. Replaced with `requestImageDataAndOrientationForAsset:options:resultHandler:`, which was introduced in iOS 11.

* Some cleanup regarding temporary file handling

- Renamed `createTmpVideo`to `copyFileToTemp` and keep the method generic, since it has no special code for video files
- Renamed `tempFilePath` to `tempFilePathForExtension`, since it creates unique path only for a file extension
- Document `tempFilePathForExtension`
- Refactoring and documentation of method `cleanup:`
- Moved `cleanup`, `tempFilePath` and `copyFileToTemp` at one place, since they are related
- creating unique temporary files with milliseconds: This is more precise than just using seconds
2026-01-29 14:08:55 +01:00
Manuel Beck
90ad137398 fix(ios)! remove iPadOS popover code (#941)
- On iPadOS it was possible to configure a popover for setting the position, width and arrow position of the popover.  The code used the deprecated `UIPopoverController`, which would have to be fixed. To keep the plugin also maintainable, this was removed.
- The popover could repositioned with a `CameraPopoverHandle` on a `window.onorientationchange`. This was removed also.
- Removed documentation for popover from `README.md`
2026-01-15 17:26:37 +01:00
Manuel Beck
dc682b2532 feat(ios): use PHPickerViewController for iOS 14+ (#937)
- Does not need any permissions for reading images
- The PHPickerViewController class is an alternative to UIImagePickerController. PHPickerViewController improves stability and reliability, and includes several benefits to developers and users, such as the following:
- Deferred image loading and recovery UI
- Reliable handling of large and complex assets, like RAW and panoramic images
- User-selectable assets that aren’t available for UIImagePickerController
- Configuration of the picker to display only Live Photos
- Availability of PHLivePhoto objects without library access
- Stricter validations against invalid inputs
- See documentation of PHPickerViewController: https://developer.apple.com/documentation/photosui/phpickerviewcontroller?language=objc
- Added tests for PHPickerViewController in `CameraTest.m`

* Documentation and formatting

- Document `takePicture` and `showCameraPicker` in `CDVCamera.m`
- A pragmas for UIImagePickerControllerDelegate methods and CLLocationManager methods
- Format some long methods declarations to multi-line instead single-line for better readability
- Remove unnecessry `dispatch_async(dispatch_get_main_queue() ...` in `takePicture` before calling `showCameraPicker`. This is already done in `showCameraPicker`.
- Source out code for permission denied alert dialog when accessing the camera or UIImagePickerController on iOS < 14 for picking images

* feat(ios): proper formatting of methods

- Use linux brace style: A brace have to be on a new line for method declarations
- Remove unnecessary whitespaces in method declrations

* doc: readme update

- Better document usage descriptions
- `NSPhotoLibraryUsageDescription` not needed for iOS 14+ when only picking images
- Improve formatting for xml, js
- sourceType `SAVEDPHOTOALBUM` is the same as `PHOTOLIBRARY` on Android and iOS 14+
- Use `PHOTOLIBRARY` as sourceType instead of `SAVEDPHOTOALBUM` in  photo picker example

* Android: Document `SAVEDPHOTOALBUM``

- Make clear that `SAVEDPHOTOALBUM` is the same like `PHOTOLIBRARY` and has only an effect on iOS < 14
- Format code when creating image chooser and document the request code parameter
2026-01-13 08:33:59 +01:00
Manuel Beck
599954887b chore(ci): update obsolete XCode versions, add iOS 18 and 26 (#938)
- XCode 13 and 14 is not available anymore, replaced it with XCode 15
- Added tests for iOS 18 and 26
2026-01-12 15:43:09 +01:00
Manuel Beck
80a2f18a05 chore!: bump 9.0.0-dev and cordova-ios to 7.0.0 (#939)
- Increased cordova-ios version to 7.x to make newer features availabe
- Removed wrong cordovaDependency for `5.0.4-dev`. `cordovaDependencies` matches only against npm released versions.
2025-12-08 16:32:50 +01:00
Norman Breau
8864262022 fix(android): Error propagation when no Camera application is available (#926) 2025-03-20 16:13:02 -03:00
エリス
b002b48735 chore: remove trailing whitespace (#921) 2025-01-15 16:03:14 +09:00
Norman Breau
979155ee98 chore: 8.0.1-dev 2024-10-30 11:12:59 -03:00
Norman Breau
7f33ef4add chore: version 8.0.0 8.0.0 rel/8.0.0 2024-10-30 11:08:58 -03:00
Norman Breau
4c9dc10512 deprecation: allowEdit (#914)
* deprecation: allowEdit

* applied suggestions to verbiage
2024-10-30 09:48:20 -03:00
Norman Breau
de468b6f63 fix: Remove WRITE_EXTERNAL_PERMISSION (#915) 2024-10-29 01:15:50 -03:00
Norman Breau
48c4cdd47f refactor(android): Make WRITE_EXTERNAL_STORAGE optional (#909)
* refactor(android): Rework permission management to make WRITE_EXTERNAL_STORAGE optional

* removed unused getPermissions API

* Proper error if WRITE_EXTERNAL_STORAGE is required but missing the declaration

* removed obsolete hasPermissions API
2024-10-28 15:21:37 -03:00
Norman Breau
7d159cf3c9 docs: Revisions for v8 public API changes with the return string formats of getPicture (#913) 2024-10-28 14:01:04 -03:00
Norman Breau
c208754c08 refactor(android): remove query img usage (#907)
* refactor: remove unnecessary duplicate image checks and queryImgDb usage

* remove unused imageType parameter, because it's a private API anyway
2024-10-28 13:32:35 -03:00
Norman Breau
0d86764b90 refactor(android): replace image path usage with image uris (#906)
* refactor(android): clean up image file path usages

* removed references of image paths in log messages
2024-10-28 12:35:50 -03:00
Norman Breau
7adccc8ee9 fix(ios): Sync camera API return to match Android changes (#911) 2024-10-27 08:32:38 -03:00
Norman Breau
53795454f4 fix(browser): Make data uri be returned as actual URI strings (#912) 2024-10-27 08:32:14 -03:00
Norman Breau
2eaa9a3972 fix: return content uris when possible when selecting from gallery (#902) 2024-10-26 00:58:24 -03:00
Norman Breau
a672c31efb fix(android): Return data uris as an URI (#910) 2024-10-26 00:58:00 -03:00
Norman Breau
16325102c7 fix(android): Improper serialization of image uri in save instance state (#903) 2024-10-25 13:59:29 -03:00
Norman Breau
36bf8e7331 fix(android): improper cache path construction during image manipulation (#905) 2024-10-25 13:15:59 -03:00
Norman Breau
feb7643bc3 fix(android): Use VERSION_CODES instead of hard-coded API literals (#904) 2024-10-25 13:10:05 -03:00
Norman Breau
44480300d9 fix(android): Isolate provider access to a subdirectory (#901) 2024-10-25 13:09:03 -03:00
ravi-yk
faa4615ee0 Remove media permissions to make complaint with Android 14 requirements (#889)
Co-authored-by: Ravi Yakasiri <ravi.yakasiri@planonsoftware.com>
2024-10-24 13:38:18 -03:00
Norman Breau
0a4bfe1a74 chore: Update package to 8.0.0-dev (#899) 2024-10-21 09:38:35 -03:00
Norman Breau
49438dee6d chore: Update eslint config to 5.1.0 (#898) 2024-10-19 12:17:43 -03:00
jcesarmobile
f38aba2b59 ci: sync workflow with paramedic (#895) 2024-08-08 12:16:56 +09:00
Norman Breau
3b73186b91 chore: Added npmrc 2024-07-27 01:30:29 -03:00
Norman Breau
40a5db10c7 ci(android): Update Android CI to be compatible with cordova-android@13 (#890) 2024-07-16 14:54:17 -03:00
Erisu
9eecbaa1af chore: bump version 7.0.1-dev 2023-09-06 17:02:23 +09:00
Erisu
24839eb71f release(camera-v7.0.0): updated version and RELEASENOTES.md 7.0.0 rel/7.0.0 2023-09-06 16:55:23 +09:00
エリス
64bd32d641 ci(gh-action): sync with paramedic configs (#851) 2023-09-06 02:27:41 +09:00
jcesarmobile
0796f784c1 chore: remove windows/osx from plugin.xml (#850) 2023-09-01 02:12:00 +02:00
jcesarmobile
20293f3d64 fix!: remove deprecated platforms (#848) 2023-09-01 00:34:30 +02:00
jcesarmobile
8cb34e1175 chore: Update SUPPORT_QUESTION.md template (#849) 2023-08-30 23:35:39 +02:00
エリス
505ccefb4c feat(android)!: Android 13 support (#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>
2023-08-26 20:21:32 +09:00
エリス
61a6e9bb44 dep(dev)!: bump @cordova/eslint-config@5.0.0 (#846)
* dep(dev)!: bump @cordova/eslint-config@5.0.0
* chore: apply automatic lint fix
2023-08-18 00:59:25 +09:00
エリス
c2eb21d201 chore: bump plugin version 7.0.0-dev (#845) 2023-08-17 21:43:13 +09:00
Norman Breau
23642f09b5 ci(android): Drop API 22 & 31. Added API 24 & 33 (#835)
Co-authored-by: エリス <erisu@users.noreply.github.com>
2023-06-05 22:50:49 +09:00
Norman Breau
84166f6355 chore(android): Cleanup obsolete BuildConfig comments (#831) 2023-04-14 08:48:12 -03:00
seamlink-aalves
2c09ade500 fix(android): set applicationId (#827)
Co-authored-by: Alexandre Alves <aalves@seamlink.com>
2023-04-14 08:06:30 -03:00
エリス
827bb611ee ci: sync workflow with paramedic (#804) 2022-10-01 13:28:27 +09:00
jcesarmobile
d0545c879f fix(browser): use navigator.mediaDevices.getUserMedia (#810) 2022-09-30 00:59:27 +02:00
jcesarmobile
d0d46c151c docs(README): Document ANDROIDX_CORE_VERSION variable (#808) 2022-09-25 05:03:51 +02:00