Replaces email-plugin by SocialShare (#4079)

This commit is contained in:
Gustavo Maximiliano Cortez 2016-04-15 10:26:51 -03:00 committed by Matias Alejo Garcia
parent ceeb8e69f0
commit a515d47a1e
4 changed files with 32 additions and 21 deletions

View File

@ -121,9 +121,6 @@ if [ ! -d $PROJECT ]; then
cordova plugin add https://github.com/VersoSolutions/CordovaClipboard
checkOK
cordova plugin add cordova-plugin-email-composer@0.8.3
checkOK
cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git && cordova prepare
checkOK

View File

@ -140,12 +140,18 @@ angular.module('copayApp.controllers').controller('exportController',
if ($scope.noSign)
name = name + '(No Private Key)';
var properties = {
subject: 'Copay Wallet Backup: ' + name,
body: 'Here is the encrypted backup of the wallet ' + name + ': \n\n' + ew + '\n\n To import this backup, copy all text between {...}, including the symbols {}',
isHtml: false
};
window.plugin.email.open(properties);
var subject = 'Copay Wallet Backup: ' + name;
var body = 'Here is the encrypted backup of the wallet ' + name + ': \n\n' + ew + '\n\n To import this backup, copy all text between {...}, including the symbols {}';
window.plugins.socialsharing.shareViaEmail(
body,
subject,
null, // TO: must be null or an array
null, // CC: must be null or an array
null, // BCC: must be null or an array
null, // FILES: can be null, a string, or an array
function() {},
function() {}
);
});
};

View File

@ -80,12 +80,16 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
return ('* ' + v.address + ' ' + base + v.path.substring(1) + ' ' + formatDate(v.createdOn));
}).join("\n");
var properties = {
subject: 'Copay Addresses',
body: body,
isHtml: false
};
window.plugin.email.open(properties);
window.plugins.socialsharing.shareViaEmail(
body,
'Copay Addresses',
null, // TO: must be null or an array
null, // CC: must be null or an array
null, // BCC: must be null or an array
null, // FILES: can be null, a string, or an array
function() {},
function() {}
);
$timeout(function() {
$scope.$apply();

View File

@ -11,11 +11,15 @@ function(historicLog) {
return v.msg;
}).join('\n');
var properties = {
subject: 'Copay Logs',
body: body,
isHtml: false
};
window.plugin.email.open(properties);
window.plugins.socialsharing.shareViaEmail(
body,
'Copay Logs',
null, // TO: must be null or an array
null, // CC: must be null or an array
null, // BCC: must be null or an array
null, // FILES: can be null, a string, or an array
function() {},
function() {}
);
};
});