Skip to content
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

[Android] Updates needed for SDK 23 (Android 6) #110

Open
barryvdh opened this issue Mar 30, 2016 · 8 comments
Open

[Android] Updates needed for SDK 23 (Android 6) #110

barryvdh opened this issue Mar 30, 2016 · 8 comments

Comments

@barryvdh
Copy link

In Android 6, the permissions model has changed. Currently, the library (and sample application) fails to work in the foreground when using targetSdkVersion23 (The default version in the current Cordova 6.1) and always fails in the background on Android 6. The following error occurs:

Permission denial: Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to get scan results

This is described in detail here: http://developer.radiusnetworks.com/2015/09/29/is-your-beacon-app-ready-for-android-6.html

[..] Background scanning for bluetooth devices in Android 6.0, including beacons, now requires either android.permission.ACCESS_FINE_LOCATION or android.permission.ACCESS_COARSE_LOCATION.
This means that apps to be installed on Android 6.0 devices that want to discover beacons in the background must make changes. Apps must declare one of these location permissions in AndroidManifest.xml. This is true even for legacy apps that don't target SDK 23 used for Android Marshmallow.
What's more, these permissions follow the new runtime model. This means that apps that target SDK 23 must also prompt the user for a location permission after the app is launched.

Temporary workaround for Android 6:

  • Downgrade to android:targetSdkVersion="22" in your AndroidManifest.xml
  • Require the android.permission.ACCESS_COARSE_LOCATION and/or android.permission.ACCESS_FINE_LOCATION permissions in your AndroidManifest.xml
@barryvdh
Copy link
Author

Initial implementation: #111

@barryvdh
Copy link
Author

Not sure if the plugin allows background scanning, but in that case the location permission needs to be added to function on Android 6, regardless of sdk version.

@barryvdh
Copy link
Author

Did some more digging, seems that SDK supports this, starting with 0.9.4.

https://github.com/Estimote/Android-SDK/blob/master/CHANGELOG.md#094-october-30-2015

This release features support for Android Marshmallow runtime permissions and helps you meet all the requirements necessary for beacon detection (Bluetooth, Location, runtime permissions).

And the SystemRequirementsChecker can be used to ask for permissions etc.

@oriefrati
Copy link

Hi,
you are doing a great job investigating this issue.
but it seems that this repository are not maintained.
we can fork, and push new updates for this helpful plugin.

@barryvdh
Copy link
Author

I asked them on Twitter. Would like it better when they fix this. I don't currently need to support the latest SDK yet, but if they don't respond I guess we'll have to fork indeed.

@oriefrati
Copy link

of course, i also sent mail to them long time ago, because in the new android SDK there is secure UUID feature, and i need it.
currently i try to learn how to create or change phonegap plugin to support the new iOS & android SDKs

@barryvdh
Copy link
Author

Following my conversation on Twitter (https://twitter.com/barryvdh/status/715451991263223808) it seems that https://github.com/petermetz/cordova-plugin-ibeacon is the preferred version.
Not sure if that helps in your case with secure uuid, but it does for me..

@gokr
Copy link

gokr commented Oct 4, 2016

Yes, sadly we don't have the time to maintain this plugin. We recommend using the iBeacon plugin by Peter Metz, which works nicely with Estimote beacons. This plugin can be found here: https://github.com/petermetz/cordova-plugin-ibeacon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants