Giter Site home page Giter Site logo

Comments (5)

MelanieGravel avatar MelanieGravel commented on July 18, 2024

I got the exact same error.

HKQuantityTypeIdentifier' has no member 'appleStandTime', on the Extensions.swift file

from fitkit.

softmarshmallow avatar softmarshmallow commented on July 18, 2024

Also android raises error with the same comment. STAND_TIME

from fitkit.

janosdupai avatar janosdupai commented on July 18, 2024

Same here.

PlatformException(FitKit, type stand_time is not supported, null) - on Android device. Any idea?

from fitkit.

khmurakami avatar khmurakami commented on July 18, 2024

@janosdupai
@softmarshmallow
@carlleeswanson

In the example folder it has this line,

permissions = await FitKit.requestPermissions(DataType.values);

It doesn't work on Android because Standtime is not supported. The README.md shows the supported types.

DataType.values is a List of all the possible values which includes the ones supported in iOS.

The way to go about this, is to declare a new list and then pass in these values instead for Android.

  List<DataType> androidValues = [
    DataType.ENERGY,
    //DataType.EXERCISE_TIME,
    DataType.DISTANCE,
    DataType.STEP_COUNT,
    DataType.WATER,
    DataType.WEIGHT,
    DataType.HEIGHT,
    DataType.HEART_RATE,
    //DataType.STAND_TIME,
  ];

permissions = await FitKit.requestPermissions(androidValues);

from fitkit.

krokyze avatar krokyze commented on July 18, 2024

Starting from version 1.1.2 it's advised to wrap all read methods inside try catch as FitKit.read will throw specific UnsupportedException

void read() async {
  try {
    final results = await FitKit.read(
      DataType.HEART_RATE,
      dateFrom: DateTime.now().subtract(Duration(days: 5)),
      dateTo: DateTime.now(),
    );
  } on UnsupportedException catch (e) {
    // thrown in case e.dataType is unsupported
  }
}

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.