I have a functionality where the user can switch on/off bluetooth(classic) from xamarin app. Need some set functions to execute based on that which am handling using the Broadcast Receiver of android and on state change am invoking MessagingCenter and then subscribing to it on the viewModel end which works like a charm.
Now strangely though am using Messaging Center throughout my app, but if I switch on the bluetooth directly without going into a flow where Messaging center is invoked It throws an exception. If I execute any other flow well and then go back then it works fine. Works fine with debug point set before the MessagingCenter.Send is called .
have fixed it (temporarily by adding Thread.Sleep for a second).
But am really curious as to why it might be happening .
Any clue is appreciated.