2

I would like to get from google-apps-scripts gmail addon the user current location. I couldn't manage to run a method from HtmlService within a card.

Is there a way to include html to a card or alternatively get geolocation within a card?

DanielM
  • 3,598
  • 5
  • 37
  • 53
  • 1
    https://developers.google.com/gsuite/add-ons/how-tos/access-user-locale – tehhowch Mar 18 '19 at 18:07
  • Thanks for this, however, I was thinking more in line of longitude, latitude – DanielM Mar 18 '19 at 19:36
  • Apps Script runs on a remote Google server, not the client device – tehhowch Mar 18 '19 at 19:49
  • I get that, but they can generate HTML that get the location, no? – DanielM Mar 18 '19 at 21:01
  • 2
    Sure. They don't give add-on developers any way to access privileged information like user location though. File a feature request in Google's public Gmail add-on issue tracker. Note that every user has the right to deny their browser the location permission, so you should be ready to handle this missing information anyway. If you want to display route or distance information based on information in an email, offer a click action that opens Google Maps in directions mode, to the location of interest. If the user wants that info, then they can get it. – tehhowch Mar 18 '19 at 21:29
  • https://issuetracker.google.com/issues/128816710 – DanielM Mar 18 '19 at 23:17
  • 2
    Even if you could get the users location. It might not be the correct one if they're on a vpn. – Cooper Mar 19 '19 at 01:27

0 Answers0