Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Using Crashlytics Alert with Cloud Function #1016

Unanswered
K-Caner asked this question in Q&A
Discussion options

Hello,

I Tried to add the codes to cloud function for crashlytics alert system.
I defined env variable for Discord Webhook.

But it does not work. There is no log message. So, I guess there is a problem with reaching Crashlytics.
What can be the problem?

You must be logged in to vote

Replies: 1 comment

Comment options

If you're not seeing logs or Crashlytics alerts, the issue might be in several places - either in your code, environment variables, or even Crashlytics settings.

Debugging Steps:

  1. Logging: Insert debug logs throughout your Cloud Function to trace the flow.

    console.log("Function started");
  2. Environment Variables: Make sure the environment variable for the Discord Webhook is correctly set up and accessible within your function.

    console.log(process.env.YOUR_DISCORD_WEBHOOK_ENV_VARIABLE);
  3. Permissions: Make sure your Cloud Function has the proper permissions to interact with Crashlytics.

  4. Crashlytics Setup: Ensure Crashlytics is correctly set up to send alerts.

  5. Manual Trigger: Try to manually trigger the Crashlytics alert to check if the problem is with Crashlytics or your Cloud Function.

  6. Firebase Function Logs: Check the Firebase dashboard for logs regarding your function.

Here is a skeleton example to debug:

exports.myFunction = functions.https.onRequest((request, response) => {
 console.log("Function started");
 console.log(`Discord Webhook: ${process.env.DISCORD_WEBHOOK}`);
 
 // Your code here
 console.log("Function ended");
});

This way, you can trace the function's execution and identify any issues.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /