From 3cf5e5a97afe8fc7877b528cf19130bef0d68bad Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 10 Sep 2020 14:35:21 +0200 Subject: build the app --- .../src/windows/SocialSharingProxy.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'StoneIsland/plugins/cordova-plugin-x-socialsharing/src/windows') diff --git a/StoneIsland/plugins/cordova-plugin-x-socialsharing/src/windows/SocialSharingProxy.js b/StoneIsland/plugins/cordova-plugin-x-socialsharing/src/windows/SocialSharingProxy.js index ff257d52..b52fa12f 100644 --- a/StoneIsland/plugins/cordova-plugin-x-socialsharing/src/windows/SocialSharingProxy.js +++ b/StoneIsland/plugins/cordova-plugin-x-socialsharing/src/windows/SocialSharingProxy.js @@ -1,4 +1,4 @@ -var cordova = require('cordova'); +var cordova = require('cordova'); module.exports = { share: function (win, fail, args) { @@ -10,7 +10,7 @@ module.exports = { var fileOrFileArray = args[2]; //Web link var url = args[3]; - + var folder = Windows.Storage.ApplicationData.current.temporaryFolder; var getExtension = function (strBase64) { @@ -49,7 +49,7 @@ module.exports = { var deferral = e.request.getDeferral(); var storageItems = []; var filesCount = fileOrFileArray.length; - + var completeFile = function () { if (!--filesCount) { storageItems.length && e.request.data.setStorageItems(storageItems); @@ -60,7 +60,7 @@ module.exports = { for (var i = 0; i < fileOrFileArray.length; i++) { var file = fileOrFileArray[i]; - if (file.indexOf("data:") >= 0) { + if (file.indexOf("data:") >= 0) { var fileName = getFileName(i, getExtension(file)); var buffer = Windows.Security.Cryptography.CryptographicBuffer.decodeFromBase64String(file.split(',')[1]); if (buffer) { @@ -162,6 +162,15 @@ module.exports = { } catch (err) { fail(err); } + }, + + shareViaSMS: function (win, fail, args) { + var chatMessage = new Windows.ApplicationModel.Chat.ChatMessage(); + chatMessage.body = args[0].message; + if (!!args[1]) { + chatMessage.recipients.push(args[1]); + } + Windows.ApplicationModel.Chat.ChatMessageManager.showComposeSmsMessageAsync(chatMessage).done(win, fail); } }; -- cgit v1.2.3-70-g09d2