yasmina amroun
yasmina amroun

Reputation: 1

Permissions Bluetooth Android Maui

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

Answers (1)

Liyun Zhang - MSFT
Liyun Zhang - MSFT

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

Related Questions