Hello Everyone
Ok, so I'm trying to create a program that can detect whether if it is running in a mobile platform or a desktop. I found a link that uses the flags that ignition collects to see if it a mobile device.
https://docs.inductiveautomation.com/display/DOC80/system.util.getSystemFlags
In that link it suggests that by using the following code you can detect if a device is mobile by looking at the 7th position in the array which, if I understand it right, will hold an 1 or 0 to indicate if it's mobile or not.
systemFlagsList =
flags = system.util.getSystemFlags()
for i in range(7,-1,-1):
systemFlagsList.insert(0, flags >> i & 1)
if(systemFlagsList[7] == 0):
session.custom.IsMobileDevice = False
else:
session.custom.IsMobileDevice = True
This is our custom code to match our project. The custom property is linked to a button which will disappear and be disabled if it's not a mobile device. The code was also put in the Session event so that during the startup of the session it will query for the information from the device, or at least that's the theory.
It didn't do that. When we were looking into why it's not doing that, we tried using the system tags to try and work around, but we found an article that says Perspective doesn't have access to those tags.
We also tried using the system.tag.readBlocking but it didn't work. link below
https://docs.inductiveautomation.com/display/DOC81/system.tag.readBlocking
At this point we are out of ideas or links. I have no idea how to get it to work. Please advice.