[PR #673] [MERGED] Open external URL from main thread #713

Closed
opened 2026-03-03 17:29:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/OAuthSwift/OAuthSwift/pull/673
Author: @diogomusou
Created: 8/17/2021
Status: Merged
Merged: 12/3/2021
Merged by: @phimage

Base: masterHead: master


📝 Commits (1)

  • 910e5bb Open external URL from main thread

📊 Changes

1 file changed (+14 additions, -12 deletions)

View changed files

📝 Sources/Handler/OAuthSwiftOpenURLExternally.swift (+14 -12)

📄 Description

Currently it is possible that UIApplication.open(url) is run from a background thread. This causes the app to hang for a while before opening the external browser, and Xcode also shows a warning (see image below).
This change makes sure that this is always run from main thread, clearing the Xcode warning and the delay in the app.

I only tested this on iOS 14 (line 29 of file), but I imagine it works for the other lines as well.

Screen Shot 2021-08-17 at 11 15 59 AM

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/OAuthSwift/OAuthSwift/pull/673 **Author:** [@diogomusou](https://github.com/diogomusou) **Created:** 8/17/2021 **Status:** ✅ Merged **Merged:** 12/3/2021 **Merged by:** [@phimage](https://github.com/phimage) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`910e5bb`](https://github.com/OAuthSwift/OAuthSwift/commit/910e5bb006b3aa82eee4cbd5664904923c57eca1) Open external URL from main thread ### 📊 Changes **1 file changed** (+14 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `Sources/Handler/OAuthSwiftOpenURLExternally.swift` (+14 -12) </details> ### 📄 Description Currently it is possible that UIApplication.open(url) is run from a background thread. This causes the app to hang for a while before opening the external browser, and Xcode also shows a warning (see image below). This change makes sure that this is always run from main thread, clearing the Xcode warning and the delay in the app. I only tested this on iOS 14 (line 29 of file), but I imagine it works for the other lines as well. <img width="1213" alt="Screen Shot 2021-08-17 at 11 15 59 AM" src="https://user-images.githubusercontent.com/13061863/129757406-7844657d-730a-4ca6-a10b-60df1b3e75a0.png"> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 17:29:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#713
No description provided.