You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Darryl Pogue <da...@dpogue.ca> on 2016/06/14 23:34:35 UTC

Android 6 permission prompts for Web APIs

Hey folks (in particular Joe),

While cordova-android 5.x gives plugin developers the tools needed for
prompting for runtime permissions on Android 6, there's a gap where
some natively supported web APIs fail to prompt for permission.

Geolocation is one example, but the plugin handles that case for us.
Other cases that people are running into are the camera and audio
permissions needed for APIs like getUserMedia(). In those cases, even
if the permissions are listed in the AndroidManifest, users need to go
into the settings app and manually enable those permissions for the
app before some JS APIs will work.

Apparently this was also an issue for some of the Chrome team's
internal testing apps, and they created a workaround that prompts for
runtime permissions when the WebChromeClient permission request
callback is called. The relevant diff is here:

https://chromium.googlesource.com/chromium/src/+/6a9ad501c3588013cb435b64f6d3525a061a8f09%5E%21/#F1

Is this something that we would be interested in adding to the
cordova-android platform?

~Darryl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: Android 6 permission prompts for Web APIs

Posted by Joe Bowser <bo...@gmail.com>.
It should be added as a plugin, similar to Geolocation for consistency.  I
don't want to try adding it to core again because that turned out to be a
bad idea since we don't know which webview we're running.

On Tue, Jun 14, 2016, 4:34 PM Darryl Pogue <da...@dpogue.ca> wrote:

> Hey folks (in particular Joe),
>
> While cordova-android 5.x gives plugin developers the tools needed for
> prompting for runtime permissions on Android 6, there's a gap where
> some natively supported web APIs fail to prompt for permission.
>
> Geolocation is one example, but the plugin handles that case for us.
> Other cases that people are running into are the camera and audio
> permissions needed for APIs like getUserMedia(). In those cases, even
> if the permissions are listed in the AndroidManifest, users need to go
> into the settings app and manually enable those permissions for the
> app before some JS APIs will work.
>
> Apparently this was also an issue for some of the Chrome team's
> internal testing apps, and they created a workaround that prompts for
> runtime permissions when the WebChromeClient permission request
> callback is called. The relevant diff is here:
>
>
> https://chromium.googlesource.com/chromium/src/+/6a9ad501c3588013cb435b64f6d3525a061a8f09%5E%21/#F1
>
> Is this something that we would be interested in adding to the
> cordova-android platform?
>
> ~Darryl
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>