Not able to open universal links on tvOS from a different app

709 Views Asked by At

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.

0

There are 0 best solutions below