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

458
Visualizações
Sharing content on Facebook is not working using FB.ui in for mobile devices?

I have added the following code which is working great on the Web but not on mobile devices the click event does not seem to be triggering.

    var FacebookShare = function() {
        this.method = 'feed';
        this.name = 'A Name';
        this.hashtag = '#YourHashtag';
    };

    $('#facebook-share').click((event) => {
        let options = new FacebookShare();
        options.quote = $(event.currentTarget.parentElement).find('h5').html() 
        facebookshare(event, options)
    });

    function facebookshare(event, options) {
    event.preventDefault()

    if(typeof(mobileApp) !== 'undefined'){
        options.display = "touch"; //also tried iframe, popup
        FB.ui(options,
        function() {
            console.log('shared');
            })
        }
    } 
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I was able to find a workaround to this issue by overloading the following query string with a quote - which is the text you want to quote and an image (url). The only down fall was that I could not add a hashtag to my post but all in all it worked!

        var u = encodeURI(options.picture);
        var q = encodeURI(options.quote);
        window.location.href = "https://www.facebook.com/sharer/sharer.php?u=" + u + `&quote=${q}&display=popup&ref=plugin&src=like&kid_directed_site=0&app_id=YOUR_APP_ID`
about 4 years ago · Juan Pablo Isaza Relatório
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