How to know if a microflow has been triggered from a native client // vs mobile browser?

1
Dear all, We are trying to implement some microflow logic where we would like to know if a request had been made from a native client, or a webapp client. Current, when using the global “currentDeviceType”, no difference is made in that variable between native mobile and web mobile → in both cases, the value is “Phone”. We would like to differentiate between Native and Web in the following flow:     We'd love your suggestions. Some additional limitations: adding an input parameter would mean refactoring 100s of elements. no javascript actions available here (MF), and we cannot embed this flow easily in a Nanoflow (With parameter), as per reason above. Is there a Java method available to check requester device type? Any other ideas?   Wouter Penris
asked
3 answers
0

Pretty difficult question because due to privacy reasons, it’s not that easy to determine whether the end-user is accessing through the Native app or via the Web version. When I google for a custom JS action to check whether it’s a browser or not, the answers are pretty straight forward:

javascript - Device/Browser Registration - Stack Overflow

php - How to detect if user is using an app or browser to access my site? - Stack Overflow

You can however develop 2 different profiles in Mendix. When you can determine which profile the end-user accesses, you can log that (end-user, profile, timing) and verify the timings with your microflow (end-user, timing).

I hope this helps you.

Kind regards,

Leander 

answered
0

Dear all,

Adding my bit after some careful research. In this case there is no easy option; we decided to create an object that is associated to System.Session upon triggering of the various user profile roles. Likewise, as long as that session remains valid, the object with the needed client info will be available anywhere. For us this meant just adding logic in a couple of places. Hope this helps the community in future ;-).

Best regards,

Wouter

answered
0

Hi,

I might see an easy solution, that if you call the microflow from a different nanoflow in web as in native, pass from that nanoflow a parameter to the microflow holding for example a string parameter “web” or “native”, Enumeration holding that value. then in your ,microflow you are aware from where the microflow is trigerred.

Hope this helps

David

answered