2

I use onEdit() in Google Sheets to control users' activities. Google Sheets must work as on Desktop as on mobile device with Android. Everything works, but I can't to show any message at all on mobile device. Browser.msgBox() - don't work. Dialogs and Sidebars in G Suite Documents, example "Custom dialogs" and "Custom sidebars" work under Windows but don't work on mobile device too.

Help please, somebody!!!

As a last resort, how in script onEdit() to determine where Google Sheets was opened: on desktop or on mobile device?

tehhowch
  • 9,645
  • 4
  • 24
  • 42
  • If you want a mobile-inclusive solution, Avoid all desktop based solutions completely: msgBox, sidebars, dialogs and stuff. Only use mobile compatible solutions like `onEdit()`, custom functions,setNote() or setValue() as error, datavalidation drop downs, etc. – TheMaster Oct 10 '18 at 14:12
  • A partial workaround way : You can make a `google.script.run()` from the sidebar to check whether the side bar is open> thus checking whether the edit is on desktop/mobile. – TheMaster Oct 10 '18 at 14:30
  • Thank for quick answer. I did assume it, but hope dies last... Interesting tip, thank. But I am beginner in google script. Can you write example, please. – Alexandre Spr Oct 10 '18 at 14:44
  • Really is it simplest metod to determine platform? – Alexandre Spr Oct 10 '18 at 14:58
  • The workaround is to answer your last question(figure out whether onEdit is from mobile/desktop) and it's not really a answer. If there's a sidebar, it'll call server(using google.script.run). Mobiles won't load html and thus there is no server call. But, I don't think it's worth pursuing and I'm not gonna post that as a answer. A better way is just to avoid all desktop stuff. Or You can also develop separate a Android add-on(which is in developer preview for 5+ years: So, I don't recommend that either). Related: https://stackoverflow.com/questions/33373826 – TheMaster Oct 10 '18 at 14:58
  • I understanded. Thank you very march. – Alexandre Spr Oct 10 '18 at 15:16

0 Answers0