GetSensor
Returns the value of a specified sensor for an iOS or iPadOS device.
Format
GetSensor ( sensorName {; option1 ; option2 } )
Parameters
sensorName
- the name of a supported sensor (see below).
option1
- optional parameter for the specified sensor.
option2
- optional parameter for the specified sensor.
Parameters in braces { } are optional.
Data type returned
text, number
Originated in version
17.0
Description
Use this function to capture information provided by sensors for an iOS or iPadOS device running FileMaker Go. For example, you can find out the distance or number of steps traveled by a user; or the acceleration, speed, heading, and attitude for a device.
Sensors
|
Returns |
Data type returned |
|
|
Battery |
|
|||
|
The battery charge level (from 0.0 to 1.0). |
number |
|
|
|
A number representing the status of the battery charge: |
number |
|
|
|
|
|
|
|
Location |
|
|||
|
The current location of a device in the format:
|
text1 |
|
|
|
The current location of a device in the format:
|
text1 |
|
|
|
|
|
|
|
Attitude, speed, and acceleration |
|
|||
|
The attitude for the device in radians in the format:
|
text1 |
|
|
|
The rotation rate of the device (in radians per second) in the format:
|
text1 |
|
|
|
The acceleration the user is giving to the device in meters per second squared (m/s2) in the format:
|
text1 |
|
|
|
The gravity acceleration in meters per second squared (m/s2) in the format:
|
text1 |
|
|
|
The speed of the device in meters per second. |
number |
|
|
|
The current direction of movement (in degrees). It returns a value from 0.0 to 359.9 degrees. |
number |
|
|
|
|
|
|
|
Magnetic |
|
|||
|
The magnetic field vector (in microteslas), with respect to the current attitude of the device, in the format:
|
text1 |
|
|
|
The orientation of the user's device (in degrees) relative to magnetic north. It returns a value from 0.0 to 359.9 degrees. |
number |
|
|
|
The orientation of the user's device (in degrees) relative to true north. It returns a value from 0.0 to 359.9 degrees. |
number |
|
|
|
|
|
|
|
Step counts |
|
|||
|
The number of steps detected by the device for the specified duration. |
number |
|
|
|
The estimated distance (in meters) traveled by the user for the specified duration. |
number |
|
|
|
The approximate number of floors ascended by the user for the specified duration. |
number |
|
|
|
The approximate number of floors descended by the user for the specified duration. |
number |
|
|
|
|
|
|
|
Air pressure |
|
|||
|
The recorded air pressure (in kilopascals). |
number |
|
|
|
|
|
|
|
List of sensors |
|
|||
|
A list of available |
text |
|
|
- The data is returned as a list of numbers separated by carriage returns.
Notes
accuracy
is a number that represents a distance in meters. The default value foraccuracy
is 100 meters.timeout
is a number that represents the longest time (in seconds) it will take to get the data. The default value fortimeout
is 10; the maximum value is 600.- The default value for
forPastSeconds
is the number of seconds since midnight. - FileMaker Go returns an empty string if the sensor is not available for the device.
- The values for
location
are the same as for the Location function. - The values for
locationValues
are the same as for the LocationValues function.
Example 1
GetSensor ( "stepCount"; 3600 )
returns 8000 if the user has taken 8000 steps in the past hour.