I have an app that should give updates periodically on a location of users using the app. This I intend to accomplish using background tasks and I've been using the new framework BGAppRefreshTaskRequest to schedule a task. then I intend to have it triggered upon scheduled time and I then immediately schedule another task.
I never get any triggers on the task, it doesn't apparently go into the handle procedure defined in my codeline when I register it: BGTaskScheduler.Shared.Register(PingTaskId, null, task => HandleAppPing(task as BGAppRefreshTask));
I have also setup the info.plist correct with the keys in
<key>UIBackgroundModes</key>
<array>
<string>location</string>
<string>fetch</string>
<string>remote-notification</string>
<string>processing</string>
</array>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>MyAppBundleId</string>
<string>MyAppBundleId.ping</string>
</array>
Can someone tell me what I'm possibly doing wrong? I also placed an example of the code on github: https://github.com/sigthor/background.ping