I am new to react native and need your help. I am new to react native I am trying to integrate blink sdk with my react native app. I have exposed a native method to react native js using RCT_EXPORT_METHOD()
. JS button click is invoking this native method. Now from this native method I want to open camera using:
/* Allocate and present the scanning view controller */
UIViewController<PPScanningViewController>* scanningViewController = [coordinator cameraViewControllerWithDelegate:self];
scanningViewController.autorotate = YES;
scanningViewController.supportedOrientations = UIInterfaceOrientationMaskAll;
Now there are two problems:
If I run it just like that, it gives me red screen saying "invoke the method on main thread".
Now to run it on main thread, I added
-(dispatch_queue_t)methodQueue { return dispatch_get_main_queue(); }
Still it is not running and saying not present in view hierarchy. Please help.