FranGhe commented on issue #1607:
URL: https://github.com/apache/cordova-ios/issues/1607#issuecomment-3954640016

   It doesn't work for me...
   
       /* OLD CODE WORKING ON cordova-ios 7.1.0 */
           console.log("******** OLD CODE *********");
           console.log("originalPath -> "+originalPath);
   
           var oldCode_PathConverted = 
window.WkWebView.convertFilePath(originalPath); 
           console.log("oldCode_PathConverted -> "+oldCode_PathConverted);
   
           var oldCode_PathUri= encodeURI(oldCode_PathConverted); 
           console.log("oldCode_PathUri -> "+oldCode_PathUri);
       
           
//liCat.find(".listImage").css({'background-image':'url("'+oldCode_PathUri+'")'});
           
       /* NEW CODE NOT WORKING ON cordova-ios 8.0.0 */
           console.log("******** NEW CODE *********");
           console.log("originalPath -> "+originalPath);
           
           window.resolveLocalFileSystemURL(originalPath, function(fileEntry) {
               console.dir(fileEntry);
               var newcode_fileEntryUrl = fileEntry.toURL();
               console.log("newcode_fileEntryUrl -> "+newcode_fileEntryUrl);
               
               var newCode_PathUri= encodeURI(newcode_fileEntryUrl); 
               console.log("newCode_PathUri -> "+newCode_PathUri);
               
               
liCat.find(".listImage").css({'background-image':'url("'+newCode_PathUri+'")'});
               if(value.imgPosition) 
liCat.find(".listImage").css({'background-position':value.imgPosition});
           });
           
           
       /* CONSOLE MESSAGES
           [Log] ******** OLD CODE ********* 
           [Log] originalPath -> 
file:///var/mobile/Containers/Data/Application/84386EEF-CADF-404F-9420-BB6ECDFEE32D/Library/NoCloud/CONT_52044_TOUR-cat_1_100.webp
 
           [Log] oldCode_PathConverted -> 
app://localhost/_app_file_/var/mobile/Containers/Data/Application/84386EEF-CADF-404F-9420-BB6ECDFEE32D/Library/NoCloud/CONT_52044_TOUR-cat_1_100.webp
 
           [Log] oldCode_PathUri -> 
app://localhost/_app_file_/var/mobile/Containers/Data/Application/84386EEF-CADF-404F-9420-BB6ECDFEE32D/Library/NoCloud/CONT_52044_TOUR-cat_1_100.webp
 
   
           [Log] ******** NEW CODE ********* 
           [Log] originalPath -> 
file:///var/mobile/Containers/Data/Application/84386EEF-CADF-404F-9420-BB6ECDFEE32D/Library/NoCloud/CONT_52044_TOUR-cat_1_100.webp
 
           [Log] FileEntry {isFile: true, isDirectory: false, name: 
"CONT_52044_TOUR-cat_1_100.webp", fullPath: "/CONT_52044_TOUR-cat_1_100.webp", 
filesystem: FileSystem, …} 
           [Log] FileEntry 
                   filesystem: FileSystem {name: "library-nosync", root: 
DirectoryEntry, __format__: function, toJSON: function}
                   fullPath: "/CONT_52044_TOUR-cat_1_100.webp"
                   isDirectory: false
                   isFile: true
                   name: "CONT_52044_TOUR-cat_1_100.webp"
                   nativeURL: 
"file:///var/mobile/Containers/Data/Application/84386EEF-CADF-404F-9420-BB6ECDFEE32D/Library/NoCloud/CONT_52044_TOUR-cat_1_100.webp"
                   Prototipo FileEntry
           [Log] newcode_fileEntryUrl -> 
app://localhost/_app_file_/var/mobile/Containers/Data/Application/84386EEF-CADF-404F-9420-BB6ECDFEE32D/Library/NoCloud/CONT_52044_TOUR-cat_1_100.webp
 
           [Log] newCode_PathUri -> 
app://localhost/_app_file_/var/mobile/Containers/Data/Application/84386EEF-CADF-404F-9420-BB6ECDFEE32D/Library/NoCloud/CONT_52044_TOUR-cat_1_100.webp
 
           [Error] Failed to load resource: Il file 
“CONT_52044_TOUR-cat_1_100.webp” non esiste.
        */
   
   As we see:
   originalPath and nativeURL inside fileEntry are the same
   oldCode_PathConverted, oldCode_PathUri, newcode_fileEntryUrl, 
newCode_PathUri are the same
   
   I'm sure that file exist because fileEntry says that exist... But on 
cordova-ios 7.1.0 it works instead of cordova-ios 8.0.0 doesn't work.
   
   Nothing else is changed in the code
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to