实现IRLDocumentScanner cocoapod,比如nativescript插件

实现IRLDocumentScanner cocoapod,比如nativescript插件,nativescript,nativescript-plugin,Nativescript,Nativescript Plugin,我正在寻找像nativescript插件这样的工具。我已经正确安装了Pod,并测试了我是否可以从irlscannervicewcontroller访问本机代码 基于对象C的文档,您已经尝试过了,但在保存时崩溃了! myScanner.ios.ts 从“/myScanner.Common”导入{Common}; 声明变量irlscannervcontroller:any 导出类myScanner扩展了公共{ 构造函数(){ 超级() } 公共createNativeView(){ const se

我正在寻找像nativescript插件这样的工具。我已经正确安装了Pod,并测试了我是否可以从
irlscannervicewcontroller
访问本机代码

基于对象C的文档,您已经尝试过了,但在保存时崩溃了! myScanner.ios.ts

从“/myScanner.Common”导入{Common};
声明变量irlscannervcontroller:any
导出类myScanner扩展了公共{
构造函数(){
超级()
}
公共createNativeView(){
const session=new AVCaptureSession();
session.sessionPreset=AVCaptureSessionPreset1280x720;
const device=AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeVideo);
常量输入=AVCaptureDeviceInput.deviceInputWithDeviceError(设备);
如果(!输入){
抛出新错误(“尝试打开相机时出错”);
}
会话.附加输入(输入);
session.startRunning();
const videoLayer=AVCaptureVideoPreviewLayer.layerWithSession(会话);
const camereraView=UIView.alloc().initWithFrame({原点:{x:0,y:0},大小:{宽度:400,高度:600});
camereraView.backgroundColor=UIColor.blueColor;
videoLayer.frame=camereraView.bounds;
camereraView.layer.addSublayer(视频层);
this.cameraView=cameraView
把这个还给我
}
公共initNativeView(){
让委托=irlscannervcontrollerdelegate.prototype
const scanner=IRLSCanneServiceController.standardCameraViewWithDelegate(委托)
scanner.PresentViewControllerInitiatedCompletion(scanner,true,null);
}
公共视图(){
}
}

您不能设置
此.nativeView
,当您在
createNativeView
中返回视图时,会自动设置此.nativeView。此外,nativeView的类型应为UIView,而不是UIViewController。如果目的是不在页面中嵌入IRLSCanneServiceWController,那么您应该有一个方法来呈现控制器。另外,您没有创建
irlscannervewcontroller
的实例,如果您不确定语法,对于IntelliSense支持,如果您更新了代码,您能帮助我吗?您现在看到了哪些错误?是否有repo?是否已更新代码并出现此错误:
NativeScript遇到致命错误:错误:应用程序试图在自身上显示模式视图控制器。显示控制器是相同的。
同样,您并没有实现一个委托,您应该从键窗口显示视图控制器。根据库中的键入验证语法。您不能设置
此.nativeView
,这是在
createNativeView
中返回视图时自动完成的。此外,nativeView的类型应为UIView,而不是UIViewController。如果目的是不在页面中嵌入IRLSCanneServiceWController,那么您应该有一个方法来呈现控制器。另外,您没有创建
irlscannervewcontroller
的实例,如果您不确定语法,对于IntelliSense支持,如果您更新了代码,您能帮助我吗?您现在看到了哪些错误?是否有repo?是否已更新代码并出现此错误:
NativeScript遇到致命错误:错误:应用程序试图在自身上显示模式视图控制器。显示控制器是相同的。
同样,您并没有实现一个委托,您应该从键窗口显示视图控制器。根据库中的键入验证语法。