How to tell if a user is on Mobile or Web?

Is there a way to return true if a user is on the native mobile app or if they are logged in on the web app? I am using the Webview Element to display my webapp in the Native Bubble Mobile App.

Hi @ncat , how are you?

First thing that comes to mind would be if page width is less than 600px but there might be a better way than that

Hi - Unfortunately that wont work for my use case because I still want my users to be able to use the web version on their phones through any internet browser. I want to set certain conditions only if they are on the mobile app regardless of screen size.

@ncat i think as a workaround for now maybe you could add a attribute in the users table mobile signed in with boolean value or so and add in your mobile workflow on sign in to update this value to yes or not boolean but static yes

I thought about this solution, but the problem is that my customers could also be logged in on their desktop computers at the same time, which would make this not work.

One workaround I can think of, you can use visibility detector plugin seperately for web and mobile. There are free ones in the market. Add this on your main pages on mobile and web. Then add events seperately like "when visibility detector on web enter screen, you can save this info to your database. Same for mobile

The question is what you’re trying to achive you can make an option set with 3 attributes

  1. Mobile
  2. Web
  3. Both

Link a field in user data to this option set on default its null

As said on mobile login workflow you set to mobile “when it null” otherwise you set to both
Same reverse on web login workflow you set to web “when its null” otherwose you set to both

On log out or inactivity whatever you set you clear back to null

the zeroqode webview plugin allows you to pass data through the webview - if you can detect the device type on the webview’s end, then this should work.

Could you just duplicate the page and only use one of them for mobile native’s webview? this is what i have done with my calendar.

good luck!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.