react-native-flic2 2.0.0-beta.18 → 2.0.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/Flic2.mm +12 -10
- package/package.json +1 -1
package/ios/Flic2.mm
CHANGED
|
@@ -312,6 +312,8 @@
|
|
|
312
312
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
313
313
|
[self emitOnManagerStateChange:@{
|
|
314
314
|
@"event": @"restored",
|
|
315
|
+
@"state": @(manager.state),
|
|
316
|
+
@"stateName": [self managerStateToString:manager.state],
|
|
315
317
|
@"message": @"Manager state restored"
|
|
316
318
|
}];
|
|
317
319
|
});
|
|
@@ -319,7 +321,16 @@
|
|
|
319
321
|
}
|
|
320
322
|
|
|
321
323
|
- (void)manager:(FLICManager *)manager didUpdateState:(FLICManagerState)state {
|
|
322
|
-
//
|
|
324
|
+
// Always emit stateChanged for every state change
|
|
325
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
326
|
+
[self emitOnManagerStateChange:@{
|
|
327
|
+
@"state": @(state),
|
|
328
|
+
@"stateName": [self managerStateToString:state],
|
|
329
|
+
@"event": @"stateChanged"
|
|
330
|
+
}];
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
// Additionally emit restored event when manager becomes powered on (if not already restored)
|
|
323
334
|
// This ensures the event fires on every app launch, not just during state restoration
|
|
324
335
|
if (state == FLICManagerStatePoweredOn && !self.managerRestored) {
|
|
325
336
|
self.managerRestored = YES;
|
|
@@ -332,15 +343,6 @@
|
|
|
332
343
|
@"message": @"Manager ready"
|
|
333
344
|
}];
|
|
334
345
|
});
|
|
335
|
-
} else {
|
|
336
|
-
// Emit regular state change event
|
|
337
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
338
|
-
[self emitOnManagerStateChange:@{
|
|
339
|
-
@"state": @(state),
|
|
340
|
-
@"stateName": [self managerStateToString:state],
|
|
341
|
-
@"event": @"stateChanged"
|
|
342
|
-
}];
|
|
343
|
-
});
|
|
344
346
|
}
|
|
345
347
|
}
|
|
346
348
|
|
package/package.json
CHANGED