Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 13 background task #1

Open
aamir-munir opened this issue Oct 6, 2019 · 10 comments
Open

iOS 13 background task #1

aamir-munir opened this issue Oct 6, 2019 · 10 comments

Comments

@aamir-munir
Copy link

Hello,

This is a question not an issue. is there any limit on how many times we can perform a task? or how soon we can make another call to perform same action again and again.

We have a project that stops after iOS 13 release we were using background location for that but it looks like it stops working in iOS 13.

I really appreciate your quick reply.

Thanks

@ICloud0114
Copy link

I running your project in iOS 13.1.2 , it doesn't work, i can't receive local notification

@vostronix
Copy link

Me nether :(

@hiteshtrivedi
Copy link
Collaborator

hiteshtrivedi commented Oct 18, 2019 via email

@mbektchiev
Copy link

Hello,

This is a question not an issue. is there any limit on how many times we can perform a task? or how soon we can make another call to perform same action again and again.

We have a project that stops after iOS 13 release we were using background location for that but it looks like it stops working in iOS 13.

I really appreciate your quick reply.

Thanks

According to the docs:

There can be a total of 1 refresh task and 10 processing tasks scheduled at any time. Trying to schedule more tasks returns BGTaskSchedulerErrorCodeTooManyPendingTaskRequests.

@mbektchiev
Copy link

I tried with 13.1.3 and it's the same. The task requests are submitted successfully, but the code of the tasks is never executed. When I check their status with:

        BGTaskScheduler.shared.getPendingTaskRequests(completionHandler: { tasks in
            print("Tasks", tasks.count, tasks);
        })

It shows the requests as pending but they never get to run:

Tasks 2 [<BGAppRefreshTaskRequest: com.SO.apprefresh, earliestBeginDate: 2019-10-24 06:26:24 +0000>, <BGProcessingTaskRequest: com.SO.imagefetcher, earliestBeginDate: 2019-10-24 06:26:23 +0000, requiresExternalPower=0, requiresNetworkConnectivity=0>]

Hi Guys, Will check and update you next week.

On Fri, Oct 18, 2019 at 2:28 PM Marius Hartig @.***> wrote: Me nether :( — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#1?email_source=notifications&email_token=AAZL7N3H2PGDO7SDOOFQCQDQPF3FBA5CNFSM4I52MNGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBTOBCI#issuecomment-543613065>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZL7N5CGUZXYVYVNGRQGDLQPF3FBANCNFSM4I52MNGA .

@mbektchiev
Copy link

One more finding: Following this article I managed to force the task to run by executing e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@"com.SO.imagefetcher"] in lldb. But still I cannot understand why

The delay between the time you schedule a background task and when the system launches your app to run the task can be many hours.

@vostronix
Copy link

@mbektchiev thx its for me now also working its look like that iOS don't call this so many times

@mbektchiev
Copy link

You're welcome, I'm glad I've helped with my observations 😄

I actually left the app running for the whole last night, and it seems that the background task wasn't launched even once... I'm not sure whether that's normal or not. Explicit triggering with the debugger seems to start it, but I still haven't managed to see it work, otherwise.

@garvankeeley
Copy link

garvankeeley commented Nov 26, 2019

Confirmed that the BG task doesn't seem to fire, I am on iOS 13.2.3. Edit: leaving the device idle for a few minutes worked, the notification fired.

@KkevinLi
Copy link

KkevinLi commented Dec 9, 2019

Just had a question, is this expected to fire only while the app is backgrounded and not suspended (swiped away)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants