React-native-image-crop-picker: Nothing Happens on IOS

Created on 14 Feb 2019  路  3Comments  路  Source: ivpusic/react-native-image-crop-picker

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.22.0
  • react-native v0.55.4

Platform

Tell us to which platform this issue is related

  • iOS

Expected behaviour

Podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'equesteo' do
  pod 'Firebase/Core', '~> 5.3.0'
  pod 'Firebase/Messaging'
  pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
  pod 'Mixpanel'

  # from https://github.com/ivpusic/react-native-image-crop-picker
  rn_path = '../node_modules/react-native'
  pod 'RNImageCropPicker', :path =>  '../node_modules/react-native-image-crop-picker'

  # from https://github.com/oblador/react-native-vector-icons
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

  pod 'RNSVG', :path => '../node_modules/react-native-svg'

  pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
  pod 'React', path: rn_path, subspecs: [
    'Core',
    'CxxBridge',
    'DevSupport',
    'RCTActionSheet', #
    'RCTAnimation', #
    'RCTBlob', #
    'RCTCameraRoll', #
    'RCTGeolocation', #
    'RCTImage', #
    'RCTLinkingIOS', #
    'RCTNetwork', #
    'RCTPushNotification', #
    'RCTSettings', #
    'RCTText', #
    'RCTVibration', #
    'RCTWebSocket', #
    'RCTLinkingIOS' #
  ]

  pod 'react-native-mapbox-gl', :path => '../node_modules/@mapbox/react-native-mapbox-gl'

  # React Native third party dependencies podspecs
  pod 'DoubleConversion', :podspec => "#{rn_path}/third-party-podspecs/DoubleConversion.podspec"
  pod 'glog', :podspec => "#{rn_path}/third-party-podspecs/glog.podspec"

  pod 'react-native-camera', :path => '../node_modules/react-native-camera'

  pod 'react-native-webview', :path => '../node_modules/react-native-webview'

end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end
  end
end

I call:

  createPhoto() {
    ImagePicker.openPicker({
      width: 1080,
      height: 1080,
    }).then(image => {
      alert('then')
      this.props.createPhoto(image.path)
    }).catch((e) => {
      alert('catch')
      logDebug('broke', 'broke')
    })
  }

and it runs, or the catch block gets called

Actual behaviour

On Android, works fine. On iPhone, nothing.

Steps to reproduce

1.

2.

3.

Attachments

No errors are thrown or anything is logged in the console. Just, nothing happens.

Most helpful comment

So many hours later, figured it out! I'm using react-native-navigation, and migrated from v1 to v2 at some point. There were lines left over in AppDelegate.m that I didn't remove.

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor = [UIColor whiteColor];

Took those out and whammo, works.

All 3 comments

I have uninstalled and reinstalled a dozen times. I don't know iOS, really, but I'm trying to step through that code. It gets called, it does all the things I would expect, but the QBImagePicker never shows up on the screen, and the promise never resolves or rejects.

So many hours later, figured it out! I'm using react-native-navigation, and migrated from v1 to v2 at some point. There were lines left over in AppDelegate.m that I didn't remove.

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor = [UIColor whiteColor];

Took those out and whammo, works.

glad to hear you figured it out

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DISKONEKTeD picture DISKONEKTeD  路  3Comments

Phenek picture Phenek  路  3Comments

victorwpbastos picture victorwpbastos  路  3Comments

fmcruz picture fmcruz  路  3Comments

althurzard picture althurzard  路  3Comments