f-strieg / MyoUnityAndroidPlugin

Unofficial Plugin which enables you to build Unity applications for Android with Myo support
MIT License
8 stars 4 forks source link

Info: Need permission to get scan results for Android M and above #2

Open alt-ctrl-dev opened 7 years ago

alt-ctrl-dev commented 7 years ago

Add this to the AndroidManifest to make it work

<uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <permission android:name="android.permission.BLUETOOTH" android:label="BLUETOOTH" />
    <permission android:name="android.permission.BLUETOOTH_ADMIN" /> 
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
sisch commented 7 years ago

Did this really work for you? As far as I know

  1. it is enough to add either of the two location permissions.
  2. Starting from Android M these permissions need to be requested at runtime, thus adding them to the Manifest is in my experience not sufficient. I am not an Android developer, therefore I use a third party plugin at the moment and would love to see this implemented here :)
alt-ctrl-dev commented 7 years ago

@sisch it true that it requires permission, but some how it seemed to by pass that step. I have a working example that i will post the link to soon.

sisch commented 7 years ago

@reubenkcoutinho Maybe it's a matter of Unity version?! Would you share, which Unity version you are using? Are you building for API level 23(M) or 24(N). I couldn't make it work without a permission requester plugin, on Unity 5.4.2f2-GVR13 for Android Nougat (24)

IgorGanapolsky commented 7 years ago

@sisch According to these guidelines, BLUETOOTH_ADMIN is not a permission that has to be requested at runtime (i.e. dangerous permission): https://developer.android.com/guide/topics/permissions/requesting.html#normal-dangerous