5.21.0 - $currentDeviceType does not seem to work

3
I have just upgraded to 5.21.0 and have seen some unexpected behavior when running the tablet and phone versions of my application from the modeler - the desktop pages are being displayed instead of the ones for tablet or phone To test, I created a new project and created a simple microflow as home page as shown below. From the modeler this microflow always follows the deviceType 'Desktop' branch, despite using the modeler option to run the phone version. It seems to ignore the ?profile=phone parameter in the url. As well as starting on the wrong page (which I could easily fix), this also breaks a lot of workflow in the application which splits on the device type. Has anyone else seen this? Screen capture showing device type as Desktop where profile=phone Update I have done some further testing, and it looks like the $currentDeviceType is being cached. I have seen the Desktop UI give a value of Phone, and vice versa. This makes the functionality extremely unreliable and unpredictable <iframe width="100%" height="491px" frameborder="0" src="https://modelshare.mendix.com/models/6d7430f9-5e1c-4ac5-8ac0-f95c46c9ecce/open-home-page?embed=true"></iframe> Edit: This is still an issue in 5.21.1 While I can set the initial start page for each device type, it breaks all workflow in the app which branches on the devicetype to open the correct version of a form UPDATE: This seems to be fixed in release 5.21.2
asked
7 answers
5

Thanks for bringing this to our attention. Release 6.2.0, which comes out at the end of this month, fixes this.

answered
3

I was able to reproduce the issue in 5.21.0. It seems to be a bug in the server mechanism where it tries to determine the device type based on the user agent string, or the profile parameter in the url.

If the device type is not yet determined the server seems to default to the desktop device type in the home page microflow. Even on actual mobile devices. This only happens in the home page microflow when visiting the page for the first time or when changing profile.

Please file a ticket, to receive updates about the progress of the fix.

P.S. if you just want to open a different home page for every device type, you could set the device type specific home pages in Navigation instead of using a microflow.

answered
2

Still broken in version 6.2.0 Homepage works fine (after login flow). All other pages still detected with 'Desktop' value in $currentDeviceType.

answered
1

I recreated your scenario with 5.21 but didn't experience your issues. The only difference is I didn't try to do it on load of the home page from logging in; I pressed an Action button. I recorded a gif to send you demonstrating but I can't put that in the forum.

answered
0
  As my idea, I think mendix tool provide resolution like phone, tablet etc. but it's not real phone browser. I think you might try to change user

agent in your browser via user-agent switcher (https://chrome.google.com/webstore/detail/user-agent-switcher/ffhkkpnppgnfaobgihpdblnhmmbodake?hl=en)

Refer Mendix view app: This is not an iPhone simulator but just a resized view surrounded with an iPhone image to give an impression of what the app might look like on a phone.

answered
0

Still broken in Mendix 7.21

answered
0

Its not working in version 8.9.0 also. Does anyone get this work ?

 

As I am unable to fetch the currentDeviceType as Phone . It always fetches Desktop even if running on Phone browser

answered