Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 14 Universal Links broken on default browser other than Safari

On iOS 14 you can pick another default browser than Safari. If you use another browser, that browser will ask the user to change their default browser. 

I have installed quite a few browsers (Chrome, Firefox, Edge, Opera, Brave...) and have set each of them as my default one.

Problem comes when I try to open a Universal Link (which was working just fine when Safari was the default browser), which seems to just not work. With Safari as default browser, the Universal Link would work, and the corresponding native app was getting opened. However, with any other browser different from Safari set as default, the feature is broken and the Universal Link doesn't open the native app.

Has anyone experienced anything similar? Why might this happen and how might this be solved?

Any help is very much welcomed

like image 707
inigo333 Avatar asked Oct 28 '20 11:10

inigo333


People also ask

Do universal links work on Chrome?

On iOS, only Safari works. On Android, only Chrome works. This mean that if you access the link from a different source on those devices, it will not work.

How do I make Chrome open links instead of Safari on iPhone?

Open the Chrome app on your iPhone. Tap More ( ) on your screen, then Settings. In Settings tap Default Browser > Open Chrome Settings. Tap Default Browser App and select Chrome.

How do I change the browser that opens links on my iPhone?

Go to Settings and scroll down until you find the browser app or the email app. Tap the app, then tap Default Browser App or Default Mail App. Select a web browser or email app to set it as the default. A checkmark appears to confirm it's the default.


1 Answers

For iOS 14+

I suggest to add this to your Info.plist

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>https</string>
</array>

By adding this you can continue to use method canOpenURL(_ url: URL) -> Bool

guard let url = URL(string: "https://example.com") else { return }
if UIApplication.shared.canOpenURL(url) {
    UIApplication.shared.open(url)
}
like image 193
RunesReader Avatar answered Oct 20 '22 00:10

RunesReader