Fitness trackers, habit apps and coaching tools built with Bolt can show the user's real step count, heart rate or weight instead of asking them to type it in. WebViewGold reads and writes Apple Health (HealthKit) on iOS and Health Connect on Android with the same two URL schemes. The code is the easy part; the store rules for health data deserve most of your attention.
From $109 one-time per platform, or let our team do it all from $698.
Approval guarantee – or money back within 14 days
No coding needed
One-time payment, free updates
24/7 human support
Made in Germany since 2014 · ISO 27001
9:41
BBolt
HealthKit and Health ConnectNow live in your pocket
App Store · Google Play Approved
How health data reaches your web app
Read a value
Navigate to readhealthkit:// plus a type: an Apple identifier such as HKQuantityTypeIdentifierStepCount on iOS, a record name such as StepsRecord on Android. The result is injected as a JavaScript variable with the same name, as a value-and-unit string (for example "8421.0 steps").
Write a value
writehealthkit://Identifier//Value saves a value, for example writehealthkit://HKQuantityTypeIdentifierStepCount//100 on iOS or writehealthkit://StepsRecord//1000 on Android. On Android the variable then reads WRITE_SUCCESS or the error text.
Platform differences
iOS: HealthKit is a WebViewGold plugin, activated with a plugin token in HealthKitEnabled (Config.swift) plus the HealthKit capability. Android: Health Connect needs Android 8.0 or newer, is built into Android 14 and later, returns today's totals, and injects "Health Connect not supported" where it is unavailable.
Prompt for Bolt
Paste this into Bolt to implement the web-app side. Review the result, publish, then test inside the WebViewGold app.
Prompt to paste into Bolt
Add health data support for our native WebViewGold app. Create a module health.ts that detects the platform from my custom user-agent tokens (WebViewGold-iOS or WebViewGold-Android) and maps "steps" to HKQuantityTypeIdentifierStepCount on iOS and StepsRecord on Android. It resets window[key], navigates to "readhealthkit://" + key and polls window[key] for up to five seconds. If the value is "Health Connect not supported" or nothing arrives, show a manual input instead. On the Today screen, show the step count labeled "from Apple Health" or "from Health Connect". Add a Save today button that upserts one row per user and day into a Supabase table daily_steps with row-level security. Add a Log a walk form that writes the entered steps with writehealthkit://HKQuantityTypeIdentifierStepCount//VALUE on iOS or writehealthkit://StepsRecord//VALUE on Android. Never include health values in analytics events.
Great work! Never coded anything but managed to work with this. Easy and fast! Also with great help from the creators!
Steps for a walking challenge, weight for a coaching program, water for a hydration tracker. Both stores want every requested type justified, so do not request everything "for later".
iOS: activate the HealthKit plugin
Request the plugin token through the contact address in the iOS docs, set HealthKitEnabled in Config.swift, add the HealthKit capability in Xcode and write both purpose strings in Info.plist: Privacy - Health Share Usage Description and Privacy - Health Update Usage Description.
Android: keep Health Connect permissions minimal
Health Connect grants access per record type, and the app can only read or write the types it requests. Check the health permissions in the Android project's manifest, keep the ones you use, and prepare the Health apps declaration in the Play Console.
Detect the platform with your user agent
Set custom user agents with distinct tokens, for example one ending in WebViewGold-iOS (useragent_iphone, useragent_ipad) and one ending in WebViewGold-Android (USER_AGENT). Your code then picks the HealthKit identifier or the Health Connect record name.
Read, show, and fall back
Trigger the read inside the app only, wait briefly for the injected variable, and show the value with a clear source ("from Apple Health"). On iOS, run several reads one after another, not in the same script tick. In a browser, offer manual entry.
Write only real data
Write values the user actually produced or entered, such as a logged walk. Writing estimates or test data into Apple Health breaks Guideline 5.1.3(ii).
Read today's steps on both platforms
One helper, two type names. Values you decide to keep go to the server side of your stack: Supabase, Firebase or your own API.
javascript
// Custom user agents: "... WebViewGold-iOS" (Config.swift), "... WebViewGold-Android" (Config.java)
var ua = navigator.userAgent;
var IN_APP = ua.indexOf("WebViewGold") !== -1;
var IS_IOS_APP = ua.indexOf("WebViewGold-iOS") !== -1;
function readSteps(callback) {
if (!IN_APP) { callback(null); return; } // browser: manual entry
var key = IS_IOS_APP ? "HKQuantityTypeIdentifierStepCount" : "StepsRecord";
window[key] = undefined;
window.location.href = "readhealthkit://" + key;
var tries = 0;
var timer = setInterval(function () {
var v = window[key];
if (v !== undefined || ++tries > 20) { // wait up to ~5 seconds
clearInterval(timer);
if (v === "Health Connect not supported") { v = undefined; }
callback(v === undefined ? null : String(v)); // e.g. "8421.0 steps"
}
}, 250);
}
Store rules for health data
Health data is the most sensitive category in both stores. Older articles cite section 27 of earlier versions of the App Store guidelines; those HealthKit rules now live mainly in 2.5.1 and 5.1.3. Read the current texts before you submit.
2.5.1
HealthKit for health and fitness only
HealthKit should be used for health and fitness purposes and integrate with the Health app, and the integration should be indicated in your app description.
5.1.3(i)
No advertising or data mining
Health data may not be used or disclosed to third parties for advertising, marketing or use-based data mining. Disclose the specific health data you collect.
5.1.3(ii)
No false data, no iCloud
Do not write false or inaccurate data into HealthKit, and do not store personal health information in iCloud.
5.1.2(i)
Consent before sharing, including AI
Sharing personal data with third parties, including third-party AI services, needs clear disclosure and explicit permission first.
Google Play
Health apps declaration
Apps using Health Connect complete the Health apps declaration in the Play Console and justify each data type. Access is reviewed per package name, and changes to the data types need a new declaration.
Google Play
One privacy policy everywhere
The privacy policy on the store listing must be the same one users reach from the privacy link in Health Connect, and it must explain how you handle health data.
Before you submit
App Privacy (Apple) and Data safety (Google) list Health and fitness data with its purpose, and whether it leaves the device. See privacy labels for web-wrapped apps.
Health values you store are protected per user and removed when the account is deleted (the account deletion guide).
Analytics and ad scripts never receive health values; remove them from health screens if in doubt.
The review notes say which screen reads Apple Health or Health Connect, what the data is used for, and include a demo account. The reviewer's device may have no health data, so describe the empty state too.
No diagnosis or treatment claims for a wellness app. Medical apps get greater scrutiny (Guideline 1.4.1) and may need regulatory clearance.
Frequently asked questions
Can a web app read Apple Health data?
Not from Safari: HealthKit has no web API. Inside a native app it can. WebViewGold reads the value natively after a readhealthkit:// call and injects it into the web app as a JavaScript variable.
Is the same code used for HealthKit and Health Connect?
The URL schemes are the same (readhealthkit:// and writehealthkit://); only the type names differ: HealthKit identifiers such as HKQuantityTypeIdentifierStepCount on iOS, record names such as StepsRecord on Android. Map them in one helper.
Will Apple reject an app that uses HealthKit?
Not if health and fitness are a real part of the app. Rejections come from HealthKit used outside health and fitness, health data used for ads, false data written to Health, and integrations that are not explained. Mention Apple Health in your description and show the integration clearly in the UI.
Where should my Bolt app store health values?
Ideally nowhere: read, display, discard. If a feature needs history, store only what it needs (for example one daily total), protect it per user, describe it in the privacy policy and delete it with the account.
Does Health Connect work on every Android phone?
It needs Android 8.0 or newer. It is built into Android 14 and later; on older versions users install the Health Connect app. Where it is not available, WebViewGold injects "Health Connect not supported", so keep a manual-entry fallback.
Three ways to get your app into the stores
Same result, different amount of work on your side. All three come with the approval guarantee and 24/7 human support.
Do it yourself
$109 per platform, one-time
The WebViewGold license: a finished Xcode or Android Studio project. Paste your URL, set name and icon, switch on features, build and submit. Free updates forever.
No Mac, no Xcode, no Android Studio: configure in the browser, we build both apps in the cloud and hand them to App Store Connect and the Play Console.
Send us your URL and icon. Our team configures, builds and delivers your app within 72 hours, white-label, with source projects. Both platforms for $1,158.