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

No alert function detected #1034

Open
hm961225 opened this issue Jan 4, 2023 · 0 comments
Open

No alert function detected #1034

hm961225 opened this issue Jan 4, 2023 · 0 comments

Comments

@hm961225
Copy link

hm961225 commented Jan 4, 2023

When I use commands:firebase emulators:start --only functions
The http function can detect, but the warning function cannot detect, and there is no error prompt.
1672819521805

my alert function is as follow.

exports.postfatalissuetodiscord = onNewFatalIssuePublished(async (event) => {
// [END v2CrashlyticsAlertTrigger]
// [START v2CrashlyticsEventPayload]
// construct a helpful message to send to Discord
const appId = event.appId;
const {id, title, subtitle, appVersion} = event.data.payload.issue;
const message = `
🚨 New fatal issue for ${appId} in version ${appVersion} 🚨

${title}

${subtitle}

id: `${id}`
`;
// [END v2CrashlyticsEventPayload]

try {
// [START v2SendToDiscord]
const response = await postMessageToDiscord("Crashlytics Bot", message);
if (response.ok) {
logger.info(
Posted fatal Crashlytics alert ${id} for ${appId} to Discord,
event.data.payload,
);
} else {
throw new Error(response.error);
}
// [END v2SendToDiscord]
} catch (error) {
logger.error(
Unable to post fatal Crashlytics alert ${id} for ${appId} to Discord,
error,
);
}
});

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

No branches or pull requests

1 participant