Universal Link failures in Safari with EventListener

Hi everyone! We encountered an issue with universal links where the link failed to open the iOS application from Safari when triggered by an event listener. However, when we modified the code to open the link directly via a user click, the application launched as expected. Based on our testing, this issue seems to occur only when there is information for the application cached in Safari.

Our previous flow that resulted in the broken universal link included:

  1. Data is loaded and a screen with a button to open the universal link is available for the user
    • When the data is loaded it sets a state variable to true for DataLoaded
  2. The user clicks on the button to open the universal link
    • When the user clicks the button to open the link it sets a variable to true for ButtonClicked
  3. When DataLoaded and ButtonClicked are true then the universal link is opened

Our new flow that results in the successful universal link includes:

  1. Data is loaded and the user is hit with a loading screen until it is finished
  2. The user clicks on the button to open the universal link and the universal link is opened directly

Does anyone have insights into why universal links must be triggered by direct user action, and in what scenarios this behavior is enforced?

prolling,

It seems this is the same issue you already reported here? https://developer.apple.com/forums/thread/772550

Albert Pascual
  Worldwide Developer Relations.

Universal Link failures in Safari with EventListener
 
 
Q