Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CameraRoll.getPhotos breaks with assetType = photos #13671

Closed
zackify opened this issue Apr 26, 2017 · 10 comments
Closed

CameraRoll.getPhotos breaks with assetType = photos #13671

zackify opened this issue Apr 26, 2017 · 10 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@zackify
Copy link

zackify commented Apr 26, 2017

Description

I'm using this library: https://github.com/jeanpan/react-native-camera-roll-picker/blob/master/index.js under the hood it calls the cameraRoll api. When I pass in 'All' for the asset type, it works. When I use 'Photos' as the type, the app crashes inside of the RCTCameraRoll code:

screen shot 2017-04-26 at 10 11 19 am

Reproduction Steps and Sample Code

I was going to try and add an example on expo, but it won't work unless you have more than just photos in your camera roll. To reproduce, just call CameraRoll.getPhotos({assetType: 'Photos'})

  • React Native version: 0.43.4
  • Platform: iOS
  • Development Operating System: MacOS
  • Dev tools: Xcode 8.3.2, iOS 10.3.1
@zackify zackify closed this as completed Apr 27, 2017
@elanini
Copy link

elanini commented May 17, 2017

Hi zackify, I'm having the same issue. How did you solve it?

@klvs
Copy link
Contributor

klvs commented May 17, 2017

@zackify I'm running into this problem. I noticed you closed it, did you solve it or find a work around, if so what is it?

@zackify
Copy link
Author

zackify commented May 17, 2017 via email

@pentarex
Copy link
Contributor

I am having the same issue with CameraRoll from RN.

CameraRoll.getPhotos({
            first: 20,
            groupTypes: 'All',
            assetType: 'Photos'
        }).then(r => {
            console.log(r);
            
        }).catch((err) => {
             console.log('gallery', err);
        });

The thing is that some photo for some reason filename is missing (maybe iCloud). And I think its crashing because of that (not completely sure), but as I see @zackify also his filename was nil.

It doesn't fail under the simulator, but on my real device, where most of my photos are on iCloud.

@sujit13666
Copy link

Same Here guys.

@pentarex
Copy link
Contributor

The pull request was approved, it only needs to get merged.

facebook-github-bot pushed a commit that referenced this issue Jan 12, 2018
…ilename is provided. #13671

Summary:
RCTCameraRollManager.m crashes when there is no filename provided for the asset (usually from iCloud). #13671

Tested on real device with iCloud library using the library without and after my fix. It worked after my changes.

[IOS] [BUGFIX] [CameraRoll] - Changed the filename if nil to be empty when the asset is coming from iCloud.
Closes #17549

Differential Revision: D6710665

Pulled By: hramos

fbshipit-source-id: 319865b0a71728798c62ee380e7bee4af584b3e3
@facuescobar
Copy link

@pentarex was this update merged?

I can not see it in the latest version of RN

@pentarex
Copy link
Contributor

I don’t think. Check my profile for alternative library that I’ve wrote if you want

@facuescobar
Copy link

@pentarex I did the same update on my project and I think that fixed some cases.

But I'm still having errors with iCloud files, I have reported this #18159

It's being difficult to find the reason of this bug because I know that is happening for some people, but I couldn't reproduce it 🤯

if you have any idea or suggestion let me know please!

@pentarex
Copy link
Contributor

pentarex commented Mar 2, 2018

@facuescobar except the thing that I've told you, I have no other clue. Also they are using old framework for the Gallery and this is taking the pictures from iTunes, it has some strange ordering, if you want to test out this one be my guest https://github.com/pentarex/react-native-gallery-manager

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants