@ionic-native/email-composer
Advanced tools
Comparing version 3.14.0 to 4.0.0-beta.1
import { IonicNativePlugin } from '@ionic-native/core'; | ||
export interface EmailComposerOptions { | ||
/** | ||
* App to send the email with | ||
*/ | ||
app?: string; | ||
/** | ||
* Email address(es) for To field | ||
*/ | ||
to?: string | Array<string>; | ||
/** | ||
* Email address(es) for CC field | ||
*/ | ||
cc?: string | Array<string>; | ||
/** | ||
* Email address(es) for BCC field | ||
*/ | ||
bcc?: string | Array<string>; | ||
attachments?: Array<any>; | ||
/** | ||
* File paths or base64 data streams | ||
*/ | ||
attachments?: string[]; | ||
/** | ||
* Subject of the email | ||
*/ | ||
subject?: string; | ||
/** | ||
* Email body (for HTML, set isHtml to true) | ||
*/ | ||
body?: string; | ||
/** | ||
* Indicates if the body is HTML or plain text | ||
*/ | ||
isHtml?: boolean; | ||
@@ -51,3 +75,14 @@ } | ||
* this.emailComposer.open(email); | ||
* ``` | ||
* | ||
* You can also assign aliases to email apps | ||
* ```ts | ||
* // add alias | ||
* this.email.addAlias('gmail', 'com.google.android.gm'); | ||
* | ||
* // then use alias when sending email | ||
* this.email.open({ | ||
* app: 'gmail', | ||
* ... | ||
* }); | ||
* ``` | ||
@@ -66,2 +101,12 @@ * @interfaces | ||
/** | ||
* Request permission to access email accounts information | ||
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted | ||
*/ | ||
requestPermission(): Promise<boolean>; | ||
/** | ||
* Checks if the app has a permission to access email accounts information | ||
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted | ||
*/ | ||
hasPermission(): Promise<boolean>; | ||
/** | ||
* Adds a new mail app alias. | ||
@@ -68,0 +113,0 @@ * |
52
index.js
@@ -61,3 +61,14 @@ var __extends = (this && this.__extends) || (function () { | ||
* this.emailComposer.open(email); | ||
* ``` | ||
* | ||
* You can also assign aliases to email apps | ||
* ```ts | ||
* // add alias | ||
* this.email.addAlias('gmail', 'com.google.android.gm'); | ||
* | ||
* // then use alias when sending email | ||
* this.email.open({ | ||
* app: 'gmail', | ||
* ... | ||
* }); | ||
* ``` | ||
@@ -67,3 +78,3 @@ * @interfaces | ||
*/ | ||
var EmailComposer = (function (_super) { | ||
var EmailComposer = EmailComposer_1 = (function (_super) { | ||
__extends(EmailComposer, _super); | ||
@@ -82,3 +93,3 @@ function EmailComposer() { | ||
if (app) { | ||
cordova.plugins.email.isAvailable(app, function (isAvailable) { | ||
EmailComposer_1.getPlugin().isAvailable(app, function (isAvailable) { | ||
if (isAvailable) { | ||
@@ -93,3 +104,3 @@ resolve(); | ||
else { | ||
cordova.plugins.email.isAvailable(function (isAvailable) { | ||
EmailComposer_1.getPlugin().isAvailable(function (isAvailable) { | ||
if (isAvailable) { | ||
@@ -106,2 +117,12 @@ resolve(); | ||
/** | ||
* Request permission to access email accounts information | ||
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted | ||
*/ | ||
EmailComposer.prototype.requestPermission = function () { return; }; | ||
/** | ||
* Checks if the app has a permission to access email accounts information | ||
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted | ||
*/ | ||
EmailComposer.prototype.hasPermission = function () { return; }; | ||
/** | ||
* Adds a new mail app alias. | ||
@@ -135,2 +156,20 @@ * | ||
__decorate([ | ||
Cordova({ | ||
successIndex: 0, | ||
errorIndex: 2 | ||
}), | ||
__metadata("design:type", Function), | ||
__metadata("design:paramtypes", []), | ||
__metadata("design:returntype", Promise) | ||
], EmailComposer.prototype, "requestPermission", null); | ||
__decorate([ | ||
Cordova({ | ||
successIndex: 0, | ||
errorIndex: 2 | ||
}), | ||
__metadata("design:type", Function), | ||
__metadata("design:paramtypes", []), | ||
__metadata("design:returntype", Promise) | ||
], EmailComposer.prototype, "hasPermission", null); | ||
__decorate([ | ||
Cordova(), | ||
@@ -150,8 +189,8 @@ __metadata("design:type", Function), | ||
], EmailComposer.prototype, "open", null); | ||
EmailComposer = __decorate([ | ||
EmailComposer = EmailComposer_1 = __decorate([ | ||
Plugin({ | ||
pluginName: 'EmailComposer', | ||
plugin: 'cordova-plugin-email', | ||
plugin: 'cordova-plugin-email-composer', | ||
pluginRef: 'cordova.plugins.email', | ||
repo: 'https://github.com/hypery2k/cordova-email-plugin', | ||
repo: 'https://github.com/katzer/cordova-plugin-email-composer', | ||
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows'] | ||
@@ -161,2 +200,3 @@ }) | ||
export { EmailComposer }; | ||
var EmailComposer_1; | ||
//# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"EmailComposerOptions":{"__symbolic":"interface"},"EmailComposer":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@ionic-native/core","name":"IonicNativePlugin"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Plugin"},"arguments":[{"pluginName":"EmailComposer","plugin":"cordova-plugin-email","pluginRef":"cordova.plugins.email","repo":"https://github.com/hypery2k/cordova-email-plugin","platforms":["Amazon Fire OS","Android","Browser","iOS","Windows"]}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"isAvailable":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"CordovaCheck"}}]}],"addAlias":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","name":"any"}}]}],"open":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","name":"any"},"arguments":[{"successIndex":1,"errorIndex":3}]}]}]}}}},{"__symbolic":"module","version":1,"metadata":{"EmailComposerOptions":{"__symbolic":"interface"},"EmailComposer":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@ionic-native/core","name":"IonicNativePlugin"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Plugin"},"arguments":[{"pluginName":"EmailComposer","plugin":"cordova-plugin-email","pluginRef":"cordova.plugins.email","repo":"https://github.com/hypery2k/cordova-email-plugin","platforms":["Amazon Fire OS","Android","Browser","iOS","Windows"]}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"isAvailable":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"CordovaCheck"}}]}],"addAlias":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","name":"any"}}]}],"open":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","name":"any"},"arguments":[{"successIndex":1,"errorIndex":3}]}]}]}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"EmailComposerOptions":{"__symbolic":"interface"},"EmailComposer":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@ionic-native/core","name":"IonicNativePlugin"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Plugin"},"arguments":[{"pluginName":"EmailComposer","plugin":"cordova-plugin-email-composer","pluginRef":"cordova.plugins.email","repo":"https://github.com/katzer/cordova-plugin-email-composer","platforms":["Amazon Fire OS","Android","Browser","iOS","Windows"]}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"isAvailable":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"CordovaCheck"}}]}],"requestPermission":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"successIndex":0,"errorIndex":2}]}]}],"hasPermission":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"successIndex":0,"errorIndex":2}]}]}],"addAlias":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"open":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"successIndex":1,"errorIndex":3}]}]}]}}}},{"__symbolic":"module","version":1,"metadata":{"EmailComposerOptions":{"__symbolic":"interface"},"EmailComposer":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@ionic-native/core","name":"IonicNativePlugin"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Plugin"},"arguments":[{"pluginName":"EmailComposer","plugin":"cordova-plugin-email-composer","pluginRef":"cordova.plugins.email","repo":"https://github.com/katzer/cordova-plugin-email-composer","platforms":["Amazon Fire OS","Android","Browser","iOS","Windows"]}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"isAvailable":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"CordovaCheck"}}]}],"requestPermission":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"successIndex":0,"errorIndex":2}]}]}],"hasPermission":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"successIndex":0,"errorIndex":2}]}]}],"addAlias":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"open":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"successIndex":1,"errorIndex":3}]}]}]}}}}] |
{ | ||
"name": "@ionic-native/email-composer", | ||
"version": "3.14.0", | ||
"version": "4.0.0-beta.1", | ||
"description": "Ionic Native - Native plugins for ionic apps", | ||
@@ -5,0 +5,0 @@ "module": "index.js", |
@@ -1,2 +0,2 @@ | ||
<a style="float:right;font-size:12px;" href="http://github.com/ionic-team/ionic-native/edit/master/src/@ionic-native/plugins/email-composer/index.ts#L27"> | ||
<a style="float:right;font-size:12px;" href="http://github.com/ionic-team/ionic-native/edit/master/src/@ionic-native/plugins/email-composer/index.ts#L45"> | ||
Improve this doc | ||
@@ -8,3 +8,3 @@ </a> | ||
``` | ||
$ ionic cordova plugin add cordova-plugin-email | ||
$ ionic cordova plugin add cordova-plugin-email-composer | ||
$ npm install --save @ionic-native/email-composer | ||
@@ -15,3 +15,3 @@ ``` | ||
Plugin Repo: [https://github.com/hypery2k/cordova-email-plugin](https://github.com/hypery2k/cordova-email-plugin) | ||
Plugin Repo: [https://github.com/katzer/cordova-plugin-email-composer](https://github.com/katzer/cordova-plugin-email-composer) | ||
@@ -18,0 +18,0 @@ Requires Cordova plugin: cordova-plugin-email-composer. For more info, please see the [Email Composer plugin docs](https://github.com/hypery2k/cordova-email-plugin). |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21695
317
2