CameraRoll.getPhotos return just a few on iOS
See original GitHub issueEnvironment
Environment: OS: Linux 4.15 Node: 10.6.0 Yarn: 1.7.0 npm: 6.1.0 Watchman: Not Found Xcode: N/A Android Studio: Not Found
Packages: (wanted => installed) react: 16.3.1 => 16.3.1 react-native: https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz => 0.55.4
Description
The CameraRoll.getPhotos function only returns some photos on iOS, while it works perfectly on Android. For example, if I use the following parameters
{
first: 100,
assetType: 'All',
groupTypes: 'All',
}
I only get 39 photos, while I have more than a thousand in my camera roll. I have also tried with multiple different parameters, but the result is the same (or fewer photos because of a filter).
Reproducible Demo
https://snack.expo.io/Hyw-kQa4X
- I think it must be run on a physical iOS device, because it has to access the camera roll.
- The demo prints the length of response.length, where response is the resolved value of CameraRoll.getPhotos with the parameters I mentioned earlier.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:14 (4 by maintainers)
Top Results From Across the Web
React Native CameraRoll.getPhotos API doesn't render the ...
So I resolved this issue. The main reason for my problem was I was not using CameraRoll.getPhotos properly as a Promise.
Read more >@react-native-camera-roll/camera-roll - npm
CameraRoll.getPhotos(params);. Returns a Promise with photo identifier objects from the local camera roll of the device matching shape ...
Read more >CameraRoll - React Native Archive
getPhotos (params);. Returns a Promise with photo identifier objects from the local camera roll of the device matching shape defined by getPhotosReturnChecker ....
Read more >How to transfer photos from iPhone to PC – 8 ways - CopyTrans
How to get photos off iPhone using Windows Explorer ... This method is very slow though, unless you need to transfer only a...
Read more >Automatically save photos and videos with OneDrive on iOS
The camera roll on your device only uploads to OneDrive - it does not sync photos ... If automatic camera upload isn't working,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Unless people’s environments are starkly different from mine the switch will fix it. My app uses
PHPhotoLibrary
’sPHAsset.fetch
to get the IDs using bridge Swift code, then string manipulation to turn them intoALAssetsLibrary
style URIs.Everything else in React (Image tag, upload libraries, custom image tags, etc) will work just fine with
ALAssetsLibrary
URIs even ifCameraRoll
couldn’t find them to begin with. They will not work withPHAssets
. Live photo/burst get treated as their key frame single image.I think the harder part of switching
CameraRoll
over is that everything else in React has to follow suit. It will require switchingCameraRoll
to have an option for whether it givesPHAssets
orALAssets
, even if the only difference ends up being some string manipulation of the URI format.@hramos What is the process for getting something like that done? I’ve never worked on React Native itself before.
@airlaser Can you post these as separate issues please? No-one is tracking this closed issue.