IGeolocation.StartListeningForegroundAsync 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.
Starts listening to location updates using the LocationChanged event. Events may only sent when the app is in the foreground. Requests Permissions.LocationWhenInUse from the user.
public:
System::Threading::Tasks::Task<bool> ^ StartListeningForegroundAsync(Microsoft::Maui::Devices::Sensors::GeolocationListeningRequest ^ request);
public System.Threading.Tasks.Task<bool> StartListeningForegroundAsync (Microsoft.Maui.Devices.Sensors.GeolocationListeningRequest request);
abstract member StartListeningForegroundAsync : Microsoft.Maui.Devices.Sensors.GeolocationListeningRequest -> System.Threading.Tasks.Task<bool>
Public Function StartListeningForegroundAsync (request As GeolocationListeningRequest) As Task(Of Boolean)
Parameters
- request
- GeolocationListeningRequest
The listening request parameters to use.
Returns
true
when listening was started, or false
when listening couldn't be started.
Exceptions
Thrown when request
is null
.
Thrown if listening is not supported on this platform.
Thrown if already listening and IsListeningForeground returns true
.
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