Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

97
Views
Why is navigator.share only sharing text, not the URL?

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

Share dialogue screenshot

7 months ago · Juan Pablo Isaza
1 answers
Answer question

0

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.

7 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs