iOS issue using Accelerometer - Feature Not Supported

Grime 786 Reputation points
2021-02-18T09:26:12.15+00:00

The Xamarin Essentials accelerometer setting here works fine on Android and is published. It also work fine deployed directly to my iPhone 11, but doesn't work on two tested simulators:

        protected override async void OnAppearing()  
        {  
            Accelerometer.ShakeDetected += this.OnShaked;  
            Accelerometer.Start(SensorSpeed.Default);  
  
            base.OnAppearing();  
            await fvm.GetFarts();  
            FartListView.ItemsSource = fvm.FartList;  
        }  

69448-screen-shot-2021-02-18-at-71609-pm.png

Any help greatly appreciated.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,288 questions
0 comments No comments
{count} votes

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 67,781 Reputation points Microsoft Vendor
    2021-02-18T10:59:35.747+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    You can't test it using simulator, you should use real device for testing accelerometer.

    69438-image.png

    Here is Apple's document about testing on the iOS Simulator.

    https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/iOS_Simulator_Guide/TestingontheiOSSimulator/TestingontheiOSSimulator.html

    Best Regards,

    Leon Lu


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful