Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71519

Issue with community send email plugin

$
0
0

@andyhb wrote:

Current behavior:
I have installed the email composer components as per the ionic documentation and the isAvailable function is not available. I have read various documents regarding this subject but cannot find any way to get the method to work.

The rest of the plugin works perfectly when sending emails on my Android device so the plugin is definitely installed and working.

Error: Uncaught (in promise): TypeError: EmailComposer.getPlugin(...).isAvailable is not a function

Expected behavior:
I would expect the isAvailable method to return true or false.

Steps to reproduce:

  1. $ ionic start myApp blank
  2. $ ionic cordova plugin add cordova-plugin-email-composer
  3. $ npm install @ionic-native/email-composer

Related code:

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

@Component({
    selector: 'app-home',
    templateUrl: 'home.page.html',
    styleUrls: ['home.page.scss']
})
export class HomePage {
    constructor(private emailComposer: EmailComposer) {}

    public canEmail: boolean = false;

    ionViewDidEnter() {
        this.emailComposer.isAvailable().then((available: boolean) => {
            if (available) {
                this.canEmail = true;
            }
        });
    }    
}

Other information:

Ionic:                                                                                                               
                                                                                                                     
   Ionic CLI                     : 5.4.2 (C:\Users\andy\AppData\Roaming\npm\node_modules\ionic)                      
   Ionic Framework               : @ionic/angular 4.11.3                                                             
   @angular-devkit/build-angular : 0.801.3                                                                           
   @angular-devkit/schematics    : 8.1.3                                                                             
   @angular/cli                  : 8.1.3                                                                             
   @ionic/angular-toolkit        : 2.0.0                                                                             
                                                                                                                     
Cordova:                                                                                                             
                                                                                                                     
   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)                                                                     
   Cordova Platforms : android 8.1.0                                                                                 
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 5 other plugins)
                                                                                                                     
Utility:                                                                                                             
                                                                                                                     
   cordova-res : not installed                                                                                       
   native-run  : 0.2.8                                                                                               
                                                                                                                     
System:                                                                                                              
                                                                                                                     
   Android SDK Tools : 26.1.1 (c:\Android\Sdk)                                                                       
   NodeJS            : v10.15.2 (C:\Program Files\nodejs\node.exe)                                                   
   npm               : 6.4.1                                                                                         
   OS                : Windows 10                                                                                    

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>