React-native-permissions: Not working on android 23

Created on 4 Oct 2017  路  7Comments  路  Source: zoontek/react-native-permissions

Hey! First of all thanks for making this module. I just wanted to let you know that I was testing it on android 23 API. I removed permission for geolocation on my device but my app still says authorized when I check for location permission with Permissions.check('location'). I even then turned off geolocation just to check if this library would check that instead of the actual permission but it still says authorized. Wondering if I'm doing wrong or the library doesn't support the version of android I'm using.

Most helpful comment

Found the issue. In build.gradle I was using targetSdkVersion 22, needs to be 23.

android {
    compileSdkVersion 23  <-- use 23
    buildToolsVersion "23.0.1"  <-- use 23

    defaultConfig {
        applicationId "xx.yy.zz"
        minSdkVersion 16
        targetSdkVersion 23 <-- use 23
        versionCode 49
        versionName "2.1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }

All 7 comments

Same issue, testing on Android 6.0.1 api 23

"react-native-permissions": "^1.0.1"

Permissions.check('camera')

Found the issue. In build.gradle I was using targetSdkVersion 22, needs to be 23.

android {
    compileSdkVersion 23  <-- use 23
    buildToolsVersion "23.0.1"  <-- use 23

    defaultConfig {
        applicationId "xx.yy.zz"
        minSdkVersion 16
        targetSdkVersion 23 <-- use 23
        versionCode 49
        versionName "2.1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }

@fbacker Yes. I will add it to the README.md
EDIT: Done!

i am still getting with targetSdkVersion 23 as authorized why??

Same here still getting always authorized with targetSdkVersion 23. @TheCodeTalker did you get any solution?

i think i went native side to to give me bool value for auth or not (by bridge)

some thing like this @ReactMethod public void isLocationEnabled(Promise promise) { if (lm != null) { promise.resolve(lm.isProviderEnabled(LocationManager.GPS_PROVIDER) || lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER)); } else { promise.reject("-1", "get location manager fail"); } }

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Daavidaviid picture Daavidaviid  路  18Comments

haveamission picture haveamission  路  19Comments

jessiealbarian picture jessiealbarian  路  43Comments

ozturkilgim picture ozturkilgim  路  31Comments

iegik picture iegik  路  19Comments