Skip to content

Commit

Permalink
Fixed issue #4 thanks to @GwonHyeok
Browse files Browse the repository at this point in the history
  • Loading branch information
Flucadetena committed Jul 10, 2024
2 parents 3dee6bd + b071e14 commit dc76ab9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions android/src/main/kotlin/com/example/pedometer_2/ReadSteps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ fun getSteps(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding, startTime
if (hasMinPlayServices != ConnectionResult.SUCCESS) {
// Prompt user to update their device's Google Play services app and return
result.error("2", "Min playService version error", "${LocalRecordingClient.LOCAL_RECORDING_CLIENT_MIN_VERSION_CODE} is required, but found a lower version")
return
}

Log.d(TAG, "ActivityCompat: ${ActivityCompat.checkSelfPermission(context, Manifest.permission.ACTIVITY_RECOGNITION)}")
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACTIVITY_RECOGNITION) != PackageManager.PERMISSION_GRANTED) {
result.error("2", "Permissions have not been requested", Exception())
return
}
Log.d(TAG, "localRecordingClient:")
localRecordingClient.subscribe(LocalDataType.TYPE_STEP_COUNT_DELTA)
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pedometer_2
description: Pedometer & Step Detection. Get step count in a timeRange & stream live steps.
version: 5.0.3
version: 5.0.4

repository: https://github.com/Flucadetena/pedometer_2
issue_tracker: https://github.com/Flucadetena/pedometer_2/issues
Expand Down

0 comments on commit dc76ab9

Please sign in to comment.