Issue
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
}
I want to call here:
var status = await Permissions.CheckStatusAsync<Permissions.LocationWhenInUse>();
How to do it?
Solution
If you don't want to call this in the OnAppearing() method and specifically in the contructor, you can do this (watch out for possible thread blocking though):
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
// watch out for possible thread blocking!
Task.Run(async() =>
{
await Permissions.CheckStatusAsync<Permissions.LocationWhenInUse>();
});
}
}
Answered By - Michael
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.