Cap-go / capacitor-inappbrowser

Capacitor plugin in app browser with urlChangeEvent
MIT License
66 stars 48 forks source link

Camera and photo gallery won't open #64

Open CESTechDev opened 1 year ago

CESTechDev commented 1 year ago

When the embedded page has the call to open the file, nothing happens.

The process of requesting permission for the camera and files has already been completed.

riderx commented 1 year ago

Hello, can you tell me in what platform Android or IOS ?

alpargataman commented 12 months ago

Same here.

Using Android 13 and opening https://pdf.io/es/doc2pdf/, after I click "select file" nothing happens. Maybe the app needs to requests camera permissions before, or something.

riderx commented 10 months ago

Hi i think i found why can you try again with the latest version?

riderx commented 10 months ago

The previous version was functionning on some Android, now 1.2.19 should work for all

alpargataman commented 10 months ago

Doing some tests with an Android 10 phone and an Android 14 VM the file chooser still doesn't open. Playing with Github Copilot in the file WebViewDialog.java overriding WebChromeClient with the following code, I managed to open the file chooser on file inputs, but it doesn't put the file in the form.

@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback,
  FileChooserParams fileChooserParams) {
    Intent intent = fileChooserParams.createIntent();
    try {
      activity.startActivityForResult(intent, 1);
    } catch (ActivityNotFoundException e) {
      return false;
    }
  return true;
}

In the examples I've found on the internet, everyone uses an Override of onActivityResult to put the file in the form, but It can't be done on a dialog.

I'm not an expert on native Android development, so It's hard for me to find a solution.

I forgot to tell that the problem is when I try to use InAppBrowser.openWebView

iPwa97 commented 6 months ago

Doing some tests with an Android 10 phone and an Android 14 VM the file chooser still doesn't open. Playing with Github Copilot in the file WebViewDialog.java overriding WebChromeClient with the following code, I managed to open the file chooser on file inputs, but it doesn't put the file in the form.

@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback,
  FileChooserParams fileChooserParams) {
    Intent intent = fileChooserParams.createIntent();
    try {
      activity.startActivityForResult(intent, 1);
    } catch (ActivityNotFoundException e) {
      return false;
    }
  return true;
}

In the examples I've found on the internet, everyone uses an Override of onActivityResult to put the file in the form, but It can't be done on a dialog.

I'm not an expert on native Android development, so It's hard for me to find a solution.

I forgot to tell that the problem is when I try to use InAppBrowser.openWebView

i've got the same issue. Any solutions?

riderx commented 6 months ago

Can you provide a reproduction repo that will be easier for me to help on that

karen1au commented 5 months ago

I'm on version 1.4.1 and still getting the same issue, it's working on iOS

riderx commented 1 month ago

@karen1au did you added the perm in the manifest?

atsavos commented 4 weeks ago

Hello I am using inappbrowser(@capgo/inappbrowser: 6.4.4) in an ionic/capacitor app and on android (version 12) even it asks for camera permission a bottom sheet opens and tells me that the app can access only photos and the camera don't open (on iOS works as expected). I have all the permissions the documentation says on my manifest. Is there any one else having the same issue? is there any example of the correct use of the inappbrawser and this kind of permission?

riderx commented 3 weeks ago

On latest when i try on https://www.patternfly.org/components/file-upload/multiple-file-upload/ it work i can select files

riderx commented 3 weeks ago

can you provide reproduction?