capacitor-file-storage v0.0.7
Capacitor file storage
The goal of this plugin is to allow mobile devices to keep files into the devices storage. The web part will store the files into the browser cache through the Cache API :
The plugin is publish to npm here
Installation into a capacitor project
1 . Install the plugin
npm install @naistro/capacitor-file-storage
2 . Update Capacitor registery
npx cap update
Testing
For testing purpose you can link directly the node package to the project you are using.
Capacitor plugin
On the capacitor plugin you have to execute:
npm link
And you need to build or watch the plugin:
npm run build
# OR
npm run watch
Project you are using
npm link capacitor-file-storage
And then you need to rebuild the project via ng build or ng serve.
Publishing a new version
Create a github token for your user
Copy the token
- log in to npm.pkg.github.com
npm login --registry=https://npm.pkg.github.com
Username: GitHub-username
Password: your-personal-access-token-from-step-2
Plugin expected API
Methods
Return the plaform where the methode has been called 'web' | 'ios' | 'android'
getPlatfrom(): Promise<string>
Return the current platform
getInfo(): Promise<Info>;
Download and save the file
writeFile(fileUrl : string): Promise<File>;
Return a specific file through via its URL
getFile(fileId : string): Promise<Response>;
List all the applications files
listFiles(): Promise<ReadonlyArray<Response>>;
Delete a specific file via its URL
deleteFile(fileId : string): Promise<boolean>;
Delete the file which is the oldest
deleteOldestFile(fileId : string): Promise<boolean>;
Delete all the files
deleteAllFiles(): Promise<boolean>;
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago