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 - Crash #2

Open
scgough opened this issue Apr 17, 2020 · 0 comments
Open

iOS 13 - Crash #2

scgough opened this issue Apr 17, 2020 · 0 comments

Comments

@scgough
Copy link

scgough commented Apr 17, 2020

I'm getting an issue where this component crashes a (legacy) app because the operation to access and set setIdleTimerDisabled isn't on the main thread.
I have fixed it in my fork by wrapping the methods like so:

dispatch_async(dispatch_get_main_queue(), ^{
    // Acquire a reference to the local UIApplication singleton	  
    UIApplication* app = [UIApplication sharedApplication];	
 
   // If the timer is not disbled, prevent sleep
    if (![app isIdleTimerDisabled]) {
        [app setIdleTimerDisabled:true];
    ...
});

I'm not an Obj-C expert but happy to PR this if it helps?

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

1 participant