Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
When I click the Facebook Share link on the web, I want to go to the app if there is an app on mobile
function shareFacebook() {
    let url = encodeURIComponent('https://stackoverflow.com/');
    let title = 'title';
    window.open(`http://www.facebook.com/sharer.php?u=${url}&t=${title}`, 'pop up name', 'width=600, height=600');
  }

return (
   <button onClick={() => shareFacebook()}><img src={facebook}></img></button>
)

The code for now is the PC version. The url is stack overflow, and when you click the button, you will be directed to the page shared on Facebook.

But I want to make one more responsive button, and when the responsive button is clicked, it will go to the facebook app and even share the url on stackoverflow. But I don't know what to do.

function shareFacebook() {
    let url = encodeURIComponent('https://stackoverflow.com/');
    let title = 'title';
    window.open(`fb://sharer.php?u=${url}&t=${title}`, 'pop up name', 'width=600, height=600');
  }

I've tried this, and when I click the Facebook link in Responsive, I go to the app, but it doesn't go to the page sharing stack overflow.

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!