0.0.7 • Published 4 years ago

capacitor-file-storage v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

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

  1. Create a github token for your user github-token

  2. Copy the token

  3. 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>;
0.0.24

4 years ago

0.0.23

4 years ago

0.0.21

4 years ago

0.0.22

4 years ago

0.0.20

4 years ago

0.0.18

4 years ago

0.0.19

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.10

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago