Native Device Data Settings

These methods allow you to interact with native device data collection screens/settings on mobile devices. They are only available from the indicated MyDataHelps mobile apps.


Show Health Connect Prompt (Native Android Only)

MyDataHelps.showHealthConnectPrompt()

Prompts the participant to allow data collection for any Health Connect query rules that are requested by the project and not already enabled. If all requested query rules are already enabled, this method will do nothing.

If the participant has denied the request twice, the MyDataHelps app is not permitted to prompt them again. In that case, calling this method will show the Health Connect configuration screen, equivalent to calling showHealthConnectSettings().

This will only work when accessing MyDataHelps via the native Android app, so you should check the Current Device Information before attempting it.

Availability

MyDataHelps Views
MyDataHelps Embeddables
Web View Steps


Show Health Connect Settings (Native Android Only)

MyDataHelps.showHealthConnectSettings()

Opens the Health Connect configuration screen. This will only work when accessing MyDataHelps via the native Android app, so you should check the Current Device Information before attempting it.

Availability

MyDataHelps Views
MyDataHelps Embeddables
Web View Steps


Get Health Connect Status (Native Android Only)

MyDataHelps.getHealthConnectStatus()

Returns information about the current Health Connect status, including which query rules are requested and enabled. This will only work when accessing MyDataHelps via the native Android app, so you should check the Current Device Information before attempting it.

Returns

Promise<HealthConnectStatus>

Resolves to a result object containing status information.

result.available bool

Indicates whether Health Connect is available on the device.

result.requestedQueryRules string array

Lists query rules the project is requesting for the participant.

result.enabledQueryRules string array

Lists query rules the participant has enabled from among the requestedQueryRules.

result.running bool

Indicates whether Health Connect is currently syncing data.

result.lastPrompted date

Last time the prompt (or settings screen, if prompting was not allowed) was shown to the participant for this project, in ISO8601 format.

Availability

MyDataHelps Views
MyDataHelps Embeddables
Web View Steps


Show Google Fit Settings (Native Android Only)

MyDataHelps.showGoogleFitSettings()

Opens the Google Fit configuration screen. This will only work when accessing MyDataHelps via the native Android app, so you should check the Current Device Information before attempting it.

Availability

MyDataHelps Views
MyDataHelps Embeddables
Web View Steps