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

451
Views
Twilio "GCM/FCM unauthorized error: GCM/FCM API key is revoked or invalid" in conversations push notifications

I have implemented a simple chat using Twilio conversations API. I'm following the doc for web push notifications (https://www.twilio.com/docs/conversations/javascript/push-notifications-web) and it's not clear to me what "FCM SECRET" I need to include in my Twilio Credential. I have tried with my firebase app key pair (public and private) and also with firebase web API key, but in the Twilio logs I allways get a GCM/FCM unauthorized error: GCM/FCM API key is revoked or invalid error.

Update:

My app code:

import { initializeApp } from "https://www.gstatic.com/firebasejs/9.8.2/firebase-app.js";
import { getMessaging, getToken, onMessage } from "https://www.gstatic.com/firebasejs/9.8.2/firebase-messaging.js";

const firebaseConfig = {
    apiKey: "...",
    authDomain: "...",
    projectId: "...",
    storageBucket: "...",
    messagingSenderId: "...",
    appId: "..."
};

const firebase = initializeApp(firebaseConfig);
const messaging = getMessaging(firebase);

const serviceWorkerRegistration = await navigator
    .serviceWorker
    .register('/js/firebase/firebase-messaging-sw.js');

if (firebase && messaging) {

    // getting FCM token
    getToken(messaging, {
        vapidKey: '...',
        serviceWorkerRegistration: serviceWorkerRegistration,
    }).then(async (fcmToken) => {

        console.log('token', fcmToken)
        const conversationsClient = await getConversationsClient();

        conversationsClient.setPushRegistrationId('fcm', fcmToken);

        onMessage(messaging, payload => {
            console.log('Message received. ', payload);
            conversationsClient.handlePushNotification(payload);
        });

    }).catch((err) => {
        console.log('Error getting token', err);
    });

} else {
    // no Firebase library imported or Firebase library wasn't correctly initialized
}

The fcmToken is generated and successfuly registered in Twilio.

The Binding is created In Twilio with my credential referenced:

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I believe the FCM Secret should be the apiKey that you get when you register the web application and get the details like this:

Screenshot of the Firebase setup process showing the section where you add the Firebase SDK to your application. The first key in the Firebase Config is the apiKey.

You also need to ensure you are using that config when you initialize the Firebase SDK in your application.

If you are using that config, then perhaps you can share the code that you are using in your app to initialize Firebase and request an fcmToken from the user.

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!