Skip to content

Commit

Permalink
feat(save-dialog): add plugin (#4618)
Browse files Browse the repository at this point in the history
* smtp-client

* fix plugin ref

* cloud settings

* + save-dialog

---------

Co-authored-by: Daniel Sogl <[email protected]>
  • Loading branch information
marysuon and danielsogl authored Aug 11, 2023
1 parent 6d42ef5 commit 91dd8bd
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
* [GCDWebServer](plugins/gcdwebserver.md)
* [Smtp Client](plugins/smtp-client.md)
* [Cashfree PG](plugins/cashfree-pg/README.md)
* [Save Dialog](plugins/save-dialog/README.md)
* [Installation](installation.md)
* [FAQ](faq.md)

18 changes: 18 additions & 0 deletions docs/plugins/save-dialog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Save Dialog

```text
$ ionic cordova plugin add cordova-plugin-save-dialog
$ npm install @awesome-cordova-plugins/save-dialog
```

## [Usage Documentation](https://danielsogl.gitbook.io/awesome-cordova-plugins/plugins/save-dialog/)

Plugin Repo: [https://github.com/Amphiluke/cordova-plugin-save-dialog](https://github.com/Amphiluke/cordova-plugin-save-dialog)

This Cordova plugin displays the native Save dialog which allows users to store a file in the selected location.

## Supported platforms

* Android
* iOS

20 changes: 20 additions & 0 deletions docs/plugins/save-dialog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Save Dialog

```text
$ ionic cordova plugin add cordova-plugin-save-dialog
$ npm install @awesome-cordova-plugins/save-dialog
```

## [Usage Documentation](https://danielsogl.gitbook.io/awesome-cordova-plugins/plugins/save-dialog/)

Plugin Repo: [https://github.com/Amphiluke/cordova-plugin-save-dialog](https://github.com/Amphiluke/cordova-plugin-save-dialog)

This Cordova plugin displays the native Save dialog which allows users to store a file in the selected location.

## Supported platforms

* Android
* iOS



5 changes: 1 addition & 4 deletions docs/plugins/smtp-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@ Plugin Repo: [https://github.com/CWBudde/cordova-plugin-smtp-client](https://git
## Supported platforms

- Android
- iOS



- iOS
42 changes: 42 additions & 0 deletions src/@awesome-cordova-plugins/plugins/save-dialog/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Injectable } from '@angular/core';
import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-plugins/core';

/**
* @name SaveDialog
* @description
* Plugin displays the native Save dialog which allows users to store a file in the selected location.
* @usage
* ```typescript
* import { SaveDialog } from '@awesome-cordova-plugins/save-dialog';
*
* constructor(private saveDialog: SaveDialog) { }
*
* ...
*
* this.saveDialog.saveFile(blob, fileName);
*
* ```
*/
@Plugin({
pluginName: 'SaveDialog',
plugin: 'cordova-plugin-save-dialog',
pluginRef: 'SaveDialog',
repo: 'https://github.com/Amphiluke/cordova-plugin-save-dialog',
platforms: ['Android', 'iOS'],
})
@Injectable({
providedIn: 'root',
})
export class SaveDialog extends AwesomeCordovaNativePlugin {
/**
* Creates a PDF using a URL, it download the document into an in memory Webkit object, and renders it into a PDF.
*
* @param url {string} URL to create a PDF from
* @param options {PDFGeneratorOptions} options for PDF generation
* @returns {Promise<string>}
*/
@Cordova({ otherPromise: true })
saveFile(blob: Blob, fileName?: string): Promise<string> {
return;
}
}

0 comments on commit 91dd8bd

Please sign in to comment.