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

105
Visualizações
How to get Twilio Notify to work with firebase FCM

I am following Twilio firebase quickstart until point 7, which actually includes the final push notification test, but i am a bit confused on the binding between "identity" and "address". In my understanding the address is just the previously received token so I tried to just register them (didn't use register before to be honest)

messaging.getToken()
   .then(function(currentToken) {
      if (currentToken) {
        console.log('Token received: ', currentToken)
        const identity = 'myidentity'
        const address = currentToken
      
        register(identity, address)
      }
   })

Unfortunately register expects type "Hooks" and not a string (message is "Argument of type 'string' is not assignable to parameter of type 'Hooks | undefined'.Vetur(2345)")

What am I missing?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Twilio developer evangelist here.

The register function is actually defined in the notify_actions.js file that is part of the example repo. It looks like:

function register(identity, address){
    var url = "http://127.0.0.1:3000/register";
    
    data = {
        'identity': identity,
        'address': address,
        'binding_type': 'fcm'
    }
    postRequest(url, data);
}

And postRequest is a wrapper around XMLHttpRequest to make the request to your server. This is intended to send the identity and address/token first to your server and then on to the Twilio Notify API to register the identity with the device token. You can see this in the SDK starter back-end that the Notify quickstart uses to create the binding.

I'm not sure where your register function comes from or why it is giving an error to do with "Hooks", but this is what it should be doing. Hopefully that can help.

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