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

309
Visualizações
how to send multi `windows.postmessage(data)` to a single source, with adding an ID to every message to be able to catch it

I need to send more than one message using js to the same source flutter app is the source and it is ready to receive all messages based on their ID , which is mentioned in documentations to be sent like this :

measurePointTwo.postMessage(ptTwoData)

this causes the error :

Uncaught ReferenceError: measurePointTwo is not defined

That is because am using measurePointTwo and I cant not use this because this is how the listener in my flutter app is getting different messages, based on this ID or unique name.

What I have tried

window.measurePointTwo.postMessage(ptTwoData)

and this is getting me this error :

Uncaught TypeError: Cannot read properties of undefined (reading 'postMessage')

Extra info

  • This window runs in my flutter app is a Web view
  • Inside the WebView this function is used to handle postMessage :
                            javascriptChannels: {
                              JavascriptChannel(
                                  name: 'newCords',
                                  onMessageReceived:
                                      (JavascriptMessage message) {
                                    controller.getLagLngFromJSMessage(
                                        message.message);
                                  }),
                              JavascriptChannel(
                                  name: 'measurePointOne',
                                  onMessageReceived:
                                      (JavascriptMessage message) {
                                    controller.getPintOneFromJSMessage(
                                        message.message);
                                  }),
                              JavascriptChannel(
                                  name: 'measurePointTwo',
                                  onMessageReceived:
                                      (JavascriptMessage message) {
                                    controller.getPintTwoFromJSMessage(
                                        message.message);
                                  }),
                              JavascriptChannel(
                                  name: 'newPoint',
                                  onMessageReceived:
                                      (JavascriptMessage message) {
                                    controller.getClickedPoint(message.message);
                                  }),
                            },

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