katzer / cordova-plugin-email-composer

Edit and send email messages
Apache License 2.0
343 stars 333 forks source link

EmailComposer.getPlugin.getClients is not a function #380

Open daxter44 opened 1 year ago

daxter44 commented 1 year ago

on iOS 16 simulator, where is not installed any email client I got this error when I try to call .hasClient():

TypeError: EmailComposer.getPlugin().getClients() is not a function. (In EmailComposer.getPlugin().getClients(function (apps) { resolve(apps & apps.length>0);})) EmailComposer.getPlugin().getClients() is undefined

Its look like plugin are not installed but i installed it and make sure with npm I -force And also when I run .open method I don't have any errors and nothing happens

My code :

import { EmailComposer } from '@ionic-native/email-composer/ngx';

public openEmailApp(): void { this.emailComposer.hasClient().then((hasClient) => { this.toastService.showGeneralToast('primary', 'Email works'+hasClient); }).catch((error) => {this.toastService.showGeneralToast('primary', error);});

}