also looking at this
fix(ios): hand the page the answers native was already sending
#222
18 files
+597
-164
| @@ -114,8 +114,11 @@ export interface CraftBridge { | ||
| 114 | 114 | /** |
| 115 | 115 | * Trigger haptic feedback |
| 116 | 116 | * @param style - Feedback style: 'light', 'medium', 'heavy', 'success', 'warning', 'error', 'selection' |
| 117 | * @returns On iOS, a promise that resolves `true` once UIKit has taken the | |
| 118 | * haptic, and rejects with `CAPABILITY_DISABLED` when `enableHaptics` is off. | |
| 119 | * Android returns nothing yet (#219). | |
| 117 | 120 | */ |
| 118 | haptic(style: HapticStyle): void; | |
| 121 | haptic(style: HapticStyle): Promise<boolean> | void; | |
| 119 | 122 | |
| 120 | 123 | /** |
| 121 | 124 | * Open the native share sheet. |
| @@ -189,13 +192,20 @@ export interface CraftBridge { | ||
| 189 | 192 | |
| 190 | 193 | /** |
| 191 | 194 | * Start speech recognition |
| 195 | * @returns On iOS, a promise that resolves `true` once native has taken the | |
| 196 | * request, and rejects with `CAPABILITY_DISABLED` when | |
| 197 | * `enableSpeechRecognition` is off. `true` does not mean audio is flowing: | |
| 198 | * a declined prompt or a missing recognizer still arrives as | |
| 199 | * `craftSpeechError`, and transcripts as `craftSpeechResult`. Android returns | |
| 200 | * nothing yet (#219). | |
| 192 | 201 | */ |
| 193 | startListening(): void; | |
| 202 | startListening(): Promise<boolean> | void; | |
| 194 | 203 | |
| 195 | 204 | /** |
| 196 | 205 | * Stop speech recognition |
| 206 | * @returns On iOS, a promise that resolves `true`. Android returns nothing yet (#219). | |
| 197 | 207 | */ |
| 198 | stopListening(): void; | |
| 208 | stopListening(): Promise<boolean> | void; | |
| 199 | 209 | |
| 200 | 210 | // ==================== Files ==================== |
| 201 | 211 | |
| @@ -478,8 +488,10 @@ export interface CraftBridge { | ||
| 478 | 488 | /** |
| 479 | 489 | * Vibrate with pattern |
| 480 | 490 | * @param pattern - Array of durations in ms [on, off, on, off, ...] |
| 491 | * @returns On iOS, a promise that resolves `true` once the pattern is | |
| 492 | * scheduled. Android returns nothing yet (#219). | |
| 481 | 493 | */ |
| 482 | vibrate(pattern: number[]): void; | |
| 494 | vibrate(pattern: number[]): Promise<boolean> | void; | |
| 483 | 495 | |
| 484 | 496 | /** |
| 485 | 497 | * Open URL in external browser |