Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

100
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!