Open link to safari

I'm building a project in react with typescript that involves reading a QR code, what happens to iPhone users is that the QR code is read from the iPhone's code reader and the link opens in a web preview of the reader application of codes, this link opens a page with two buttons where the user will choose whether to open the next link in which browser, for example, firstly when he chose to open with safari I would leave the link like this: https://mysite.ao/home/23883298393232/ueuweyuwe7

The problem is that this way the link also opens in the web-preview, I want it so that when I choose to open with safari this link opens specifically in safari

I tried to do it this way:

`function openToSafari() { window.open('safari://mysite.ao/home/23883298393232/ueuweyuwe7', '_blank');

}`

The problem is that when you do this the following message appears:

"Safari cannot open the page because the address is not valid"

But if the user chooses to open with other browsers, the link opens very well, but if they choose Safari it does not open and gives this message.

Could anyone give an explanation of how I could overcome this? Thank you very much in advance!

To open with Chrome, I'm doing it this way and it works very well:

function openToChrome() { window.location.href = googlechrome://mysite.ao/home/23883298393232/ueuweyuwe7 }

I want it so that when I choose to open with safari this link opens specifically in safari

The problem is that when you do this the following message appears:

"Safari cannot open the page because the address is not valid"

Open link to safari
 
 
Q