Does anyone know of an appsheet function to check whether the user is accessing the app from a mobile device or a desktop device?
I’m afraid we don’t have tools for that.
Your only option is to have a user setting that they can choose, the first time they open the app, mobile/desktop… Then base views on this… But it’s a little clunky
@Jesse_Prud_Homme it would conditionally show only one action or the other based on that users device preference that they already selected in the user settings… (You would need to set up the user settings)
@Grant_Stead Ok. I suppose the issue is the user could alternate between using a mobile device or desktop. Wouldn’t want to have to go back have the user change their settings each time they switch devices. If there was a way to know which devices they were accessing from in real-time, we could design our app to be a little more accommodating and dynamic that way. This is a pretty minor issue though.
@Jesse_Prud_Homme Agreed… However, that is why i’m recommending you use USERSETTINGS (user settings lives local to the device, so they can set mobile on their phone, and desktop on their computers, and the setting will stick unless they re-install the app…)
You can even make the settings the starting view (until they’ve made the required selection) It’s actually pretty good. (and they would only need to make the selection once during app install…)
@Grant_Stead Ah! Very resourceful - I didn’t know that about usersettings - that’s definitely the solution! Thank you Grant!
Because we keep having this kind of question, I’ve started to provide this kind of contextual information via a new CONTEXT() function. At the moment, it only provides a meaningful result for CONTEXT(“Host”) — which may be exactly what you asked for in this thread. Please see the documentation here. https://help.appsheet.com/expressions/expression-types/other-functions
@praveen what! Are you just allowed to sneak in epic operations whenever you want?!?!?! Must be great!
Thanks guys. Reason I ask: I have a link to ‘email customer’ which opens gmail (instead of mail) and prefills the compose fields on a mobile device. It’s very convenient on mobile, especially on iOS when the only option is typically to use the native mail app (I’m mostly Gsuite). Issue is that on desktop the link doesn’t work. You guys have any ideas?
Can you give a different link for the desktop user?
Yes, I could give a desktop friendly link - but I’d need to know if the user is on desktop or mobile.
@Jesse_Prud_Homme sounds like something the user should setup anyway… I’d provide a few options and have the user make their selections in usersettings since those are device specific
Why can’t you give them both?
Good suggestions. I suppose I could make it a selection and provide a mobile link beside a desktop link.
@Jesse_Prud_Homme I meant they could set it up one time, choose what option they want per device via the user settings