Skip to content

Commit

Permalink
[sensors] Fix ios 17.4 barometer issue (#28253)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjhughes authored Apr 17, 2024
1 parent 883d0fc commit 318f022
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/expo-sensors/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### 🐛 Bug fixes

- Prevent unnecessary permissions check when moving app to background (Would crash with certain configs). ([#28045](https://github.com/expo/expo/pull/28045) by [@cltnschlosser](https://github.com/cltnschlosser))
- Fix barometer updates not starting on iOS 17.4. ([#28253](https://github.com/expo/expo/pull/28253) by [@alanjhughes](https://github.com/alanjhughes))

### 💡 Others

Expand Down
4 changes: 4 additions & 0 deletions packages/expo-sensors/ios/BarometerModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public final class BarometerModule: Module {
}

OnStartObserving {
if CMAltimeter.authorizationStatus() == .notDetermined {
CMSensorRecorder().recordAccelerometer(forDuration: 0.1)
}

altimeter.startRelativeAltitudeUpdates(to: operationQueue) { [weak self] data, _ in
guard let data else {
return
Expand Down

0 comments on commit 318f022

Please sign in to comment.