naoki
naoki

Reputation: 1

Nativescript: iOS Utils openFile

I am working on code to open files which have been downloaded from the app, and I am using the utils.ios.openFile function. I can get the files to display on screen, however I am also getting the following warning on the console. Has anyone run into this, or have any ideas on how to resolve?

Unbalanced calls to begin/end appearance transitions for . Cannot find preview item for proxy: - mobile-application.png (0)

The following is the code I am using:

var documents = fs.knownFolders.documents();
filePath = fs.path.join(documents.path, filename);


if(fs.File.exists(filePath)){
    utilModule.ios.openFile(filePath)
    .catch(function(error){
    });
} else {
    return Promise.reject(new Error("File not Found"));
}

Upvotes: 0

Views: 458

Answers (1)

Nikolay Tsonev
Nikolay Tsonev

Reputation: 1919

You could set the filePath to the image, without using openFile(filePath) method. You could review the below-attached example.

let folder = fs.knownFolders.documents();
let path = fs.path.join(folder.path, "Test.png");
if(fs.File.exists(path )){
   image.src=path
}

Upvotes: 0

Related Questions