Closed rgajadin closed 10 months ago
Unfortunately this won't be added to Xamarin.Essentials anymore. You can extend the Permissions yourself though by following this: https://learn.microsoft.com/xamarin/essentials/permissions?tabs=android#extending-permissions
Thank you!
Description
https://developer.android.com/about/versions/10/privacy/changes#physical-activity-recognition
Permissions.Sensors requests
android.permission.BODY_SENSORS
but also needsandroid.permission.ACTIVITY_RECOGNITION
for step counter and step detector sensorsSteps to Reproduce
<uses-permission android:name="android.permission.BODY_SENSORS"/> <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/>
in your manifestawait Permissions.RequestAsync<Permissions.Sensors>())
etc..var sensorManager = (SensorManager) Context.GetSystemService(Context.SensorService); var sensor = sensorManager .GetDefaultSensor(SensorType.StepDetector); sensorManager.RegisterListener(this, _sensor, SensorDelay.Normal);
Expected Behavior
I get asked to give permission to BODY_SENSORS and ACTIVITY_RECOGNITION
Actual Behavior
I only get asked to give permission for BODY_SENSORS and now the StepDetector sensor won't enable.
Basic Information
app sdk info: android:minSdkVersion="21" android:targetSdkVersion="30"
Perhaps a new permissions needs to be added?