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

declare background task later and redeclare them as needed #1128

Closed
r10s opened this issue Apr 6, 2021 · 0 comments · Fixed by #1127
Closed

declare background task later and redeclare them as needed #1128

r10s opened this issue Apr 6, 2021 · 0 comments · Fixed by #1127
Assignees
Labels

Comments

@r10s
Copy link
Member

r10s commented Apr 6, 2021

currently, we are declaring the background task already on startup, in installEventHandler() and getting a warning as follows:

2021-04-06 18:22:37.504670+0200 deltachat-ios[5801:4433962] [BackgroundTask] Background Task 1 ("Called by deltachat-ios, from $s13deltachat_ios11AppDelegateC19installEventHandleryyFyycfU_"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.

so, ios, seems to use this also as a time-based-marker, might be that this was different in older os.

https://developer.apple.com/documentation/uikit/uiapplication/1623031-beginbackgroundtask say, the background task can be declared at "any point", however, also speaks of "mark the beginning". i suggest to move the registering to start of applicationDidEnterBackground.

moreover, the current logic allows only one background task at all - then the app has to be terminated and restarted to have another background task. in practise, however, apps are suspended nowadays.

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

Successfully merging a pull request may close this issue.

1 participant