Document Viewer documentation not working


#1

So I followed the documentations;

firstly I changed

import { DocumentViewer } from ‘@ionic-native/document-viewer’;

to

import { DocumentViewer , DocumentViewerOptions} from ‘@ionic-native/document-viewer’;

not sure if that is correct.

But when I try to add the options

  
     const options: DocumentViewerOptions = {
         title: '',
        }
        

It says it is not assignable to type. What am I doing wrong?


#2

Is this in https://ionicframework.com/docs/native/document-viewer/#Usage?[quote=“insightmichael, post:1, topic:94670”]
What am I doing wrong?
[/quote]

Did you follow the instructions and https://ionicframework.com/docs/native/#Add_Plugins_to_Your_App_Module?


#3

I added DocumentViewer not DocumentViewerOptions as well. Should I be doing this?


#4

What does the Usage example do?


#5

Just DocumentViewer. I know there is some active development going on git-hub for this module today.

If I don’t include DocumentViewerOptions, it isn’t referenced correctly.

Have you tried setting this up from the docs yourself? I am not sure they are correct or if the module works. Th
ink it is newly built.


#6

No.

This is the current code (which also includes it’s matching documentation):
https://github.com/ionic-team/ionic-native/blob/master/src/%40ionic-native/plugins/document-viewer/index.ts


#7

I tested it in a blank project and you are right.

  1. Import of DocumentViewerOptions is missing.
  2. The object from the example doesn’t work.

Please create an issue at the ionic-native repo.


#8

Here is the issue/PR that introduced the problems: https://github.com/ionic-team/ionic-native/issues/1565
Include that in your issue.


#9

Thanks, I have seen this. I don’t think I am going to use this plugin as it opens up more problems.

see Android build fail. Execution failed for task Multiple dex files


#10

I submitted an issue: https://github.com/ionic-team/ionic-native/issues/1706