OvalMoney / react-native-fitness

A React Native module to interact with Apple Healthkit and Google Fit.
MIT License
343 stars 68 forks source link

Android getSteps error #29

Closed lftfld closed 4 years ago

lftfld commented 4 years ago

First, thanks for writing this module. works great on iOS.

my code . . . const dates = { startDate: new Date(before).toISOString(), endDate: new Date().toISOString(),interval:"days"} await Fitness.getSteps(dates).then(result => { healthIsAvailable = true; stepsWeek = result; stepsToday = result[result.length-1].quantity; return }) .catch((error) => { console.log("getStepserror",error); }); . . .

I get an error on Android "Fitness.getSteps got 4 arguments, expected 5"

Anya ideas why? there are no more arguments to send is there?

Log from Android Studio:

01-14 11:38:31.835 14328-14390/se.act4yourheart E/unknown:ReactNative: Exception in native call com.facebook.react.bridge.NativeArgumentsParseException: Fitness.getSteps got 4 arguments, expected 5 at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:348) at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:150) at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:26) at android.os.Looper.loop(Looper.java:148) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:225) at java.lang.Thread.run(Thread.java:818)

Francesco-Voto commented 4 years ago

which version do you have? Can you try with the last one?

lftfld commented 4 years ago

Thanks for your reply, I forgot to update. It turned out the error came from me having the wrong keystore. Everything worked out fine after that. Would be great if you could update that error message. Thanks!

Francesco-Voto commented 4 years ago

Perfect!

Thank you for the feedback