From e114df601056bf247d661127b67f5bea9276b09b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Sousa?= Date: Wed, 4 Oct 2023 17:27:31 -0300 Subject: [PATCH] fix: step counter module backward compatibility --- android/src/main/java/com/stepcounter/StepCounterModule.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/android/src/main/java/com/stepcounter/StepCounterModule.kt b/android/src/main/java/com/stepcounter/StepCounterModule.kt index fb0740b..238ee90 100644 --- a/android/src/main/java/com/stepcounter/StepCounterModule.kt +++ b/android/src/main/java/com/stepcounter/StepCounterModule.kt @@ -80,6 +80,7 @@ class StepCounterModule internal constructor(context: ReactApplicationContext) : * @see VERSION_CODES.KITKAT * @see WritableMap */ + @ReactMethod override fun isStepCountingSupported(promise: Promise) { Log.d(TAG_NAME, "hardware_step_counter? $supported") Log.d(TAG_NAME, "step_counter granted? $stepsOK") @@ -98,6 +99,7 @@ class StepCounterModule internal constructor(context: ReactApplicationContext) : * Start the step counter sensor. * @param from the number of steps to start from */ + @ReactMethod override fun startStepCounterUpdate(from: Double) { stepCounterListener = stepCounterListener ?: if (stepsOK) { StepCounterService(this, sensorManager) @@ -112,6 +114,7 @@ class StepCounterModule internal constructor(context: ReactApplicationContext) : * Stop the step counter sensor. * @return Nothing. */ + @ReactMethod override fun stopStepCounterUpdate() { Log.d(TAG_NAME, "stopStepCounterUpdate") stepCounterListener!!.stopService() @@ -121,6 +124,7 @@ class StepCounterModule internal constructor(context: ReactApplicationContext) : * Keep: Required for RN built in Event Emitter Support. * @param eventName the name of the event. usually "stepCounterUpdate". */ + @ReactMethod override fun addListener(eventName: String) {} /** @@ -128,6 +132,7 @@ class StepCounterModule internal constructor(context: ReactApplicationContext) : * @param count the number of listeners to remove. * not implemented. */ + @ReactMethod override fun removeListeners(count: Double) {} /**