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

242
Visualizações
How to redirect Facebook instant game iframe to my server?

In a Facebook instant game I try to retrieve the player id, photo and signature - and then redirect to my own server which would verify the signature and then display the HTML5 game.

Here is the Javascript part of my index.html, which I upload as Facebook instant game bundle:

<script src="//connect.facebook.net/en_US/fbinstant.7.0.js"></script>
<script>
window.onload = function() {
    FBInstant.initializeAsync().then(function() {
        FBInstant.startGameAsync().then(onStart);
    });
};

function onStart() {
    FBInstant.player.getSignedPlayerInfoAsync('my_metadata')
    .then(function (result) {
        var lang  = 'en';
        var photo = FBInstant.player.getPhoto();
        var sig   = result.getSignature();
        location.href = 
                'https://wordsbyfarber.com/' + lang + 
                '/facebook?sig=' + encodeURIComponent(sig) +
                '&photo=' + encodeURIComponent(photo)
                ;
    }).catch(ex => {
        console.log(ex);
    });
}
</script>

Then in the Settings / Advanced / Share Redirect Domain Allow List I add the domain of my game backend server:

screenshot settings

However, this does not help - when the instant game is run, then in the console I see the error:

Refused to frame 'https://wordsbyfarber.com/' because it violates the following Content Security Policy directive: "frame-src *.doubleclick.net *.google.com *.facebook.com www.googleadservices.com *.fbsbx.com fbsbx.com data: www.instagram.com *.fbcdn.net https://paywithmybank.com".

And the iframe content served by my backend server is not displayed in the browser:

screenshot fail

I understand, that Facebook is serving a Content Security Policy HTTP header not allowing my game backend server...

Is my setup possible for instant games? Have I overlooked some setting?

about 4 years ago · Juan Pablo Isaza
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