-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No option to use camera when uploading files on Android #283
Comments
Closed pull requests that were included in a release or just PRs waiting for attention? |
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... |
I have no idea how compatible |
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. |
Sorry, no idea. How exactly does your form code look like? And the same form works in stock Android browser? |
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. |
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 |
Can you try with a standard |
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 |
What happens if you run this code inside your Ionic apps, not inside the context of InAppBrowser? |
Adding the very basic |
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. |
InAppBrowser is a different context, there are no Cordova plugins available at all. That's why (It is only influence partly [on iOS at least] by what permissions the containing app has) |
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). |
If this is the case - but that input gives your the camera in stock browsr - this is an issue with Agree? |
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 How would I check if it is an issue with |
It may not be an issue at all - something like What I was getting at: If |
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? |
I crosslinked this one for now, let's see what we do for the migration - as the other one also has nice information. |
This problem still has no solution? I can no longer open a camera using inappbrowser. |
Was this ever resolved, i'm also having this issue. |
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. |
Hey @padders how did android studio and xcode do that? |
This seems to be a known issue previously, but using inappbrowser simply won't give me the normal options on android for uploading files in a browser form, whereas ios seems fine (once I'd added the permissions to the config.xml). I can see there are various pull requests that fix this so I suspect I'm doing something wrong.
I've tried adding various native plugins to add permissions in case that changes it, or used the config.xml to add the permissions to the androidmanifest.xml for the camera in case it's that that's stopping it but I'm never granted the permissions.
My app.module.ts is
home.ts
ionic info
plugins installed (some aren't used now, I added file, and camera to see if they added the camera permissions to the app)
I'm running the app on a Mac, using the command 'ionic cordova run android --device'
I have an unlocked Galaxy s7 in usb debug mode connected which is running the app. When I access the same webpages in the normal browser I get all the camera options I'd expect. The android version is 8.0.0, with the Samsung Experience of 9.0
The output from the debug console tells me that I have file write permissions, but not camera permissions. I also can't add that permission in the android settings as it never appears.
The text was updated successfully, but these errors were encountered: