Skip to content
This repository was archived by the owner on Sep 15, 2021. It is now read-only.
This repository was archived by the owner on Sep 15, 2021. It is now read-only.

Bug: Email Composer will not open #1178

@ozziexsh

Description

@ozziexsh

Tested on Nexus 5 running Android 5.1.1

Followed the exact steps from the ngcordova docs:

cordova plugin add https://github.com/katzer/cordova-plugin-email-composer.git

And then in a controller

.controller('TestCtrl', function($cordovaEmailComposer) {
  var vm = this;

  vm.open = function() {
    document.addEventListener('deviceready', function () {
      $cordovaEmailComposer.isAvailable().then(function() {
      var email = {
            to: '',
                cc: '',
            bcc: [],
            attachments: [],
            subject: 'Spray Record Data',
            body: 'Data collected from the Spray Record app'
          };

         $cordovaEmailComposer.open(email).then(null, function () {
           alert('Email cancelled');
         });
        }, function () {
            alert('You do not have an email client set up.');
        });
    }, false);
  }
});

And a button in the html that triggers that function. All that gets called is 'You do not have an email set up'.

If I take out the $cordovaEmailComposer.isAvailable() it still doesn't work.

Not too sure what's going on here.

Activity

viktorlorentz

viktorlorentz commented on Mar 3, 2016

@viktorlorentz

Seems to be an issue wit the new plugin version (0.8.3).
I fixed it by reverting to 0.8.2. (Edit: At least on Android)
cordova plugin add https://github.com/katzer/cordova-plugin-email-composer.git#0.8.2

ozziexsh

ozziexsh commented on Mar 3, 2016

@ozziexsh
Author

Yup that did the trick. Thanks @viktorlorentz.

Not going to close as it's obviously still an issue with the current release, unless this should be posted to the repo of the plugin instead of ng-cordova.

CheetahDev

CheetahDev commented on Mar 4, 2016

@CheetahDev

+1

yadavgn

yadavgn commented on May 29, 2016

@yadavgn

+1,
I have tried this on Sony experia z ; Android 5.1
plugin version 0.8.3 didn't worked but version 0.8.2 works fine.

micschk

micschk commented on Jun 10, 2016

@micschk

+1

ghost

ghost commented on Jun 23, 2016

@ghost

+1 Thank you. meet the exactly same problem. In android, 0.8.3 didn't worked but 0.8.2 works fine.

bennettstuart

bennettstuart commented on Jun 28, 2016

@bennettstuart

Probably a silly question but...

I've just removed version 0.8.3, how do I get the previous 0.8.2?

I tried:
$ cordova plugin add cordova-plugin-email-composer@0.8.2
and got:

Fetching plugin "cordova-plugin-email-composer@0.8.2" via npm
Error: Failed to fetch plugin cordova-plugin-email-composer@0.8.2 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: version not found: cordova-plugin-email-composer@0.8.2
ghost

ghost commented on Jun 28, 2016

@ghost

Try the full URL to see how's go.
cordova plugin add https://github.com/katzer/cordova-plugin-email-composer.git#0.8.2

bennettstuart

bennettstuart commented on Jun 28, 2016

@bennettstuart

@linkchiu Thanks, worked perfectly.

However, this has not solved the issue for me.

I've copied @Nehero 's code, with a simple ng-click on a button firing his code.
The function fires but nothing happens on my device.

I have 0.8.2 version of the plugin. I'm on Android 6.0 on MotoG V3 phone

I don't know where the issue could lie, any ideas?

ozziexsh

ozziexsh commented on Jun 29, 2016

@ozziexsh
Author

@bennettstuart Have you properly included ng-cordova? Try making sure the plugin is fully deleted, then reinstall. Also try deleting your whole android build and rebuilding.

bennettstuart

bennettstuart commented on Jun 29, 2016

@bennettstuart

I started a fresh project, and reinstalled the things you suggested @Nehero.
Everything is working fine now. Thanks for your help!

CheetahDev

CheetahDev commented on Oct 14, 2016

@CheetahDev

Any update on the topic?
Still not working with 0.8.3

Thanks!

CheetahDev

CheetahDev commented on Jul 7, 2017

@CheetahDev

Latest plugin version has been published on NPM (0.8.7). Works as expected. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @CheetahDev@micschk@ozziexsh@yadavgn@Ionitron

        Issue actions

          Bug: Email Composer will not open · Issue #1178 · ionic-team/ng-cordova