crossgeeks / devicesensorsplugin Goto Github PK
View Code? Open in Web Editor NEWDevice Sensors Notification Plugin for Xamarin, Tizen and Windows
License: MIT License
Device Sensors Notification Plugin for Xamarin, Tizen and Windows
License: MIT License
Hey,
I've been using this plugin in my Xamarin app and it works fine on Android. I was having problems with iOS where the StartListening call would just crash silently. I couldn't get your project to restore properly in my solution so I just took your code and added it in to test what the problem was.
I am calling the StartReading function on the Accelerometer from a System.Timers.Timer.Elapsed callback, meaning there's no NSOperationQueue.CurrentQueue since this value only reflects the operation queue that launched the opration. This causes a silent crash and doesn't provide any feedback from your plugin.
I would make the change and make a PR, but as mentioned above the project is not restoring in my solution (which contains .netstandard2 libs) and I don't want to submit PR not tested by me.
I fixed the problem by just using NSOperation.MainQueue instead of CurrentQueue and the reading works again, just as a workaround for now.
Suggestions:
If I missed anything and it's my code causing the issue you can just close this.
I hope this helps
does it work in background on both ios and android ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.