Since 10.0.14393 (Anniversery Update), LocationTrigger doesn't seem to work. I have:
- Windows Phone 8.1 application (also applies to UWP application).
- A portable library that displays the
Windows Runtime Component ( .winmd ) .winmd - Declaration of a background task with location capabilities (set to the library as a record).
- Access with
BackgroundExecutionManager.RequestAccessAsync() - A
LocationTrigger type Geofence .
The background task never starts. Registration / task code after gaining access:
public sealed class GeofenceTask : IBackgroundTask { public static void Register() { var taskName = nameof(GeofenceTask); foreach (var n in BackgroundTaskRegistration.AllTasks.Where(n => n.Value.Name == taskName)) { n.Value.Unregister(true); break; } var builder = new BackgroundTaskBuilder {Name = taskName, TaskEntryPoint = typeof (GeofenceTask).FullName}; builder.SetTrigger(new LocationTrigger(LocationTriggerType.Geofence)); builder.Register(); } public void Run(IBackgroundTaskInstance taskInstance) {
Works on a device or Windows Phone 8.1 emulator. A preliminary update, it also worked on Windows 10 Mobile. Are there any known solutions so far?
c # windows-phone cordova uwp windows-10-mobile
Roel van uden
source share