Is Expo Pedometer supported on Android?

前端 未结 2 1591
难免孤独
难免孤独 2021-01-06 11:12

I\'m setting up a Pedometer app in React Native using Expo, testing the code on my real Samsung s10 device.

I am using the Expo Pedometer documentation

Howev

相关标签:
2条回答
  • 2021-01-06 11:47

    I did something nasty as a workaround but it worked I added expo 33 as a legacy npm dependency and use only the pedometer module from there because currently they didn't implemented the pedometer functionality on android on the new Expo unimodules

    package.json

    "expo": "^35.0.0",
     "expo-legacy": "npm:expo@33.0.0",
    

    And use it like this

    import {Pedometer} from 'expo-legacy'

    Surprisingly compiled and only increased 200kb the apk size

    0 讨论(0)
  • 2021-01-06 11:52

    Yes, by using Core Motion (iOS) or Google Fit (Android) to get the user's step count. Any Android phone running on a 4.4 (KitKat) operating system or later will connect with Google Fit.

    Pedometer unable to query steps, documentation unclear/contradictory.

    0 讨论(0)
提交回复
热议问题