Reputation: 1
Is there a possibility to allow Bluetooth for Android when starting the app in Maui. Not with a button. Thank you .
I made an app with a button to authorize Bluetooth .
Upvotes: 0
Views: 337
Reputation: 14509
Just as Jason said, you can put your code about request the bluetooth permission in some lifecycle events.
Such as in the mainpage's onappearing method:
protected override void OnAppearing()
{
// the code about request permission
base.OnAppearing();
}
Or in the /Platfrom/Android/MainActivity.cs:
protected override void OnCreate(Bundle saveInstanceState)
{
base.OnCreate(saveInstanceState)
//the code about request permission
}
Upvotes: 0