rmtmckenzie / flutter_native_device_orientation

Native device orientation plugin for flutter.
MIT License
76 stars 63 forks source link

Return error when call using useSensor:true on iOS simulator #47

Closed johnspackman closed 9 months ago

johnspackman commented 2 years ago

I can't get useSensor:true to ever work on the simulator - the NativeDeviceOrientationCommunicator. orientation never returns from it's promise and the onOrientationChanged stream never fires any events

Is this a known issue?

desmeit commented 1 year ago

Can the plugin author confirm this? useSensor is not working with simulator?

rmtmckenzie commented 1 year ago

yes, we do a check for isDeviceMotionAvailable which would return false on simulators and then the sensor data would never be read. Should probably return some sort of error though.

As sensor data is not available on simulator there's not a whole lot we could do about this unless we add an API specifically for simulators, but that doesn't seem like the greatest idea.

rmtmckenzie commented 9 months ago

I believe it should return an error on the simulator now rather than simply never returning.