ngCordova FileOpener2 Problem


#1

I am building an iOS app and I need to read a pdf.
I am following the ngCordova documentation for the FileOpener2 plugin, but nothing is happening.

I have :

module.controller('NewsCtrl', function ($cordovaFileOpener2) {

    $cordovaFileOpener2.open(
         '../img/Newsletter.pdf',
         'application/pdf'
     ).then(function() {
          console.log('Success');
     }, function(err) {
          console.log('Error' + err );
     });

});

I run it just fine, and see the success message but no app is launched. Am I missing something? Would appreciate the help.


#2

Update

I am running the app in the iOS emulator in livereload. After making changes to the files the app refreshed on the tab with the controller and got the following error.

Error: undefined is not an object (evaluating 'cordova.plugins.fileOpener2')