Where to store static images (e.g., app logo) for a Google App script?

Viewed 722

I am new to Google App Script and opened the tutorial to create a button add-on that creates a cat image with a text: https://developers.google.com/gsuite/add-ons/cats-quickstart

The script manifest of this sample App includes a link to a logo image (a paw) which is displayed on the right-hand side. The logo image is hosted by a static website from Google:

"logoUrl": "https://www.gstatic.com/images/icons/material/system/1x/pets_black_48dp.png",

I tried to replace this image by a different logo: new logo image

I uploaded this image to my Google Drive, with a shareable link (no password, everyone can view).

sharing permissions of the new logo image

Here is the new line in the manifest with the new URL for the logo

      "logoUrl": "https://drive.google.com/file/d/1OXYP8c2io6lBy2KroFAqBINPUBpH-uqr/view?usp=sharing",

This didn't work and shows a white square instead of the PNG image (same size, same format).

new logo image doesn't isn't displayed in the App menu bar

I assume Google Drive is not the ideal place to store static images. Is there a simple way to store static images (e.g., the app logo) for a Google App Script?

2 Answers

If you look closely at the first url and the second, you'll see the first ends with .png which is a type of image file. Your google url is different. And as a result, requires a little more work.

You need to get a shareable link and then tweak that link to just include just the id. More through explanation here.

Related