Module: GoogleFit

Googe Fit integration with the Validic Platform. Using this plugin an application can request to subscribe to data changes in Google Fit on behalf of the end user.
Source:

Members

(static) DataType :string

Supported Data Types
Type:
  • string
Properties:
Name Type Description
STEP_COUNT string
DISTANCE string
NUTRITION string
WEIGHT string
HEART_RATE string
CALORIES_EXPENDED string
MOVE_MINUTES string
Source:

(static) HistoryType :string

Support History Types
Type:
  • string
Properties:
Name Type Description
SUMMARY string
Source:

Methods

(static) disconnect(callback)

Remove all subscriptions and logout Google user
Parameters:
Name Type Description
callback function
Source:

(static) fetchHistory(historyOptions, success, error)

Parameters:
Name Type Description
historyOptions HistoryOptions | Array.<HistoryType>
success function
error function
Source:

(static) hasPermissions(dataTypes, success, error)

Check if permissions for a set of datatypes has been granted by the end user
Parameters:
Name Type Description
dataTypes Array.<DataType>
success PermissionCallback
error function
Source:

(static) requestPermissions(dataTypes, success, error)

Request Permissions for a set of Data Types. If permission has already been granted this will succeed immediately with success. Permission Results will be passed back to the success function.
Parameters:
Name Type Description
dataTypes Array.<DataType>
success PermissionCallback
error function
Source:

(static) subscribe(dataTypes, success, error)

Subscribe to an array of dataTypes. These types will be persisted and subscribed to receive data updates from the Google Fit Platform. Data is automatically uploaded to the Validic Platform.
Parameters:
Name Type Description
dataTypes Array.<DataType>
success function
error function
Source:

(static) subscriptions(callback)

Retrive list of current subscriptions
Parameters:
Name Type Description
callback SubscriptionsCallback
Source:

(static) unsubscribe(dataType, success, error)

Unsubscribe from a Google Fit Data type
Parameters:
Name Type Description
dataType DataType
success function
error function
Source:

Type Definitions

HistoryOptions

Source:

PermissionCallback(result)

Parameters:
Name Type Description
result PermissionResult
Source:

PermissionResult

Permission Result
Type:
  • Object.<string, boolean>
Source:

SubscriptionsCallback(subscriptions)

Parameters:
Name Type Description
subscriptions Array.<DataType>
Source: