Members
(static) DataType :string
Represents the SHealth HealthConstants string representation.
Type:
Properties:
Name |
Type |
Description |
DAILY_STEP_COUNT |
string
|
|
BLOOD_PRESSURE |
string
|
|
TEMPERATURE |
string
|
|
HEART_RATE |
string
|
|
SPO2 |
string
|
|
GLUCOSE |
string
|
|
HBA1C |
string
|
|
WEIGHT |
string
|
|
FOOD_INFO |
string
|
|
FOOD_INTAKE |
string
|
|
WATER_INTAKE |
string
|
|
CAFFEINE_INTAKE |
string
|
|
EXERCISE |
string
|
|
SLEEP |
string
|
|
SLEEP_STAGE |
string
|
|
- Source:
(static) EventName :string
The window event names for events generated by SHealth
Type:
Properties:
Name |
Type |
Description |
ON_SHEALTH_PERMISSIONS |
string
|
|
ON_SHEALTH_ERROR |
string
|
|
ON_SHEALTH_RECORDS |
string
|
|
ON_SHEALTH_HISTORY |
string
|
|
- Source:
(static) HistoricalSet :string
Each Historical set is a collection of SHealth DataType that is used to fetch 6 months of corresponding data from SHealth.
Type:
Properties:
Name |
Type |
Description |
ROUTINE |
string
|
|
FITNESS |
string
|
|
- Source:
(static) SHealthError :string
The SHealth errors that can be reported through onPermissionError.
Type:
Properties:
Name |
Type |
Description |
MISSING_USER |
string
|
|
RESOLVING_CONNECTION_FAILED |
string
|
|
CONNECTION_FAILED |
string
|
|
INVALID_DATA_TYPE |
string
|
|
INVALID_PERMISSION |
string
|
|
- Source:
(static) SubscriptionSet :number
Each Subscription set is a collection of SHealth DataType that when used add subscriptions for multiple DataTypes.
Type:
Properties:
Name |
Type |
Description |
ROUTINE |
number
|
|
DIABETES |
number
|
|
WEIGHT |
number
|
|
FITNESS |
number
|
|
SLEEP |
number
|
|
NUTRITION |
number
|
|
BLOOD_PRESSURE |
number
|
|
- Source:
Methods
(static) addSubscriptions(dataTypes)
Add an array of DataType values to receive records through SHealth for.
Parameters:
Name |
Type |
Description |
dataTypes |
Array.<DataType>
|
An array of DataType to add a subscription for to receive records through SHealth. |
- Source:
(static) addSubscriptionSets(subscriptionSet)
Add an array of SubscriptionSet values to receive records through SHealth for.
Parameters:
Name |
Type |
Description |
subscriptionSet |
Array.<SubscriptionSet>
|
|
- Source:
(static) fetchHistoricalSets(historicalSets)
Parameters:
Name |
Type |
Description |
historicalSets |
Array.<HistoricalSet>
|
Array of HistoricalSet to pull 6 months of history from SHealth. Currently only
HistoricalSet.ROUTINE and HistoricalSet.FITNESS are supported. If a listener has been set using
SHealth.setSHealthListener a summary will be returned for any records pulled from history. |
- Source:
(static) getSubscriptionsFromSet()
Returns the set of #DataType associated with a #SubscriptionSet
Parameters:
Type |
Description |
SubscriptionSet
|
set - The subscription set to return data types for |
DataTypeCallback
|
success - The success callback for returning the array of datatypes |
FailCallback
|
err - The error callback |
- Source:
(static) isSHealthAvailable(callback)
Checks whether this device is an Android device and if SHealth is installed.
Parameters:
- Source:
(static) observeCurrentSubscriptions()
Starts the SHealth Service if it is not already started. It will report back gathered permissions through
onPermissionChanged with a
PermissionChangeHandler or OnPermission error with an SHealthError.
- Source:
(static) onPermissionChanged(obj)
Parameters:
- Deprecated:
- use setSHealthListener
Success callback for SHealth. Overload this function to receive notifications for SHealth Permission changes.
- Source:
(static) onPermissionError(err)
Parameters:
Name |
Type |
Description |
err |
SHealthError
|
Error from SHealth. |
- Deprecated:
- use setSHealthListener
Error callback for SHealth. Overload this function to receive notifications for SHealth Permission Errors.
- Source:
(static) removeSubscriptions(dataTypes)
Remove subscriptions to a group of DataType from SHealth.
Parameters:
Name |
Type |
Description |
dataTypes |
Array.<DataType>
|
|
- Source:
(static) removeSubscriptionSets(subscriptionSets)
Remove an array of SubscriptionSet values from SHealth.
Parameters:
Name |
Type |
Description |
subscriptionSets |
|
|
- Source:
(static) setSHealthListener(listeners)
Set a listener for SHealth events from SHealth.
Parameters:
Name |
Type |
Description |
listeners |
SHealthHandlers
|
Callbacks for events from SHealth |
- Source: