ios – tvOS: Common Hyperlinks Dealing with in Media App


I am reaching out for assistance with an issue I am encountering in my media app related to executing universal links. My app is designed to handle universal links to navigate users directly to specific content within third-party applications like Apple TV+ and Netflix. While the implementation works as expected with Apple TV+ links, directing the user to the intended content page, I am facing difficulties with links from other services such as Netflix. For these, the app only opens the target application without navigating to the specific show or content page as intended.

The relevant portion of my code involved in handling the universal links is as follows:

    dataStore = Backendless.shared.data.ofTable("TestTable")
    testObject = ["foo": "Hello World"]
    dataStore?.save(entity: testObject!, responseHandler: { savedTestObject in
        // Code to update UI elements
        if let deepLink = savedTestObject["foo"] as? String {
            if let url = URL(string: deepLink) {
                let options: [UIApplication.OpenExternalURLOptionsKey: Any] = [.universalLinksOnly: true]
                UIApplication.shared.open(url, options: options, completionHandler: { success in
                    if success {
                        print("Opened url successfully")
                    } else {
                        print("Failed to open url")
                    }
                })
            }
        }
    }, errorHandler: { fault in
        self.showErrorAlert(fault)
    })
}

From the snippet above, I am attempting to execute universal links stored within a backend database. The intended behavior is to direct the user to a specific page within a third-party app based on the URL provided. This works flawlessly with Apple TV+ links, but when executing links from Netflix or similar services, it falls short by only launching the app without navigating to the specified content.

The Netflix URLs have tried are:

http://www.netflix.com/title/81731618
nflx://www.netflix.com/title/81731618

Please note that another App works great with the JustWatch App so I think there are no Limitations imposed by Apple.

Leave a Reply

Your email address will not be published. Required fields are marked *