disusered / cordova-open

Open audio, video, images and more with applications installed on the user's device
MIT License
54 stars 55 forks source link

Copy to iBook does not work if iBook is not already running #42

Open gmalartre opened 8 years ago

gmalartre commented 8 years ago

Expected results: Cordova Open should be able to open a PDF and within the PDF viewer when we click 'copy to iBook' it should launch iBook then copy the file.

Actual results: Cordova Open does allow this interaction but if iBook is not open/running prior to the 'copy in iBook' button being click, the copy does not occur.

Step to reproduce: adapt this code snippet by changing var filePath:

                var sourceFilePath = cordova.file.applicationDirectory + "www" + filePath;
                cordova.plugins.disusered.open(
                        sourceFilePath,
                        function () {
                            console.log('file opened successfully');
                        },
                        function (e) {
                            alert('Error status: ' + e.status + ' - Error message: ' + e.message);
                        }
                );

make sure iBook is not running.

The bug occured for me on iOs 9.2.1 on an iPad mini.

Note that this bug also exist in cordova.plugins.fileOpener2.open.