Вот как я использую его в моих app.js:
.controller('EmailCtrl', function($cordovaEmailComposer, $scope) {
$cordovaEmailComposer.isAvailable().then(function() {
// is available
alert("available");
}, function() {
// not available
alert("not available");
});
$scope.sendEmail = function(){
var email = {
to: '[email protected]',
cc: '[email protected]',
bcc: ['[email protected]', '[email protected]'],
attachments: [
'file://img/logo.png',
'res://icon.png',
'base64:icon.png//iVBORw0KGgoAAAANSUhEUg...',
'file://README.pdf'
],
subject: 'Mail subject',
body: 'How are you? Nice greetings from Leipzig',
isHtml: true
};
$cordovaEmailComposer.open(email).then(null, function() {
// user cancelled email
});
}
});
И здесь, в моем index.html:
<button ng-click="sendEmail()" class="button button-icon icon ion-email">
Send mail
</button>
Я следил за блогами, функция в библиотеке вызывает обратный вызов, который никогда не выполняется. Кажется, я не могу найти проблему. На консоли нет ошибки:/ – AhsanAyaz