Commit 33a5918
fix(android,ios): Fix shake detection lifecycle bugs
- iOS: Remove manual `hasListeners = YES` from `enableShakeDetection`;
the flag is managed by `startObserving`/`stopObserving` exclusively.
Setting it manually could cause spurious events when no JS listeners
are registered.
- Android: `removeListeners` has no event-type context so it incorrectly
decremented the shake counter on any listener removal (e.g. frame/log
events), prematurely stopping shake detection. Move shake detection
management to `enableShakeDetection`/`disableShakeDetection` which are
explicitly called from JS and carry clear intent.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent cfcb5c7 commit 33a5918
2 files changed
Lines changed: 5 additions & 18 deletions
Lines changed: 5 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | 128 | | |
130 | 129 | | |
131 | 130 | | |
| |||
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | 209 | | |
218 | 210 | | |
219 | 211 | | |
220 | 212 | | |
221 | 213 | | |
222 | 214 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
227 | 218 | | |
228 | 219 | | |
229 | 220 | | |
| |||
254 | 245 | | |
255 | 246 | | |
256 | 247 | | |
257 | | - | |
258 | | - | |
259 | | - | |
| 248 | + | |
260 | 249 | | |
261 | 250 | | |
262 | 251 | | |
263 | | - | |
264 | | - | |
| 252 | + | |
265 | 253 | | |
266 | 254 | | |
267 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
326 | 325 | | |
327 | 326 | | |
328 | 327 | | |
| |||
0 commit comments