Geolocation.GetLastKnownLocationAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the last known location of the device.
public:
static System::Threading::Tasks::Task<Microsoft::Maui::Devices::Sensors::Location ^> ^ GetLastKnownLocationAsync();
public static System.Threading.Tasks.Task<Microsoft.Maui.Devices.Sensors.Location?> GetLastKnownLocationAsync ();
static member GetLastKnownLocationAsync : unit -> System.Threading.Tasks.Task<Microsoft.Maui.Devices.Sensors.Location>
Public Shared Function GetLastKnownLocationAsync () As Task(Of Location)
Returns
A Location object containing recent location information or null
if no location is known.
Remarks
The location permissions will be requested at runtime if needed. You might still need to declare something in your app manifest.
This location may be a recently cached location.
Applies to
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin