Giter VIP home page Giter VIP logo

Comments (4)

dbalatoni13 avatar dbalatoni13 commented on July 18, 2024 1

I figured out that only the location permission needs to be actually prompted and I found the guides for that.

from config-plugins.

petrusek avatar petrusek commented on July 18, 2024

@kabiskac is it required to add some (own) code to request the location permissions or does expo / react-native-ble-plx handle the request when it is required?
For iOS it requested the bluetooth permission at the moment I started using it ... without any extra code.
For Android it doesn't request anything and it fails with "no permission".

Could you please post a link to the guide you found for that? Is it possible to request only bluetooth permission with a fallback to location on older SDKs? Or is location still required for all (new) Androids?

from config-plugins.

EvanBacon avatar EvanBacon commented on July 18, 2024

@petrusek this plugin simply configures the native static permissions, you may find more useful API resources in the react-native-ble-plx repo.

from config-plugins.

petrusek avatar petrusek commented on July 18, 2024

Thank you @EvanBacon ... I will experiment with some code I found here https://github.com/PolideaPlayground/SensorTag/blob/master/src/Saga.js#L127 (linked from the ble-plx repo). I just wasn't sure if there is no documentation for it.

Btw. starting from API level 31 it seems it won't be necessary to request location permissions, so it would be great if the plugin would be able to also add this (maybe based on some params):

    <uses-permission android:name="android.permission.BLUETOOTH_SCAN"
                     android:usesPermissionFlags="neverForLocation" />

I guess also my runtime code requesting the permission will need to be aware of the API level (Platform.Version) to request the correct permission - fine location or scan (https://reactnative.dev/docs/permissionsandroid#permissions-that-require-prompting-the-user).

from config-plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.