1

I have a well-known part of code to open another app from my app. And mainly it works as expected. But there is a group of users where I see an error log that shows that it doesn't work.

So, shortly, there are two iPhones and one can open URL and another can't. URL is the same.

Why it can happen and how handle it?

if UIApplication.shared.canOpenURL(url) {
  UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
Martin R
  • 529,903
  • 94
  • 1,240
  • 1,382
  • The obvious answer would be that there is no app installed on those devices that responds to the URL scheme – Paulw11 Dec 25 '20 at 08:05
  • Thanks, @Paulw11 but not. The app exists on one device as well as on another. – Oleksandr Yolkin Dec 25 '20 at 08:20
  • hi second device in ios version ? – Himanshu Patel Dec 25 '20 at 08:52
  • 1
    The failing users have not given permission for your app to open the universal link on the first attempt? – Warren Burton Dec 25 '20 at 09:11
  • What I can think of is the difference between iOS versions, you can think in this direction. I found some, you can refer to it.https://stackoverflow.com/questions/35746179/canopenurl-method-not-working-ios-9 https://stackoverflow.com/questions/40119595/canopenurl-not-working-in-ios-10 – Nullable Dec 25 '20 at 10:27
  • @WarrenBurton how it could be? iOS doesn't have such kind of permission. – Oleksandr Yolkin Dec 25 '20 at 13:17
  • @OleksandrYolkin I swear I remember an alert that the first time you open a given apps universal link, asked if you wanted to open that link in the app or continue with safari. – Warren Burton Dec 25 '20 at 13:44

0 Answers0