Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

181
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda