I have added a navigator.share function to my react app, but for some reason, it is only sharing the text from the object and not the URL? Is there something I am missing here?
function shareList() {
if (navigator.canShare) {
navigator.share({
title: "Page Title",
text: "brief description",
url: window.location.href,
});
} else {
//functionality for desktop
}
}
<input type="button" value="Share..." onclick="shareList()"/>
On iOS, the share dialogue pops up properly, but the share object is just text and not a URL. Here is a screenshot of the pop-up
It appears the issue was with my device. I tested on another device soon after posting and it worked fine, and after restarting my device it worked as intended.