Skip to content

Error opening file #13

@DeeSouza

Description

@DeeSouza

I'm using this plugin in the Ionic 1 and Cordova.
But when I try open a file PDF, show me error below:

file:///storage/emulated/0/Android/data/com.skill.cva/sites/a60ddc340797d3528d6b09f331d55eb0/filepool/15441800155c0a512f59672.pdf exposed beyond app through Intent.getData()

What I'm doing wrong?

var extension = $mmFS.getFileExtension(path),
mimetype = $mmFS.getMimeType(extension);

console.log('Extension', extension,  'Mimetype', mimetype);

if (ionic.Platform.isAndroid() && window.plugins.webintent) {
    var iParams = {
        action: "android.intent.action.VIEW",
        url: path,
        type: mimetype
    };

    window.plugins.webintent.startActivity(
        iParams,
        function() {
            $log.debug('Intent launched');
            deferred.resolve();
        },
        function(err) {
            $log.debug('Intent launching failed.');
            $log.debug('action: ' + iParams.action);
            $log.debug('url: ' + iParams.url);
            $log.debug('type: ' + iParams.type);

            console.log('ERR: ' + err);
        }
    )
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions