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 not returning iCloud photos #21836

Closed
3 tasks done
marioharper opened this issue Oct 17, 2018 · 2 comments
Closed
3 tasks done

CameraRoll.getPhotos not returning iCloud photos #21836

marioharper opened this issue Oct 17, 2018 · 2 comments
Labels
API: CameraRoll Bug Resolution: Locked This issue was locked by the bot.

Comments

@marioharper
Copy link

marioharper commented Oct 17, 2018

Environment

Environment:
  OS: macOS High Sierra 10.13.5
  Node: 8.12.0
  Yarn: 1.7.0
  npm: 6.4.1
  Watchman: 4.9.0
  Xcode: Xcode 9.4.1 Build version 9F2000
  Android Studio: 3.1 AI-173.4720617

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz => 0.55.4

Description

Related #1579, #17532.

Currently RN is using ALAsset which is deprecated from iOS 8. RN should use the Photos framework instead, which in iOS 8.0 and later provides more features and better performance for working with a user’s photo library. I am currently experiencing issues with retrieving iCloud photos from CameraRoll.

Photos App - All Photos

simulator screen shot - iphone 6 - 2018-10-17 at 15 46 53

CameraRoll.getPhotos

simulator screen shot - iphone 6 - 2018-10-17 at 15 47 12

Reproducible Demo

Have iCloud integrated and "Optimize iPhone Storage" enabled. Then in your emulator Trigger iCloud Sync via the Debug menu. Then run the snippet below. You would expect to see all of your images you can view in the iPhone Photos app under All Photos rendered, however, it only shows some of your images.

import React from 'react';
import { Image, CameraRoll, FlatList } from 'react-native';

export default class CameraRollTest extends React.Component {
  state = {
    photos: []
  };

  componentDidMount = async () => {
    const result = await CameraRoll.getPhotos({
      first: 1000,
      groupTypes: 'All'
    });

    this.setState({
      photos: result.edges
    });
  };

  render() {
    return (
      <FlatList
        numColumns={3}
        data={this.state.photos}
        keyExtractor={item => item.node.image.uri}
        renderItem={({ item }) => (
          <Image
            style={{ width: 100, height: 100 }}
            source={{
              uri: item.node.image.uri
            }}
          />
        )}
      />
    );
  }
}
@marioharper
Copy link
Author

related: #20462

@bartolkaruza
Copy link

Same as #20462 I think this issue is resolved, if not, let's open it up again on the new CameraRoll home.

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

No branches or pull requests

4 participants