Giter VIP home page Giter VIP logo

react-native-universal-pedometer's People

Contributors

ejsp92 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-universal-pedometer's Issues

Trouble when building for iOS after install through npm

Hello,

I'm pretty new to React Native, I have tried to install react-native-universal-pedometer several times with npm ("npm react-native-universal-pedometer" then "react-native link", and also link Binary With Librairies using "libBMDPedometer.a" in XCode), but I didn't succeed.
When running though iOS simulator, I got this error:

error: bundling failed: ambiguous resolution: module /myreactnativeproject/index.js tries to require react-native, but there are several files providing this module. You can delete or fix them:

  • /myreactnativeproject/node_modules/react-native-universal-pedometer/node_modules/react-native/package.json
  • /myreactnativeproject/node_modules/react-native/package.json

I have tried to remove the "react-native" dependency from the package.json in the "react-native-universal-dependency" directory, but it throws an error.

Have you got any idea on how to solve this? Thanks!

Native module cannot be null

After installing it with yard add and linking through react-native link. It still works fine on android. If I comment import Pedometer from 'react-native-universal-pedometer', it loads, and if I uncomment it, it throws an error Native module cannot be null. I tried reinstalling it, didn't work.

StartDate and EndDate timestamp size

In BMDPedometerModule.java since you are using startAt as long, which is logic because you are using currentTimeMillis method, also should return a long. The issue is that map.putInt("startDate", (int)this.startAt); simplifies the startAt value, giving a wrong value when the object is returned in javascript.

Query Pedometer Data Between Dates

I used these lines of code in my app for getting Steps.

import Pedometer from 'react-native-universal-pedometer';

Pedometer.isStepCountingAvailable((error, isAvailable) => {
      if (isAvailable) {
    const startDate = new Date();
    startDate.setHours(0, 0, 0, 0);
    const endDate = new Date();
    Pedometer.queryPedometerDataBetweenDates(
      startDate.getTime(),
      endDate.getTime(),
      pedometerData => {
        console.log(pedometerData);
      },
    );
      } else {alert("error")}
    });

pedometerData always return
{"distance": 0, "endDate": -62508770, "numberOfSteps": 0, "startDate": 0}

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.