also looking at this
iOS: the health query pair — ratchet 31 → 29
#99
8 files
+922
-4
| @@ -52,7 +52,7 @@ const char craft_slice_page[] = | ||
| 52 | 52 | "var sentPdfOpen = false, sentPdfClose = false;\n" |
| 53 | 53 | "var sentDownload = false, sentWatch = false, sentSettings = false;\n" |
| 54 | 54 | "var sentBtStart = false, sentBtStop = false;\n" |
| 55 | "var sentRecStart = false, sentRecStop = false;\n" | |
| 55 | "var sentRecStart = false, sentRecStop = false, sentHealth = false;\n" | |
| 56 | 56 | "window.__craftBridgeError = function (ctx) {\n" |
| 57 | 57 | " // The message crossed Zig's escaping with a backslash, quote, and\n" |
| 58 | 58 | " // newline intact; anything mangled and this equality fails, i=7 never\n" |
| @@ -83,6 +83,10 @@ const char craft_slice_page[] = | ||
| 83 | 83 | " // usage description is present, so this is the radio's own state and\n" |
| 84 | 84 | " // not a missing class or a missing plist key. Swift answers all five\n" |
| 85 | 85 | " // unusable states with one string; this one names which.\n" |
| 86 | " if (!sentHealth && ctx && ctx.error === true && ctx.id === 107) {\n" | |
| 87 | " sentHealth = true;\n" | |
| 88 | " bridge.postMessage({t:'mobile', a:'getDeviceInfo', i:66});\n" | |
| 89 | " }\n" | |
| 86 | 90 | " if (!sentBtStart && ctx && ctx.error === true && ctx.id === 103\n" |
| 87 | 91 | " && ctx.code === 'PLATFORM_NOT_SUPPORTED') {\n" |
| 88 | 92 | " sentBtStart = true;\n" |
| @@ -187,6 +191,15 @@ const char craft_slice_page[] = | ||
| 187 | 191 | " // Nothing but a real download-and-move produces it.\n" |
| 188 | 192 | " // The recorder is running. Give it a moment of audio before stopping,\n" |
| 189 | 193 | " // or the encoder writes a container with no samples in it.\n" |
| 194 | " // Answering at all is the property: the spec's arm has no else, so an\n" | |
| 195 | " // unauthorised HealthKit left the promise pending. When it does answer\n" | |
| 196 | " // with data, unit 'count' proves the HKUnit round-tripped out through\n" | |
| 197 | " // unitFromString and back through unitString.\n" | |
| 198 | " if (!sentHealth && action === 'getHealthData' && payload\n" | |
| 199 | " && typeof payload.value === 'number' && payload.unit === 'count') {\n" | |
| 200 | " sentHealth = true;\n" | |
| 201 | " bridge.postMessage({t:'mobile', a:'getDeviceInfo', i:66});\n" | |
| 202 | " }\n" | |
| 190 | 203 | " if (!sentRecStart && action === 'startAudioRecording' && payload === true) {\n" |
| 191 | 204 | " sentRecStart = true;\n" |
| 192 | 205 | " bridge.postMessage({t:'mobile', a:'getDeviceInfo', i:62});\n" |
| @@ -359,6 +372,11 @@ const char craft_slice_page[] = | ||
| 359 | 372 | " // asserts. The stop goes out once the start has been answered.\n" |
| 360 | 373 | " bridge.postMessage({t:'mobile', a:'startBluetoothScan', i:103});\n" |
| 361 | 374 | " bridge.postMessage({t:'mobile', a:'startAudioRecording', i:105});\n" |
| 375 | " // getHealthData only. requestHealthAuthorization presents a system\n" | |
| 376 | " // sheet and simctl has no HealthKit privacy service, so it cannot be\n" | |
| 377 | " // answered without a person — the same wall scheduleNotification hits.\n" | |
| 378 | " bridge.postMessage({t:'mobile', a:'getHealthData',\n" | |
| 379 | " d: JSON.stringify({type:'steps'}), i:107});\n" | |
| 362 | 380 | " // A Tier-0 action migrated in this phase, served by Zig directly.\n" |
| 363 | 381 | " bridge.postMessage({t:'mobile', a:'getAppState', i:88});\n" |
| 364 | 382 | " // And one the shim answers by rejecting, to prove the error route.\n" |