[warn] The bundledWebRuntime configuration option has been deprecated. Can be
safely deleted.
π Capacitor Doctor π
Latest Dependencies:
@capacitor/cli: 6.0.0
@capacitor/core: 6.0.0
@capacitor/android: 6.0.0
@capacitor/ios: 6.0.0
Installed Dependencies:
@capacitor/cli: 6.0.0
@capacitor/core: 6.0.0
@capacitor/android: 6.0.0
@capacitor/ios: 6.0.0
[success] iOS looking great! π
[success] Android looking great! π
package.json
"dependencies": {
"@awesome-cordova-plugins/core": "^6.7.0",
"@awesome-cordova-plugins/file-opener": "^6.7.0",
"@capacitor/android": "^6.0.0",
"@capacitor/core": "^6.0.0",
"@capacitor/filesystem": "^6.0.0",
"@capacitor/ios": "^6.0.0",
"cordova-plugin-file-opener2": "^4.0.0",
"jetifier": "^2.0.0"
},
"devDependencies": {
"@capacitor/cli": "^5.7.2"
},
Podfile
def capacitor_pods
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
end
JS code:
async saveFileToFilesystem(fileName, base64Data) {
const timestamp = Date.now();
try {
const savedFile = await Filesystem.writeFile({
path: timestamp + "_" + fileName,
data: base64Data,
directory: Directory.Documents,
});
return savedFile.uri;
} catch (e) {
alert("Unable to write file: " + e);
return false;
}
},
Info.plist
<key>UIFileSharingEnabled</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>NSDocumentsFolderUsageDescription</key>
<string>App wants to access your documents folder</string>
<key>NSDownloadsFolderUsageDescription</key>
<string>App wants to access your downloads folder</string>
I also have PrivacyInfo.xcprivacy file just like described in the capacitorjs documentation.
And when trying to download a file on ios app I get this error:
Unable to write file: Error: "Filesystem" plugin is not implemented on ios
It works on Android.
It feels I have enabled everything there is to enable for file permissions, but it isnβt working.