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

Long running task was cancelled by iOS after lock the screen #8

Open
wml2017 opened this issue Mar 16, 2020 · 1 comment
Open

Long running task was cancelled by iOS after lock the screen #8

wml2017 opened this issue Mar 16, 2020 · 1 comment

Comments

@wml2017
Copy link

wml2017 commented Mar 16, 2020

On my iPhone 6+ with iOS 12, the sample works well with debug model. But when start the app on my iPhone, start LongRunning task and lock iPhone or press iPhone's home button, the background task will be cancelled automatically after 3 minutes even though check Background model, Background fetch, Background processing on Info.plist page. Could you update your sample code to fix this issue?

@shernandezp
Copy link

The implementation of OnExpiration method should be
void OnExpiration()
{
UIApplication.SharedApplication.EndBackgroundTask(_taskId);
}

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

2 participants