https://github.com/TeamHive/capacitor-email is a Capacitor email plugin, allowing you to send emails from Ionic 4 mobile apps. I can’t get the demo to work at all in Android Studio 3.4.1, @ionic/angular 4.0.0-beta.7 and @capacitor/core 1.1.0. I get 5 build errors like:
ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :capacitor-android-plugins.
If I try to use the sample code provided at the Github page in a starter Ionic app, I get a runtime error:
E/Capacitor/Plugin/Console: ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'requestPermission' of undefined
In my sample code below, based on the Github sample code, the console.log outputs this.email = {}, so new Email() is returning an empty object.
email: Email;
constructor() { }
ngOnInit() {
this.email = new Email();
console.log('this.email = ' + JSON.stringify(this.email));
}
async sendEmail() {
try {
await this.email.hasPermission();
} catch (e) {
await this.email.requestPermission();
}
Has anyone got this capacitor plugin to work at all?