jeanpan / react-native-camera-roll-picker

📷 A React Native component providing images selection from camera roll
https://www.npmjs.com/package/react-native-camera-roll-picker
MIT License
423 stars 176 forks source link

My app drops when rendering CameraRollPicker #31

Closed MiyazakiKaito closed 7 years ago

MiyazakiKaito commented 7 years ago

My app drops when rendering CameraRollPicker. Show my code below. Is something wrong?

"react": "15.4.1",
"react-native": "0.39.2",
"react-native-camera-roll-picker": "^1.1.9"
import React, { Component } from 'react'
import CameraRollPicker from 'react-native-camera-roll-picker'

class CameraRollView extends Component {
  constructor(props) {
    super(props)
    this.state = { images: [] }
  }

  render() {
    return (
      <CameraRollPicker
        selected={this.state.images}
        callback={(images) => this.setState({ images })}
      />
    )
  }
}
MiyazakiKaito commented 7 years ago

I solved this problem. I must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data in my app's Info.plist. More description: https://developer.apple.com/library/prerelease/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW1