I have a Xamarin Forms project for iOS and Android. I am using a bluetooth diagnostic adapter to connect to a vehicle, which has native libraries for each platform for communications. In my main project I have a background worker that I start and stop whenever I want to look at messages. Inside that thread (basically a loop that reads and processes any new messages) I make a DependencyService.Get call to read messages. This all "works" fine though I am seeing timing issues (missed messages) and I am pretty sure it is due to the many hundreds of DependencyService.Get calls that happen inside that thread(I don’t see this behavior in native iOS/Android Xamarin projects). Is there a better way to do this? Due I need to move this code into each platform instead? That would suck as it would be a lot of code duplication. Thanks for any insight/help.
Source: Xamarin.ios Questions