Skip to content

iOS 13 - Crash #2

@scgough

Description

@scgough

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions