Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

106
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda