javascript - Cordova email composer doesn't work on Android - Stack Overflow

I have a big problem with this plugin:when i tried to send email on ios, all work well. but when i trie

I have a big problem with this plugin:

when i tried to send email on ios, all work well. but when i tried in Android, it did nothing.. And i receive the callback "email view is dismissed". I tested it on some device with different android version and in a blank project. My simple code:

cordova.plugins.email.open({app: 'mailto'}, function () {
    console.log('email view dismissed');
}, this);

I have a big problem with this plugin:

https://github./katzer/cordova-plugin-email-poser

when i tried to send email on ios, all work well. but when i tried in Android, it did nothing.. And i receive the callback "email view is dismissed". I tested it on some device with different android version and in a blank project. My simple code:

cordova.plugins.email.open({app: 'mailto'}, function () {
    console.log('email view dismissed');
}, this);
Share Improve this question asked Mar 21, 2016 at 10:11 Steph8Steph8 1,6132 gold badges17 silver badges32 bronze badges 2
  • Check if plugins are properly installed or not. – Jay Rathod Commented Mar 21, 2016 at 10:43
  • 1 yes it's installed.. Because it work on iOS. I found on github that it's a issue with the new version 0.8.3 and the new Cordova 6. – Steph8 Commented Mar 21, 2016 at 11:10
Add a ment  | 

3 Answers 3

Reset to default 8

I solved this problem by installing this:

cordova plugin add https://github./katzer/cordova-plugin-email-poser.git#0.8.2

and remove the last version.

add the following code at the indicated address, in new versions of android it requests the action of sending mail

...\platforms\android\app\src\main\AndroidManifest.xml

<queries>
    <intent>
    <action android:name="android.intent.action.SENDTO" />
    <data android:scheme="mailto" />
    </intent>
</queries>

Following the process at this link helped me:

https://forum.ionicframework./t/cordovaemailposer-can-not-send-mail/50395/11

ignore the ionic part.

--EDIT--

You may try with these steps:

  1. Remove the plugin and android platform from your project.

  2. Add the email plugin from here:https://github./katzer/cordova-plugin-email-poser.git

  3. Add the Android platform.

I think the trick is you need to add the plugin before adding the android platform. Sounds silly but worked for me.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744167983a4561396.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信