You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/01/06 04:19:51 UTC

[GitHub] [cordova-plugin-file] JaosnHsieh commented on issue #392: required info.plist adjustments are within scope of using this plugin but not discussed

JaosnHsieh commented on issue #392:
URL: https://github.com/apache/cordova-plugin-file/issues/392#issuecomment-1006272967


   Thank you so much! After adding these 2 setting to the `x-info.plist` file. 
   Now I can see a my application name's folder and files wrote by  `cordova-file-plugin` in iOS 12 built-in app `Files`!!!
   
   `/platforms/ios/x-Info.plist`
   
   ```
   	<key>UIFileSharingEnabled</key>
   	<true/>
   	<key>LSSupportsOpeningDocumentsInPlace</key>
   	<true/>
   ```
   
   
   write file testing script can be used in Safari dev console
   
   ```
   window.resolveLocalFileSystemURL(
     cordova.file.documentsDirectory,
     function(fs) {
       console.log(
         `$ file system opened cordova.file.dataDirectory ${cordova.file.documentsDirectory} fs.name ${fs.name}`,
       );
       const fileName = `123-test-${Math.random().toString()[3]}.json`;
       console.log(`$ opening ${fileName}`);
       fs.getFile(fileName, { create: true, exclusive: false }, function(fileEntry) {
         console.log(`$ opened fileName ${fileName}`);
         console.log(`$ fileEntry.createWriter`, fileEntry.createWriter);
         fileEntry.createWriter(function(fileWriter) {
           console.log(`$ fileWriter`, fileWriter);
           fileWriter.fileName = fileName;
           fileWriter.onwriteend = function() {
             console.log('$  Successful file write... fileEntry.fullPath', fileEntry.fullPath);
             alert(fileEntry.fullPath);
           };
   
           fileWriter.onerror = function(e) {
             console.error('$ Failed file write: ' + e.toString());
           };
   
           fileWriter.write(new Blob(['{}'], { type: 'text/plain' }));
         });
       });
     },
     err => {
       console.error(`$ resolveLocalFileSystemURL err`, err);
     },
   );
   
   ```
   
   
   iPhone 6 
   iOS 12
   "cordova": "^10.0.0"
   "cordova-ios": "^6.1.1"
   "cordova-plugin-file": "^6.0.2"
       


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org