File upload through a webview (iOS)


#1

Hi,
I have an expo app with a webview inside it. I’m trying to upload an image through the webview. Is this possible?
In my component with the webview I’m asking for permissions like so

state = {
    hasCameraPermission: false
  };

  async componentWillMount() {
    const { status } = await Permissions.askAsync(Permissions.CAMERA_ROLL);
    this.setState({ hasCameraPermission: status === 'granted' });
  }

I’ve also put this in my app.json though I’m not sure if it’s necessary:

"infoPlist": {
    "NSPhotoLibraryUsageDescription":
      "We need  access to your camera roll."
  }

But I’m not entirely sure what to do next once permission has been granted.
When I run it in the emulator I’m getting the modal requesting for permissions. I grant it permissions but when I try to upload an image, I select an image from the camera roll but it never uploads it.
Thanks!


closed #2

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.