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.
Health Connect
Health Connect provides access to health and fitness data on Android devices using the MyDataHelps Android app. There are two broad types of data available through Health Connect:
- Health/Fitness Data, such as activity and vitals.
- Personal Health Record (PHR), aka medical records, from FHIR-based electronic medical record systems.
Before MyDataHelps can access any Health Connect data, the app must prompt the participant for permissions. Health Connect has a fine-grained permission system, so the participant can choose to allow/deny access to specific record types.
The suggested workflow is:
- Check that the participant is on an Android device using
getDeviceInfo().
- Check that Health Connect is supported using (using
getHealthConnectStatus and/or getHealthConnectPhrStatus).
- Prompt the participant to enable the necessary data collection (using
showHealthConnectPrompt and/or showHealthConnectPhrPrompt).
- Check which data collection is enabled (using
getHealthConnectStatus or getHealthConnectPhrStatus) to drive survey/notification logic.
- Consider adding a button/link so the participant can easily modify their Health Connect settings (using
showHealthConnectSettings).
Note
You must prompt and/or check for Health/Fitness access separately from PHR access, but they share the same settings screen. The Health Connect SDK methods will only work when accessing MyDataHelps via the native Android app, so you should check the
Current Device Information before using them.
The following Health Connect resources may be useful for understanding the different kinds of data available via Health Connect.
Show Health Connect Prompt (Native Android Only)
MyDataHelps.showHealthConnectPrompt()
Prompts the participant to allow data collection for any Health Connect data types requested by the project but not already enabled. If all requested data types 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().
Personal Health Record data requires a separate prompt, via showHealthConnectPhrPrompt.
Show Health Connect PHR Prompt (Native Android Only)
MyDataHelps.showHealthConnectPhrPrompt()
Prompts the participant to enable data collection for data associated with the participant’s Personal Health Record (PHR). It will ask for any Health Connect PHR permissions requested by MyDataHelps but not already enabled. If all requested permissions 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().
Health/Fitness data requires a separate prompt, via showHealthConnectPrompt.
Show Health Connect Settings (Native Android Only)
MyDataHelps.showHealthConnectSettings()
Opens the Health Connect configuration screen.
Get Health Connect Status (Native Android Only)
MyDataHelps.getHealthConnectStatus()
Returns information about the current Health Connect status, including which data types are requested and enabled.
Personal Health Record (PHR) data status requires a separate query, via getHealthConnectPhrStatus.
Returns
Promise<HealthConnectStatus>
Resolves to a result object containing status information.
Result Fields
result.available
bool
Indicates whether Health Connect is available on the device.
result.requestedQueryRules
string array
Lists data types the project is requesting for the participant.
result.enabledQueryRules
string array
Lists data types 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.
result.matchmakingPossible
boolean
Availability
Get Health Connect PHR Status (Native Android Only)
MyDataHelps.getHealthConnectPhrStatus()
Returns information about the current status of data collection for Personal Health Record (PHR) data, including which permissions are requested and enabled.
Health/Fitness data status requires a separate query, via getHealthConnectStatus.
Returns
Promise<HealthConnectPhrStatus>
Resolves to a result object containing status information.
Result Fields
result.available
bool
Indicates whether Health Connect PHR is available on the device.
result.requestedPermissions
string array
Lists permissions the project is requesting for the participant.
result.enabledPermissions
string array
Lists permissions the participant has enabled from among the requestedPermissions.
result.running
bool
Indicates whether Health Connect PHR 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
Show Health Connect Matchmaking Prompt (Native Android Only)
MyDataHelps.showHealthConnectMatchmakingPrompt()
Prompts the participant with the native Android matchmaking screen, which allows them to connect MyDataHelps to other health apps (and their associated devices). The matchmaking screen will show other apps that have data available that MyDataHelps has permission to read.
Note
The device will not show the prompt (making this method a no-op) if the participant has not chosen to share Health Connect data with MyDataHelps, has no apps with available data to share, or has already enabled sharing for all available apps.
Apple Health
Apple Health provides access to health and fitness data on iOS devices.
Get Apple Health Status (Native iOS Only)
MyDataHelps.getAppleHealthStatus()
Reports the status of Apple Health synchronization. Typically this will be used to update a UI sync indicator. You would indicate that the app is syncing data when the status is available AND enabled AND syncSession is not null. You can also subscribe to the Apple Health events to trigger actions based on Apple Health status updates.
Returns
Promise<AppleHealthStatusResult>
Resolves to a result object containing the Apple Health status.
Result Fields
result.available
boolean
Whether Apple Health is available on this device.
result.enabled
boolean
Whether the participant has elected to share Apple Health data with MyDataHelps.
result.syncSession
object
Information about the current data sync session. A non-null value indicates the app is in the process of syncing Apple Health data.
result.lastSyncCompletionDate
date
When the last data sync completed. If set, it means that all data types authorized by the user have completed syncing data up to the
indicated timestamp. If null, it means at least one data type has never completed a full sync.
Availability
MyDataHelps.getAppleHealthStatus().then(status => {
// update UI: show or hide sync indicator.
});
MyDataHelps.getAppleHealthStatus().then(status => {
// update UI: show or hide sync indicator.
});
{
"available": true,
"enabled": true,
"syncSession": {
"syncStartDate": "2026-03-05T15:40:15.595-0500"
},
"lastSyncCompletionDate": "2026-03-05T11:23:13.247-0500"
}
{
"available": true,
"enabled": true,
"syncSession": {
"syncStartDate": "2026-03-05T15:40:15.595-0500"
},
"lastSyncCompletionDate": "2026-03-05T11:23:13.247-0500"
}
Google Fit (Deprecated)
Note
Google Fit is being retired by Google, and these methods are only available for backwards-compatibility. Projects should use Health Connect instead.
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.