title: React Native - Google Fit API can't get steps
body: <p>I use <strong><a href="https://github.com/StasDoskalenko/react-native-google-fit" rel="nofollow noreferrer">react-native-google-fit</a></strong> package to get the steps data about the user. In my case this package works fine in some devices but in some others cant get any data or response from the google-fit API.</p>
  <p>I cant understand what is the problem, as I know step recording api of the google-fit is not implemented in default as it is in IOS(health-kit). I implemented bugnsag to track the steps and the process stucks when I call google-fit API to get step samples. No error or exception thrown it just feels like hanging.</p>
  <p>If anyone have some idea or solution about it I would be very happy to hear.</p>
  <blockquote>
  <p>package.json</p>
  </blockquote>
  <pre><code>&quot;dependencies&quot;: {
      &quot;@bugsnag/react-native&quot;: &quot;^7.3.2&quot;,
      &quot;@react-native-community/art&quot;: &quot;^1.2.0&quot;,
      &quot;@react-native-community/async-storage&quot;: &quot;^1.8.1&quot;,
      &quot;@react-native-community/cli-platform-ios&quot;: &quot;^4.10.1&quot;,
      &quot;@react-native-community/datetimepicker&quot;: &quot;^3.0.1&quot;,
      &quot;@react-native-community/masked-view&quot;: &quot;^0.1.7&quot;,
      &quot;@react-native-community/viewpager&quot;: &quot;^4.1.0&quot;,
      &quot;@react-native-firebase/app&quot;: &quot;^7.1.0&quot;,
      &quot;@react-native-firebase/messaging&quot;: &quot;^7.1.0&quot;,
      &quot;@react-navigation/native&quot;: &quot;^5.0.9&quot;,
      &quot;@react-navigation/stack&quot;: &quot;^5.1.1&quot;,
      &quot;axios&quot;: &quot;^0.19.2&quot;,
      &quot;dayjs&quot;: &quot;^1.8.33&quot;,
      &quot;firebase&quot;: &quot;^7.14.6&quot;,
      &quot;localized-strings&quot;: &quot;^0.2.4&quot;,
      &quot;react&quot;: &quot;16.9.0&quot;,
      &quot;react-native&quot;: &quot;^0.61.5&quot;,
      &quot;react-native-device-info&quot;: &quot;^5.5.7&quot;,
      &quot;react-native-document-picker&quot;: &quot;^3.5.4&quot;,
      &quot;react-native-dots-pagination&quot;: &quot;^0.1.9&quot;,
      &quot;react-native-fs&quot;: &quot;^2.16.6&quot;,
      &quot;react-native-gesture-handler&quot;: &quot;^1.6.0&quot;,
      &quot;react-native-get-random-values&quot;: &quot;^1.3.1&quot;,
      &quot;react-native-gifted-chat&quot;: &quot;^0.16.1&quot;,
      &quot;react-native-google-fit&quot;: &quot;^0.13.0&quot;,
      &quot;react-native-highlight-words&quot;: &quot;^1.0.1&quot;,
      &quot;react-native-image-picker&quot;: &quot;^2.3.1&quot;,
      &quot;react-native-onesignal&quot;: &quot;^3.9.0&quot;,
      &quot;react-native-progress&quot;: &quot;^4.1.2&quot;,
      &quot;react-native-reanimated&quot;: &quot;^1.7.0&quot;,
      &quot;react-native-safe-area-context&quot;: &quot;^0.7.3&quot;,
      &quot;react-native-screens&quot;: &quot;^2.3.0&quot;,
      &quot;react-native-vector-icons&quot;: &quot;^6.6.0&quot;,
      &quot;react-native-video&quot;: &quot;^4.4.5&quot;,
      &quot;react-native-webview&quot;: &quot;^9.1.4&quot;,
      &quot;react-navigation&quot;: &quot;^4.2.2&quot;,
      &quot;react-navigation-stack&quot;: &quot;^2.2.3&quot;,
      &quot;react-navigation-tabs&quot;: &quot;^2.8.13&quot;,
      &quot;react-redux&quot;: &quot;^7.2.0&quot;,
      &quot;redux&quot;: &quot;^4.0.5&quot;,
      &quot;redux-logger&quot;: &quot;^3.0.6&quot;,
      &quot;redux-saga&quot;: &quot;^1.1.3&quot;,
      &quot;rn-apple-healthkit&quot;: &quot;^0.8.0&quot;
    },
  </code></pre>
  <blockquote>
  <p>android/build.gradle</p>
  </blockquote>
  <pre><code>buildscript {
      ext {
          buildToolsVersion = &quot;28.0.3&quot;
          minSdkVersion = 16
          compileSdkVersion = 28
          targetSdkVersion = 28
      }
      repositories {
          google()
          jcenter()
      }
      dependencies {
          classpath(&quot;com.android.tools.build:gradle:3.4.2&quot;)
          classpath('com.google.gms:google-services:4.3.3')
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          mavenLocal()
          maven {
              // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
              url(&quot;$rootDir/../node_modules/react-native/android&quot;)
          }
          maven {
              // Android JSC is installed from npm
              url(&quot;$rootDir/../node_modules/jsc-android/dist&quot;)
          }
  
          google()
          jcenter()
          maven { url 'https://jitpack.io' }
      }
  }
  </code></pre>
  <blockquote>
  <p>android/app/build.gradle</p>
  </blockquote>
  <pre><code>defaultConfig {
          applicationId &quot;com.xx&quot;
          minSdkVersion rootProject.ext.minSdkVersion
          targetSdkVersion rootProject.ext.targetSdkVersion
          versionCode 29
          versionName &quot;1.4.18&quot;
          multiDexEnabled true
      }
  dependencies {
      implementation project(':react-native-webview')
      implementation project(':react-native-vector-icons')
      implementation project(':react-native-fs')
      implementation 'com.google.firebase:firebase-analytics:17.2.2'
      implementation &quot;com.android.support:support-core-utils:28.0.0&quot;
      implementation &quot;com.android.support:appcompat-v7:28.0.0&quot;
      implementation fileTree(dir: &quot;libs&quot;, include: [&quot;*.jar&quot;])
      implementation &quot;com.facebook.react:react-native:+&quot; 
  </code></pre>
  <blockquote>
  <p>android.xml permissions</p>
  </blockquote>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.CAMERA&quot;/&gt;
  &lt;uses-permission android:name=&quot;android.permission.WAKE_LOCK&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.VIBRATE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.RECEIVE_BOOT_COMPLETED&quot;/&gt;
  &lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.ACTIVITY_RECOGNITION&quot;/&gt;
  </code></pre>
  <blockquote>
  <p>function that calls google-fit-api</p>
  </blockquote>
  <pre><code>function getStepsForAndroid(startDate, endDate) {
      const options = {
          startDate: new Date(startDate).toISOString(), // required ISO8601Timestamp
          endDate: new Date(endDate).toISOString() // required ISO8601Timestamp
      };
      return GoogleFit.getDailyStepCountSamples(options)
  }
  </code></pre>