如何在Ionic-v3中使用File Opener或Document Viewer Ionic Native插件?

时间:2019-02-08 06:50:49

标签: ionic-framework ionic3 ionic-native ionic-plugins

您好,我正在尝试使用Ionic-v4中的File Opener和Document Viewer插件,它工作正常,但是我在Ionic-v3中实现了TypeError。

我正在共享Ionic的配置和我们的系统。

Ionic:
   ionic (Ionic CLI)  : 4.5.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.3
   @ionic/app-scripts : 3.2.1

Cordova:
   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 7 other plugins)

System:
   Android SDK Tools : 26.1.1 (/Users/apple/Library/Android/sdk)
   ios-deploy        : 1.9.4
   NodeJS            : v10.14.1 (/usr/local/bin/node)
   npm               : 6.5.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.1 Build version 10B61

我在下面分享错误:

 [Error] ERROR – TypeError: Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordovaPropertyGet"]) is not a function. (In 'Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordovaPropertyGet"])(this, "documentsDirectory")', 'Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordovaPropertyGet"])' is an instance of Object)
TypeError: Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordovaPropertyGet"]) is not a function. (In 'Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordovaPropertyGet"])(this, "documentsDirectory")', 'Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordovaPropertyGet"])' is an instance of Object)get — index.js:697downloadOpenPdf — home.ts:46(anonymous function)callWithDebugContext — core.js:15098dispatchEvent — core.js:10004(anonymous function) — platform-browser.js:2628onInvokeTask — core.js:4751runTask — polyfills.js:3:10845invokeTask — polyfills.js:3:16802p — polyfills.js:2:27655v — polyfills.js:2:27895
    error
    View_HomePage_0 (HomePage.ngfactory.js:25)
    logError (vendor.js:15363)
    (anonymous function)
    handleError (vendor.js:1835)
    handleError (vendor.js:122728)
    dispatchEvent (vendor.js:10333)
    (anonymous function) (vendor.js:39445)
    onInvokeTask (vendor.js:5076)
    runTask (polyfills.js:3:10845)
    invokeTask (polyfills.js:3:16802)
    p (polyfills.js:2:27655)
    v (polyfills.js:2:27895)

那我该怎么办?

谢谢!

0 个答案:

没有答案