I have tried using the FileOpener class of ionic-native
and am able to open files only when I specify full path to the file but that full path keeps on changing with device so I need an absolute path to www/build
directory.I have already read this thread but it is not of good help to me. I want to open a pdf file stored locally in build folder with the native pdf reader application present in the device.
.ts file
openPDF(url) { FileOpener.open(url,'application/pdf'); }
.html file
<button (click)="openPDF('build/pdf/AssignmentB.pdf')">Open pdf</button>
package.json file
Note:- This is my first time I am interacting in forums so sorry if I have missed out something.