Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FCM not working in Prod (working fine in localhost) #1382

Closed
jaysu77 opened this issue Jul 19, 2021 · 1 comment
Closed

FCM not working in Prod (working fine in localhost) #1382

jaysu77 opened this issue Jul 19, 2021 · 1 comment

Comments

@jaysu77
Copy link

jaysu77 commented Jul 19, 2021

import * as admin from 'firebase-admin';
admin.initializeApp({
credential: admin.credential.cert({
projectId: ''',
clientEmail: ''',
privateKey:'''
}),
databaseURL: '',
});

export const sendNotificationAll = async (
messageTitle?: string,
messageBody?: string,
topic?: string,
type?: string,
) => {
const message = {
notification: {
title: messageTitle,
body: messageBody,
},
topic: 'test',
};
const response = await admin
.messaging()
.send(message)
.then((response) => {
// Response is a message ID string.
console.log('Successfully sent message:', response);
})
.catch((error) => {
console.log('Error sending message:', error);
});
};
notification coming for localhost or local IP through node API but not working for Production using HTTPS .

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants