-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/driftyco/ionic-native
- Loading branch information
Showing
9 changed files
with
160 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import {Plugin, Cordova} from './plugin'; | ||
|
||
declare var cordova; | ||
|
||
/** | ||
* Email object for Opening Email Composer | ||
*/ | ||
export interface email { | ||
app?: string, | ||
to: string | Array<string>, | ||
cc: string | Array<string>, | ||
bcc: string | Array<string>, | ||
attachments: Array<any>, | ||
subject: string, | ||
body: string, | ||
isHtml: boolean | ||
} | ||
|
||
/** | ||
* @name Email Composer | ||
* @description | ||
* | ||
* Requires Cordova plugin: cordova-plugin-email-composer. For more info, please see the [Email Composer plugin docs](https://github.com/katzer/cordova-plugin-email-composer). | ||
* | ||
* @usage | ||
* ```ts | ||
* import {EmailComposer} from 'ionic-native'; | ||
* | ||
* | ||
* EmailComposer.isAvailable().then((available) =>{ | ||
* if(available) { | ||
* //Now we know we can send | ||
* } | ||
* }); | ||
* | ||
* let email = { | ||
* to: '[email protected]', | ||
* cc: '[email protected]', | ||
* bcc: ['[email protected]', '[email protected]'], | ||
* attachments: [ | ||
* 'file://img/logo.png', | ||
* 'res://icon.png', | ||
* 'base64:icon.png//iVBORw0KGgoAAAANSUhEUg...', | ||
* 'file://README.pdf' | ||
* ], | ||
* subject: 'Cordova Icons', | ||
* body: 'How are you? Nice greetings from Leipzig', | ||
* isHtml: true | ||
* }; | ||
* | ||
* // Send a text message using default options | ||
* EmailComposer.send(email); | ||
* | ||
* ``` | ||
*/ | ||
@Plugin({ | ||
plugin: 'cordova-plugin-email-composer', | ||
pluginRef: 'cordova.plugins.email', | ||
repo: 'https://github.com/katzer/cordova-plugin-email-composer.git', | ||
platforms: ['Android', 'iOS', 'Windows Phone 8'] | ||
}) | ||
export class EmailComposer { | ||
|
||
/** | ||
* Verifies if sending emails is supported on the device. | ||
* | ||
* @param app {string?} An optional app id or uri scheme. Defaults to mailto. | ||
* @param scope {any?} An optional scope for the promise | ||
* @returns {Promise<boolean>} Resolves promise with boolean whether EmailComposer is available | ||
*/ | ||
static isAvailable (app? : string, scope? : any) : Promise<boolean> { | ||
return new Promise<boolean>((resolve, reject) => { | ||
cordova.plugins.email.isAvailable(app, resolve, scope); | ||
}); | ||
} | ||
|
||
/** | ||
* Adds a new mail app alias. | ||
* | ||
* @param alias {string} The alias name | ||
* @param packageName {string} The package name | ||
*/ | ||
@Cordova() | ||
static addAlias(alias : string, packageName : string): void {} | ||
|
||
/** | ||
* Displays the email composer pre-filled with data. | ||
* | ||
* @param email {email} Email | ||
* @param scope {any?} An optional scope for the promise | ||
* @returns {Promise<any>} Resolves promise when the EmailComposer has been opened | ||
*/ | ||
@Cordova({ | ||
successIndex: 1, | ||
errorIndex: 3 | ||
}) | ||
static open(email : email, scope? : any) : Promise<any> {return} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import {Cordova, CordovaProperty, Plugin} from './plugin'; | ||
declare var window; | ||
@Plugin({ | ||
plugin: 'https://github.com/Initsogar/cordova-webintent.git', | ||
pluginRef: 'window.plugins.webintent', | ||
repo: 'https://github.com/Initsogar/cordova-webintent.git' | ||
}) | ||
export class WebIntent { | ||
|
||
@CordovaProperty | ||
static get ACTION_VIEW () { | ||
return window.plugins.webintent.ACTION_VIEW; | ||
} | ||
|
||
@CordovaProperty | ||
static get EXTRA_TEXT () { | ||
return window.plugins.webintent.EXTRA_TEXT; | ||
} | ||
|
||
@Cordova() | ||
static startActivity (options : {action:any,url:string}) : Promise<any> {return} | ||
|
||
@Cordova() | ||
static hasExtra (extra : any) : Promise<any> {return} | ||
|
||
@Cordova() | ||
static getExtra (extra : any) : Promise<any> {return} | ||
|
||
@Cordova() | ||
static getUri () : Promise<string> {return}; | ||
|
||
@Cordova() | ||
static onNewIntent() : Promise<string> {return}; | ||
|
||
@Cordova() | ||
static sendBroadcast(options : {action:string, extras?:{option:boolean}}) : Promise<any> {return} | ||
|
||
} |