离子电子邮件作曲家插件

时间:2017-05-22 11:23:45

标签: angularjs cordova email ionic-framework

我从离子应用程序发送电子邮件时遇到严重问题。

我正在使用这个cordova插件

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

这是我的代码:

控制器:

.controller('EmailController', function($scope) {
$scope.sendFeedback= function() {

    if(window.plugins && window.plugins.com.jcjee.plugins.emailcomposer) {
        console.log("test");
        window.plugins.emailComposer.showEmailComposerWithCallback(function(result) {
            console.log("Response -> " + result);
        }, 
        "Feedback for your App", // Subject
        "",                      // Body
        ["test@example.com"],    // To
        null,                    // CC
        null,                    // BCC
        false,                   // isHTML
        null,                    // Attachments
        null);                   // Attachment Data
    }
    else console.log("error");

}
});

config.xml中:`

    <plugin name="cordova-plugin-email" spec="^1.2.6" />
<plugin name="cordova-plugin-email-composer" spec="https://github.com/katzer/cordova-plugin-email-composer.git" />
<plugin name="com.jcjee.plugins.emailcomposer" spec="https://github.com/jcjee/email-composer.git" />

观点:

<ion-view title="Page" > <ion-content padding="true" class="has-header"> <button ng-click="sendFeedback()" class="button button-positive button-block">send mail</button> </ion-content> </ion-view>

当我查看日志时,应用程序甚至无法通过if(window.plugins&amp;&amp;&amp; window.plugins.com.jcjee.plugins.emailcomposer) 所以它告诉我:console.log(“error”);

1 个答案:

答案 0 :(得分:0)

我不确定pid | category ----+--------- 1 | a 1 | b 2 | b 2 | a 3 | a 3 | c 3 | b 插件是否真的与最新版本的Cordova一起使用, 但对于jcjee/email-composer,您可以使用

验证手机上的插件可用性
katzer/cordova-plugin-email-composer