Retrieve and send the log of a mobile app

(6.0.2 version)

Example of the final result

example of notification made by an app user
example of automatic report on error

Retrieve and send the log

The following code allows you to:

  • retrieve the log of your application

  • retrieve the local database

  • upload everything to a bucket on GCP

  • send a message to a chat room with links to download everything

Client side action

This action can be invoked for example when the user presses a "send report" button.

Replace XXX_SERVER_ACTION_ID with your server action and logDir whit the bucket folder id.

in this action there are 4 important functions that you can adapt to your purpose:

  • saveUnsentCrash

  • saveDb

  • saveScreenshot

  • saveLog

  • sendChatNotification

Server side action

Replace WEB_HOOK_URL with the id of your web hook.

Define an incoming webhook

Official documentation: https://developers.google.com/hangouts/chat/how-tos/webhooks

From the chat room menu:

  1. Select Configure Webhooks

    A dialog appears that lists any incoming webhooks already defined for the room.

  2. Click on ADD WEBHOOK.

  3. Fill in the name field and optionally the avatar URL field.

  4. Click SAVE.

  5. Copy and save the webhook URL

Last updated

Was this helpful?