Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Open native camera from react native

$
0
0

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:

  1. If I run it just like that, it gives me red screen saying "invoke the method on main thread".

  2. 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.


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>