1 year ago

#333353

test-img

Nath

NewUpdateDraftActionResponseBuilder crashes the Gmail IOS app

On the current Gmail iPhone app, calling the newUpdateDraftActionResponseBuilder crashes the app. No errors get logged and those crashed calls never appear in the 'Executions' tab in the App Script console.

The same code runs fine on the Android Gmail app or in the browser.

Code to reproduce

index.gs

function attachRecording() {

return CardService.newUpdateDraftActionResponseBuilder()
    .setUpdateDraftBodyAction(CardService.newUpdateDraftBodyAction()
      .addUpdateContent('<h1>hello</h1>', CardService.ContentType.IMMUTABLE_HTML)
      .setUpdateType(CardService.UpdateDraftBodyType.IN_PLACE_INSERT))
    .build();
}

appsscript.json

{
  "timeZone": "America/New_York",
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8",
  "oauthScopes": [
    "https://www.googleapis.com/auth/gmail.addons.current.action.compose",
    "https://www.googleapis.com/auth/userinfo.email",
    "https://www.googleapis.com/auth/script.external_request",
    "https://www.googleapis.com/auth/gmail.addons.execute"
  ],
  "addOns": {
    "common": {
      "name": "Vocal",
      "logoUrl": "https://www.gstatic.com/images/icons/material/system/1x/mic_black_48dp.png",
      "universalActions": [
        {
          "label": "Manage account",
          "openLink": "https://app.vocal.email"
        }
      ],
      "homepageTrigger": {
        "runFunction": "onWelcomeClick"
      },
      "openLinkUrlPrefixes": [
        "*"
      ]
    },
    "gmail": {
      "composeTrigger": {
        "selectActions": [
          {
            "text": "Record voice message",
            "runFunction": "attachRecording"
          }
        ],
        "draftAccess": "NONE"
      }
    }
  }
}

I tried the different methods of the function listed here: https://developers.google.com/apps-script/reference/card-service/update-draft-action-response-builder

Whether it's adding a subject or text/html in the body. it always crashes the app.

google-apps-script

google-workspace-add-ons

0 Answers

Your Answer

Accepted video resources