My background task on IOS never gets executed

Bjorn Holmthorsson 1 Reputation point
2020-10-26T22:18:07.14+00:00

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>

&lt;key&gt;BGTaskSchedulerPermittedIdentifiers&lt;/key&gt;
&lt;array&gt;
    &lt;string&gt;MyAppBundleId&lt;/string&gt;
    &lt;string&gt;MyAppBundleId.ping&lt;/string&gt;
&lt;/array&gt;

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

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,789 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Laude 85,781 Reputation points
    2020-10-27T09:20:26.727+00:00

    Hi @Bjorn Holmthorsson ,

    You have posted in the Microsoft Q&A forums which is about Microsoft technologies/products, since you're using a community app I suggest you contact the author who developed the app: sigthor@Stuff .com

    ----------

    (If the reply was helpful please don't forget to upvote or accept as answer, thank you)

    Best regards,
    Leon

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.