npomfret / react-native-image-tools

Image editing software powered by Abode Creative SDK for iOS and Android.
171 stars 41 forks source link

The app crashes and exits after clicking the done button in the editor #3

Closed srameshr closed 7 years ago

srameshr commented 7 years ago

This is my whole of App.js. I just open up the editor as soon as the component mounts.

import React from 'react';
import { View } from 'react-native';
import RNImageTools from 'react-native-image-tools';

export default class App extends React.Component {
  async componentDidMount() {
    RNImageTools.authorize(
      'myKey',
      'mySecret',
   'my default redirect URI'
    );
    try {
      const uri = await RNImageTools.openEditor({
        imageUri: 'https://images.pexels.com/photos/205769/pexels-photo-205769.jpeg',
        outputFormat: 'PNG',
        quality: 80,
      });
    } catch (e) {
      alert(e)
      console.warn("error", e);
    }
  }
  render() {
    return (
      <View>       
      </View>
    );
  }
}

The app just crashes and exits, without any logs in the debugger console too.

srameshr commented 7 years ago

I figured out the issue. I had to add NSPhotoLibraryUsageDescription and the string describing the use case under info.plist file in ios -> YOUR_APP_NAME directory.