I have a call to window.open with _blank, and it works in all browsers except on iOS. In my web app, when I click the button to Add to Cart on an iOS device, nothing happens at all, whereas in all other browsers, a new window opens.
const addProducts = (products) => {
setProductsAdded(false);
cService
.add(products)
.then(() => {
setLoading(null);
setProductsAdded(true);
window.open(C_LINK, '_blank');
})
.catch(() => {
setError('Error');
});
};
I found this question and answer, which seems to be the same problem - but I am new to Javascript and not exactly sure how to implement it: window.open(url, '_blank'); not working on iMac/Safari
So my first question is, am I right in thinking the question and answer I just mentioned could be the same problem? My second question is, if I were to try to implement the solution as mentioned in the previous question, would I modify the existing function or would it be separate? Where would I set window.open()? Could someone explain what "myService" is exactly? Thank you for your help.