Giter Site home page Giter Site logo

Comments (5)

cubuspl42 avatar cubuspl42 commented on August 17, 2024 2

@Feduch I think that it's really not obvious that this snippet is required for FitKit to work on Android phones! Why isn't this logic part of FitKit.requestPermissions or another helper method, let's say FitKit.requestSystemPermissions?

At very least it should be explicitly documented in the README that such snippet is required, or even included in the example code!

from fitkit.

LaxmikanthMadhyastha avatar LaxmikanthMadhyastha commented on August 17, 2024 1

I am also facing this issue after changing the targetSdkVersion and compileSdkVersion to 29 and I think this is something to do with new privacy changes in the new Android 10. More info on the below link.

https://developer.android.com/about/versions/10/privacy/changes#physical-activity-recognition

I was able to solve this by manually asking the permission for ACTIVITY_RECOGNITION using permission handler package and also added below line to AndroidManifest.xml file

<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />

Is there any way the fitkit package can handle this?

from fitkit.

Feduch avatar Feduch commented on August 17, 2024 1

Hi!

I using this package, for manually asking the permission.

https://pub.dev/packages/permission_handler

from fitkit.

Feduch avatar Feduch commented on August 17, 2024

Hi!

Code how you can request access to activity on 10 android.

    if (Platform.isAndroid) {
      var androidInfo = await DeviceInfoPlugin().androidInfo;
      int sdkInt = androidInfo.version.sdkInt;

      if (sdkInt > 28) {
        bool activityRecognitionStatus =
            await Permission.activityRecognition.status.isGranted;

        if (!activityRecognitionStatus) {
          if (await Permission.activityRecognition.request().isGranted) {}
        }
      }
    }
  }`

from fitkit.

krokyze avatar krokyze commented on August 17, 2024

@Feduch @cubuspl42 you're always welcome to make a PR with changes.

from fitkit.

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.