Opening a PDF on IOS using fileopener2 always prompts to select app


#1

I have adobe acrobat installed on my iPad. In code I have set the mime type in the fileopener2 to ‘application/pdf’ and the file is saved in a cache folder in my application directory on the device.

When I try to open the pdf from my app a small selection window with airdrop appears and I am able to select the PDF viewer to open my document. I have to select the PDF viewer every time I click on a PDF.

I keep reading that the fileopener2 will open the file using the default application on the device. Is there any way to keep from having to select the application every time a file is opened on IOS?

I am calling $cordovaFileOpener2.open(nativePath, mime)

where nativePath is the path to the file on my device and mime is a string variable set to ‘application/pdf’

I am losing my mind trying to get this to open without having to select the application every time.

Help please!


#2

how do i use fileopener2 in my ionic app?


#3

Why not use ng-pdf? https://github.com/sayanee/angularjs-pdf
Works well and not need an external app to view the pdf files.