diff --git a/src/plugins/emailcomposer.ts b/src/plugins/emailcomposer.ts index 35e1f65d7..d2cb4f87e 100644 --- a/src/plugins/emailcomposer.ts +++ b/src/plugins/emailcomposer.ts @@ -64,13 +64,13 @@ 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} Resolves promise with boolean whether EmailComposer is available + * @param app {string?} An optional app id or uri scheme. + * @returns {Promise} Resolves if available, rejects if not available */ - static isAvailable (app?: string, scope?: any): Promise { + static isAvailable (app?: string): Promise { return new Promise((resolve, reject) => { - cordova.plugins.email.isAvailable(app, resolve, scope); + if (app) cordova.plugins.email.isAvailable(app, (isAvailable) => { if (isAvailable) resolve(); else reject(); }); + else cordova.plugins.email.isAvailable((isAvailable) => { if (isAvailable) resolve(); else reject(); }); }); }