2

I'm developing an app that will open another app using its universal link.

Here is my code:

Button(action: {
    if let appURL = URL(string: "https://www.hotstar.com/us/123") {
        UIApplication.shared.open(appURL) { success in
            if success {
                print("The URL was delivered successfully.")
            } else {
                print("The URL failed to open.")
            }
        }
    } else {
        print("Invalid URL specified.")
    }
}) {
    Text("Open Hotstar")
}

When I click on the button I get the following error:

2021-01-21 22:59:09.875834-0800 deeplink-test-app[279:20546] [default] Failed to open URL https://www.hotstar.com/us/123: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.PBLinkHandler" failed." UserInfo={BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x2811588d0 {Error Domain=FBSOpenApplicationErrorDomain Code=4 "Unable to open application for the given URL. If this is a universal link ensure a supported target app is installed." UserInfo={BSErrorCodeDescription=NotFound, NSLocalizedFailureReason=Unable to open application for the given URL. If this is a universal link ensure a supported target app is installed.}}, NSLocalizedDescription=The request to open "com.apple.PBLinkHandler" failed., FBSOpenApplicationRequestID=0x288c, NSLocalizedFailureReason=The request was denied by service delegate (PBProcessManager) for reason: NotFound ("Unable to open application for the given URL. If this is a universal link ensure a supported target app is installed").}

The URL failed to open.

The same link works on an iPhone if I open it using a web page.

The Hotstar app has been installed on my AppleTV device.

TylerP
  • 9,600
  • 4
  • 39
  • 43
murad
  • 51
  • 7
  • On your iPhone, does the link first go through Safari? In any case, I would assume that the Hotstar app on tvOS just doesn't support Universal Links. – idmean Jan 22 '21 at 07:09
  • Yes, the link opened on iPhone via safari work. Regarding Hotstar not supporting the deep link - I also thought the same but I'm not able to open any app via its universal link on tvOS. eg https://www.kanopy.com/product/fame-high is a deep link for Kanopy app which opens on iOS but doesn’t work on tvOS. – murad Jan 22 '21 at 07:17

0 Answers0