also looking at this
fix(ios): hand the page the answers native was already sending
#222
18 files
+597
-164
| @@ -159,14 +159,17 @@ window.addEventListener('craftReady', (e) => { | ||
| 159 | 159 | console.log('Capabilities:', e.detail.capabilities); |
| 160 | 160 | }); |
| 161 | 161 | |
| 162 | // Haptic feedback | |
| 163 | window.craft.haptic('light'); // light, medium, heavy | |
| 164 | window.craft.haptic('success'); // success, warning, error | |
| 165 | window.craft.haptic('selection'); | |
| 166 | ||
| 167 | // Speech recognition | |
| 168 | window.craft.startListening(); | |
| 169 | window.craft.stopListening(); | |
| 162 | // Haptic feedback. Resolves true, and rejects with CAPABILITY_DISABLED when | |
| 163 | // enableHaptics is off. | |
| 164 | await window.craft.haptic('light'); // light, medium, heavy | |
| 165 | await window.craft.haptic('success'); // success, warning, error | |
| 166 | await window.craft.haptic('selection'); | |
| 167 | ||
| 168 | // Speech recognition. startListening resolves true once the request is | |
| 169 | // taken; whether listening actually began arrives as the events below | |
| 170 | // (craftSpeechError for a declined prompt or no recognizer). | |
| 171 | await window.craft.startListening(); | |
| 172 | await window.craft.stopListening(); | |
| 170 | 173 | |
| 171 | 174 | // Listen for speech events |
| 172 | 175 | window.addEventListener('craftSpeechStart', () => { /* recording started */ }); |