Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

185
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda