55 Commits
Author SHA1 Message Date
Ibrkhalil a8995eb394 Add iOS count favorites and their count and fetch all count 2023-10-17 19:33:34 +03:00
jp-23 93b1be88e0 feat(iOS): added getPhotoThumbnail (#536) 2023-09-29 10:49:28 +02:00
Théo Poizat 053dd8cc21 feat(iOS): Include assets originating from an iCloud Shared Album. (#525)
* Include assets originating from an iCloud Shared Album. iOS only.

* Add a switch to test includeSharedAlbums in GetPhotosPerformanceExample
2023-09-08 11:24:24 +02:00
Théo Poizat 07fef8f5e7 feat(iOS): Include subtype in get albums. (#526) 2023-09-01 16:15:16 +02:00
Arjan Zuidema 5800eecd18 chore(examples): Added getAlbums example (#528) 2023-08-31 10:54:49 +02:00
Vasile ab3be84b9b fix(ios): iosGetImageDataById for videos (#500)
* Fix get video data with iosGetImageDataById

* Update README.md with uploading example
2023-06-23 11:09:07 +02:00
Théo Poizat 1f6499be0a feat(iOS): Add subTypes field (#495)
Allow to know PHAssetMediaSubtype on iOS.
So for example if a node is a LivePhoto or a Panorama.
2023-05-31 09:33:11 +02:00
Théo Poizat a419ccce27 feat(all): Add modificationTimestamp field (#493)
* feat(android): Rename modified node field to more explicit name

* feat(ios): Return modificationDate in ios

* docs: Add modification date in ts, docs and examples
2023-05-22 15:03:05 +02:00
hellohublot b72291061f feat(ios): Added support for WEBP saving to camera roll (#489) 2023-04-28 15:00:02 +02:00
Wojciech Lewicki 2b595e5266 feat: Add support for new architecture (Fabric) (#460) 2023-03-09 14:47:47 +01:00
Tolgahan Çelik d515b12681 feat(all): file extension support (for CameraRoll.getPhotos ) (#440)
* Ios added extension support.

* Android added extesion support.

* Android mimetype process moved to utils.

* Typescript added types.

* Readme added types.
2022-12-08 09:22:33 +01:00
Arjan Zuidema 3d3fe6fae7 fix(android): Save gif (#428)
* save gifs to camera roll
2022-09-30 14:46:37 +02:00
Bartol Karuzaandidrissakhi c230dd0074 feat(all): fix various issues and big maintenance update of the library (#404) (#411) BREAKING
Fixes
fix(ci): fixed android release build as a CI test step

fix(android): Fix MediaStore issues and support scopped storage #322 #244

fix(android): Fix saveImageToCameraRoll #248 #254

fix(android): remove JCenter #340 #401

fix(ios): Fix performance issues #276

fix(ios): add method to get file Path from internal PH ID #135

fix(react-native): Bump used dependencies #393 ...

Fixes #322
Fixes #244
Fixes #248
Fixes #254
Fixes #340
Fixes #401
Fixes #276
Fixes #135
Fixes #393

new Features

feat(ios): now it's possible to listen to library selection changes
`useEffect(() => {
let subscription: EmitterSubscription;
if (isAboveIOS14) {
subscription = cameraRollEventEmitter.addListener('onLibrarySelectionChange', (_event) => {
getUnloadedPictures();
});
}

return () => {
if (isAboveIOS14 && subscription) {
subscription.remove();
}
};`

feat(ios): possibility to open native modal to update selection when authorization is limited
iosRefreshGallerySelection()
feat(ios): Convert HEIC images on demand to upload to server
BREAKING CHANGE: root import changed!
```
import { CameraRoll } from @react-native-community/cameraroll
instead of
import CameraRoll from @react-native-community/cameraroll
```

Co-authored-by: idrissakhi <85105624+idrissakhi@users.noreply.github.com>
2022-08-23 08:13:10 +00:00
Arjan Zuidema 3f0aed96db iOS: Use PHAccessLevelAddOnly for saveToCameraRoll (#355)
* Use PHAccessLevelAddOnly for saveToCameraRoll

* Fixed missing request code
2022-08-16 22:51:55 +02:00
Tai Le Tuan 44c96d5639 Improve performance when fetching with afterCursor != nil (#236)
When fetching with afterCursor != nil and include filename or fileSize or mime, performance will reduce heavily because we have to loop through all previous assets and call [PHAssetResource assetResourcesForAsset], which is slow and redundant
2022-08-08 12:59:42 +02:00
Eming Kwok 07dc818458 fix(iOS): prevent crash for fileSize fetching (#330) 2021-10-12 10:42:40 +02:00
John 3ade8c0a91 feat(iOS14): Support for the new auth status PHAuthorizationStatusLimited from iOS 14 (#326)
* feat `limited` in the response of CameraRoll.getPhotos(...) if the permission is `PHAuthorizationStatusLimited`

* update Flow types

* add example usage of the limited info
2021-10-09 22:34:54 -05:00
Radek Czemerys 24fa8aaa12 fix: Xcode 12 compatibility (#234) 2020-09-29 14:54:00 +03:00
Bartol Karuza a09af08f0a fix: Revert "Convert PHAsset to JPEG for uploading" (#207)
This reverts commit c958493441.

fixes #193

BREAKING CHANGE: this reverts forcing all mime types to jpeg on upload, which is the cause of lost GIF data
2020-06-24 11:21:42 +03:00
Harry Yu ec33d328af feat: Added imageSize and playableDuration to include param, deletes isStored (#187)
BREAKING CHANGE: imageSize and playableDuration are no longer included by default to improve performance
2020-06-23 08:45:20 +03:00
Bartol KaruzaandHarry Yu 4da8310892 feat: Added include parameter to getPhotos to let users tradeoff performance by omitting metadata (#178) (#200)
BREAKING CHANGE: meta data is no longer added as default. This applies to `fileName`, `fileSize` and `location`. If you need this metadata use the new `include` parameter. Adding this metadata will slow down the `getPhotos` function, so consider only retrieving this meta data for smaller sets of images as needed, instead of for all images.

* Created getPhotosFast function, fixed inconsistent getPhotos toDate logic

* Fixed wrong param name, added better typechecking

* Added example, renamed allowEmptyFilenames to skipGettingFilenames

* Removed `after` from getPhotosFast docs

* Redid implementation based on a new `include` param

* Updated API to use include parameter

* Fixed flow checking by converting index.ts to Typescript

* Unformatted README.md

* Unformatted README.md

* Unformatted README.md

* Added .prettierignore and ignored README.md for now

* Made example/index.js not checked by Flow

* Updated README.md to include notes in the outputs too

* Made inclusion of fields consistent, addressed other feedback

* Renamed GetPhotosFastParams back to GetPhotosParams

* Updated documentation to reflect nullable types

* Updated typings and documentation for fromTime, toTime

* Updated to fix `hasNextPage` being incorrectly false in some cases

Co-authored-by: Harry Yu <hy.harry.yu@gmail.com>
2020-06-16 13:20:51 +03:00
Bartol Karuza e65e1f208b fix: Revert "feat: Added include parameter to getPhotos to let users tradeoff performance by omitting metadata (#178)" (#199) 2020-06-16 13:05:12 +03:00
Harry Yu e54a6afa8b feat: Added include parameter to getPhotos to let users tradeoff performance by omitting metadata (#178)
* Created getPhotosFast function, fixed inconsistent getPhotos toDate logic

* Fixed wrong param name, added better typechecking

* Added example, renamed allowEmptyFilenames to skipGettingFilenames

* Removed `after` from getPhotosFast docs

* Redid implementation based on a new `include` param

* Updated API to use include parameter

* Fixed flow checking by converting index.ts to Typescript

* Unformatted README.md

* Unformatted README.md

* Unformatted README.md

* Added .prettierignore and ignored README.md for now

* Made example/index.js not checked by Flow

* Updated README.md to include notes in the outputs too

* Made inclusion of fields consistent, addressed other feedback

* Renamed GetPhotosFastParams back to GetPhotosParams

* Updated documentation to reflect nullable types

* Updated typings and documentation for fromTime, toTime

* Updated to fix `hasNextPage` being incorrectly false in some cases
2020-06-16 12:07:25 +03:00
Antonio GalloandAntonio Gallo e7cf8665d4 feat: Added fileSize for getPhotos API (#180)
Co-authored-by: Antonio Gallo <antgallo@amazon.com>
2020-05-20 20:35:59 +03:00
Conner Owen a4be52cf83 fix: Error Domain=PHPhotosErrorDomain Code=-1 (#172)
fixes #157 
fixes #143 

* Update RNCCameraRollManager.m
2020-05-08 22:41:46 +03:00
Eni Sinanaj b261a98efe fix: Fixed reference to git repository in Podspec file (#161)
* Fixed reference to git repository in Podspec file

* Fixed build issue because of unused variable

* Fixed issue with build. Unused variable inputImage
2020-04-30 15:16:19 +03:00
dmydry f51d38783e fix: getPhotos crash if there is a quote in album name (#156) 2020-03-26 12:01:09 +02:00
Justin Huntington 334ab0e1a6 fix: remove unused import that breaks the build for RN >= 0.60 (#150) 2020-03-26 10:19:45 +02:00
Tuan Luong fc1855e001 feat: get album list (#139) 2020-02-08 11:17:56 +08:00
JackandBartol Karuza e70cff5429 fix: fix IOS MetaData (#134)
* changes to fix IOS MetaData

* chore: fix formatting

Co-authored-by: Bartol Karuza <bartol.k@gmail.com>
2020-02-08 10:17:48 +08:00
Tuan Luong 75b4208474 feat: Support filter media items between dates (#140)
* Update RNCCameraRollManager.m

* Update CameraRollModule.java

* Update README.md

* Update RNCCameraRollManager.m

* Update CameraRoll.d.ts

* Update RNCCameraRollManager.h

* Update CameraRollModule.java

* Update RNCCameraRollManager.m

* update code
2020-02-05 17:20:54 +08:00
Zach Ramos 03bc028efe fix(lib) build error in RNCCameraRollManager.m (#109)
After upgrading to 1.3.0 that includes #87, my builds started to fail on the step to link react-native-cameraroll with the following message:
`Undefined symbol: _OBJC_Class_$_RCTImageLoader`.

I'm not sure what @tomtargosz's environment is like that allowed this to work, but it does not seem to work in 0.61.x with autolinked (cocoapods) dependencies. It looks like the recommendation made in that file is incorrect. 

The correct way to fix this, which I see in [react-native-image-crop-picker](https://github.com/ivpusic/react-native-image-crop-picker/blob/master/ios/src/ImageCropPicker.m#L394) and in [several](https://github.com/facebook/react-native/blob/master/Libraries/Image/RCTImageEditingManager.mm#L60) [internal](https://github.com/facebook/react-native/blob/master/Libraries/Image/RCTImageView.m#L324) [react files](@implementation RCTImageViewManager), is to use `[self.bridge moduleForName:@"ImageLoader" lazilyLoadIfNecessary:YES]`.
2019-11-14 18:22:32 +01:00
Tom Targosz c0a132daec fix(lib): Fix warning for deprecated RCTBridge interface for RCTImageLoader (#87) 2019-11-07 14:14:12 +01:00
Kevin Brown 7850dd538f feat(lib): Moved deletePhotos to use new PHAsset API and added an implementation for Android (#69)
* deletePhotos works in iOS

* Deletion works on Android.

* Removing unnecessary commented out code.

* Updated typescript typings.

* Made readme more accurate based on being able to retrieve failure from the iOS API.

* Let formatter run, also now rejecting the promise when there's any error on deletion on Android.
2019-11-07 14:13:24 +01:00
Bartol Karuza 75e325dcfe fix(lib): typo in PHFetchOptions (#78) 2019-08-14 22:01:26 +02:00
maxaggedon c958493441 fix(lib): Convert PHAsset to JPEG for uploading 2019-08-14 21:05:04 +02:00
SimonErm dc00a4f115 feat(lib): save photos or videos to an album
* add option to specify album in saveToCameraRoll and move the optional type param to options

* check platform before setting default value for group types to prevent exception

* adjust typings

* update invariant message

* format code

* extract new implementation to function to avoid breaking change

* format code

* add missing spaces

* fix(lib): add accidentally removed savedphotos back to the enum to prevent crash

* chore(lib): formatting

* chore(lib): add doc for the new save method
2019-08-14 21:00:20 +02:00
Kevin Brown 0d5a2dadb3 fix(lib): Remove unrecognised UTF8 tag from xcworkspace file 2019-08-14 19:15:36 +02:00
Jason Waldrip b1ceb75340 fixes #42, again (#66) 2019-06-26 10:38:30 +02:00
Bartol Karuza a2d39f0971 fix(lib): move to local variable instead of relying on the string constant from RN core (#63) 2019-06-18 17:32:38 +02:00
Edward Smith f420cefa77 feat(lib): Filename added to the image properties iOS and Android (#61)
* fix(lib): mirror fix PHAsset video upload

https://github.com/facebook/react-native/commit/458e70c79d3e12b5ad017d17ccea2fd62c1c3781#diff-3a2b7a4c4ebe5ac224b5a32896c032fb

* Include the filename in both iOS and Android

* Add filename to docs
2019-06-13 08:24:46 +02:00
Bartol Karuza 829c7bd65a fix(lib): mirror fix PHAsset video upload (#58)
https://github.com/facebook/react-native/commit/458e70c79d3e12b5ad017d17ccea2fd62c1c3781#diff-3a2b7a4c4ebe5ac224b5a32896c032fb
2019-06-13 08:19:37 +02:00
Seph Soliman f5973f8ebe Fix #45 ordering of photos when groupTypes is All (#46)
* Fix #45 ordering of photos when groupTypes is All

* Fix backwards compatible album name for all photos
2019-05-07 21:44:02 +02:00
Abdullah M 4d879e4cb1 Add check to prevent CFRelease(NULL) crash for mimeType 2019-04-18 10:19:31 +08:00
José Ignacio Guerrero VInueza c66cc4fb49 [FIX][iOS] All mediaTypes return order
This fixes the wrong return order when you fetch photos/videos (all)
2019-04-04 12:12:00 -05:00
全贺菁 953b3f083e fix no homepage in Podfile 2019-03-13 19:07:24 +08:00
Bartol Karuza 0c453b6118 general cleanup
Added typescript binding
Fixed flow type issues
renamed NativeModule to RNCCameraRoll
Added basic jest tests
prettier/lint issues fixed
2019-03-03 14:39:57 +08:00
Bartol Karuza bc557cf169 Sync @joshuagross RCTCameraRollManager: fix "all" photos filter
Summary: Currently, trying to fetch "all" photos will loop and never complete. Now it appears to produce the expected results (acting like the "All Photos" smart library in Photos) and doesn't loop. Confirmed console log results, showing no loops: P60994983

Reviewed By: PeteTheHeat

Differential Revision: D14221545

fbshipit-source-id: 31381b1ba2c673fd210cb95f3b7d0f8ffc23ec3f
2019-03-02 15:54:39 +08:00
Bartol Karuza 4777d05546 Make lib JS+native code reachable from iOS example app 2019-02-24 20:47:44 +08:00
Bartol Karuza b00c05bb81 fix iOS library file reference 2019-02-24 13:48:37 +08:00