GithubHelp home page GithubHelp logo

Comments (23)

janpio avatar janpio commented on June 20, 2024 1

I have no idea how compatible cordova-plugin-inappbrowser-camera is to the regular cordova-plugin-inappbrowser. Ionic Native that you are using to use the InAppBrowser plugin is tightly coupled to the plugin's API, so if this one has a different one you might experience problems.

from cordova-plugin-inappbrowser.

padders avatar padders commented on June 20, 2024 1

Hi Guys, I didn't get it resolved unfortunately. I rebuilt my app inside Android Studio and Xcode as it was an easier method of making this feature work on all devices.

from cordova-plugin-inappbrowser.

janpio avatar janpio commented on June 20, 2024

I can see there are various pull requests that fix this so I suspect I'm doing something wrong.

Closed pull requests that were included in a release or just PRs waiting for attention?

from cordova-plugin-inappbrowser.

padders avatar padders commented on June 20, 2024

Ah, looks like I might have confused myself. It was this that I saw

https://github.com/jverlee/cordova-plugin-inappbrowser-camera

I have now tried to install that version, but using Ionic I run into issues installing it at all, it just throws errors every time.

Maybe there is an issue with this release regarding camera usage on android then? I still suspect I'm not quite getting the config or permissions right in some way...

from cordova-plugin-inappbrowser.

padders avatar padders commented on June 20, 2024

Yeah, The error suggested that cordova-plugin-inappbrowser-camera was incorrectly configured. I couldn't get it to run at all with that version so I suspect you're right.

The standard inappbrowser works fine, other than not allowing me access to the camera when uploading files on a site. Any idea if I need to use the permissions or config differently to allow this functionality? It works fine on Ios.

from cordova-plugin-inappbrowser.

janpio avatar janpio commented on June 20, 2024

cordova-plugin-inappbrowser-camera say in its README it merged a PR, but that one is also merged here now - so maybe this is not even useful any more.

Any idea if I need to use the permissions or config differently to allow this functionality?

Sorry, no idea.

How exactly does your form code look like? And the same form works in stock Android browser?

from cordova-plugin-inappbrowser.

padders avatar padders commented on June 20, 2024

It's a fairly standard drop zone using dropzone.js. When I use it in the standard browser it pops up a permissions warning, then if I accept it lets me choose from camera, mic, video and files. That's what lead me to believe it was a permissions issue. However, If I add a specific camera function to the app it does let me use the camera, but still doesn't grant me those options using inappbrowser. The same thing happens on the demo site below using their demo uploader.

https://www.dropzonejs.com/

from cordova-plugin-inappbrowser.

padders avatar padders commented on June 20, 2024

Just checking it with another site https://uppy.io/examples/dashboard/ and I get the same thing, it asks me to grant permissions from their site when using a camera, but not in the standard browser

from cordova-plugin-inappbrowser.

janpio avatar janpio commented on June 20, 2024

Can you try with a standard <input>? Just to confirm a baseline.

from cordova-plugin-inappbrowser.

padders avatar padders commented on June 20, 2024

Sure, using the w3schools demo below, the same thing happens. I'm sure it's permissions related. The app you create doesn't have camera permissions listed in the android settings menu, so it's never going to gain camera access even though I request it at runtime.

https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_fileupload_get

from cordova-plugin-inappbrowser.

janpio avatar janpio commented on June 20, 2024

What happens if you run this code inside your Ionic apps, not inside the context of InAppBrowser?

from cordova-plugin-inappbrowser.

padders avatar padders commented on June 20, 2024

Adding the very basic <input type="file" id="myFile"> to the home.html does the same thing. Just gives me a file upload with no other options. I suspect ionic plugins being used correctly might give me a better version, I'll have a look.

from cordova-plugin-inappbrowser.

padders avatar padders commented on June 20, 2024

Adding a very basic button to take a picture using https://ionicframework.com/docs/native/media-capture/ works, but within inappbrowser it still doesn't give me an option to takes pictures when uploading a file. Ionic can definitely access the camera on my phone, but inappbrowser doesn't seem to be able to.

from cordova-plugin-inappbrowser.

janpio avatar janpio commented on June 20, 2024

InAppBrowser is a different context, there are no Cordova plugins available at all. That's why cordova-plugin-media-capture can do stuff inside the app, but not inside InAppBrowser.

(It is only influence partly [on iOS at least] by what permissions the containing app has)

from cordova-plugin-inappbrowser.

padders avatar padders commented on June 20, 2024

Yeah, makes sense. That's why I tried to add permissions using cordova-plugin-android-permissions but it never grants me access. I always get file write access which I think apps get by default, but never camera (or anything else I try to request).

from cordova-plugin-inappbrowser.

janpio avatar janpio commented on June 20, 2024

Adding the very basic to the home.html does the same thing. Just gives me a file upload with no other options.

If this is the case - but that input gives your the camera in stock browsr - this is an issue with cordova-android, not this plugin. Because only if it works in your web app itself in Cordova, it can theoretically work in InAppBrowser as well.

Agree?

from cordova-plugin-inappbrowser.

padders avatar padders commented on June 20, 2024

To be honest. I genuinely don't know. It seems to be a permissions issue in some way, but I don't know where that problem originates. Having changed from cordova-plugin-android-permissions to cordova.plugins.diagnostic (using the guide here https://pointdeveloper.com/ionic-requesting-permissions-run-time/ ) I can now get the camera permissions when I open inappbrowser... I still don't get the option to use it when uploading a file though.

How would I check if it is an issue with cordova-android?

from cordova-plugin-inappbrowser.

janpio avatar janpio commented on June 20, 2024

It may not be an issue at all - something like cordova-plugin-media-capture might exist because it is just not possible at all in Cordova context.

What I was getting at: If <input type="file" id="myFile"> doesn't work even in the web app run in cordova-android, it is very much not surprising that it also doesn't work in InAppBrowser. So to investigate more, it would make sense to move on from InAppBrowser, over to cordova-android. If you can get it working there (without using cordova-plugin-media-capture for example), it should be possible to get it working in InAppBrowser as well.

from cordova-plugin-inappbrowser.

jcesarmobile avatar jcesarmobile commented on June 20, 2024

It's a duplicate of https://issues.apache.org/jira/browse/CB-13652, but as we are migrating to github, maybe we should close that one and keep this one?

from cordova-plugin-inappbrowser.

janpio avatar janpio commented on June 20, 2024

I crosslinked this one for now, let's see what we do for the migration - as the other one also has nice information.

from cordova-plugin-inappbrowser.

jeffersonveloso avatar jeffersonveloso commented on June 20, 2024

This problem still has no solution? I can no longer open a camera using inappbrowser.

from cordova-plugin-inappbrowser.

nayrl avatar nayrl commented on June 20, 2024

Was this ever resolved, i'm also having this issue.

from cordova-plugin-inappbrowser.

MarcusRhodes avatar MarcusRhodes commented on June 20, 2024

Hey @padders how did android studio and xcode do that?

from cordova-plugin-inappbrowser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.