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

UIApplication.shared.canOpenURL should be used from main thread #10

Closed
leye0 opened this issue Oct 6, 2021 · 2 comments · Fixed by #12
Closed

UIApplication.shared.canOpenURL should be used from main thread #10

leye0 opened this issue Oct 6, 2021 · 2 comments · Fixed by #12

Comments

@leye0
Copy link

leye0 commented Oct 6, 2021

I received this warning...

UI API called from background thread: UIApplication.canOpenURL(_:) must be used from main thread only

...when navigating back to my application.

It seems like the main thread should be retrieved before calling the UIApplication.shared.canOpenURL method. Maybe something like this would help?

DispatchQueue.main.async {
    UIApplication.shared.open(settingsUrl, completionHandler: { (success) in
        call.resolve([
            "status": success
        ])
    });
}

image

Thanks

@leye0 leye0 changed the title UIApplication.shared.canOpenURL UIApplication.shared.canOpenURL should be used from main thread Oct 6, 2021
@RaphaelWoude
Copy link
Owner

RaphaelWoude commented Oct 14, 2021

That should do the trick. Would you be able to make a pull request for this? @leye0

@dennisameling
Copy link
Contributor

Here's a PR: #12

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