File tree Expand file tree Collapse file tree 4 files changed +8
-0
lines changed
Expand file tree Collapse file tree 4 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ ARKit.propTypes = {
166166 planeDetection : PropTypes . bool ,
167167 lightEstimation : PropTypes . bool ,
168168 onPlaneDetected : PropTypes . func ,
169+ onFrameUpdate : PropTypes . func ,
169170 onPlaneUpdate : PropTypes . func ,
170171 onTrackingState : PropTypes . func ,
171172 onTapOnPlaneUsingExtent : PropTypes . func ,
Original file line number Diff line number Diff line change 3535@property (nonatomic , assign ) BOOL lightEstimation;
3636
3737@property (nonatomic , copy ) RCTBubblingEventBlock onPlaneDetected;
38+ @property (nonatomic , copy ) RCTBubblingEventBlock onFrameUpdate;
3839@property (nonatomic , copy ) RCTBubblingEventBlock onPlaneUpdate;
3940@property (nonatomic , copy ) RCTBubblingEventBlock onTrackingState;
4041@property (nonatomic , copy ) RCTBubblingEventBlock onTapOnPlaneUsingExtent;
Original file line number Diff line number Diff line change @@ -378,6 +378,11 @@ - (void)session:(ARSession *)session didUpdateFrame:(ARFrame *)frame {
378378 [sessionDelegate session: session didUpdateFrame: frame];
379379 }
380380 }
381+ if (self.onFrameUpdate ) {
382+ dispatch_async (dispatch_get_main_queue (), ^{
383+ self.onFrameUpdate (@{});
384+ });
385+ }
381386}
382387
383388- (void )session : (ARSession *)session cameraDidChangeTrackingState : (ARCamera *)camera {
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ - (NSDictionary *)constantsToExport
3737RCT_EXPORT_VIEW_PROPERTY(onPlaneDetected, RCTBubblingEventBlock)
3838RCT_EXPORT_VIEW_PROPERTY(onPlaneUpdate, RCTBubblingEventBlock)
3939RCT_EXPORT_VIEW_PROPERTY(onTrackingState, RCTBubblingEventBlock)
40+ RCT_EXPORT_VIEW_PROPERTY(onFrameUpdate, RCTBubblingEventBlock)
4041RCT_EXPORT_VIEW_PROPERTY(onEvent, RCTBubblingEventBlock)
4142
4243RCT_EXPORT_METHOD(pause:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) {
You can’t perform that action at this time.
0 commit comments