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

Missing permissions on Marshmallow (api level 23) for getScanResults #49

Open
jeffcharles opened this issue Oct 26, 2015 · 5 comments
Open

Comments

@jeffcharles
Copy link

Targeting API level 23 on Android requires ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION to retrieve scan results

@hoerresb
Copy link
Owner

Thanks for bringing this to our attention. We will get that updated shortly.

@jeffcharles
Copy link
Author

The other thing I'm noticing is that the new runtime permissions model is causing an issue in that we don't have a great way of doing the check/request for permissions that Marshmallow requires. I guess it would be helpful if we could do the runtime check/request in a separate method so we have more control over the UX.

@hoerresb
Copy link
Owner

I've added ACCESS_COARSE_LOCATION in the most recent update. I will look into ways of doing a check/request permissions. Thanks

@Vincent-Noben
Copy link

Vincent-Noben commented Apr 28, 2016

I think I have the same or a related problem.
First I do the startScan function and it's succes callback fires.
After a few seconds I manually run the getScanResults function with a button, but that always gives me an empty array, although enough wifi signals are present nearby. Might this be related to permissions problem mentiond in this issue?

Working with CyanogenOS 13 (Marshmallow) on my Oneplus One

EDIT:
The androidmanifest.xml looks like this. So Permissions seem to be set correctly?

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0.0" package="be.vincentnoben.wifimap" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:supportsRtl="true">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
</manifest>

@jimcortez
Copy link

I created PR #77 that addresses this issue. It uses the compat cordova library to request the permission if it does not exist.

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

4 participants