diff options
Diffstat (limited to 'StoneIsland/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js')
| -rw-r--r--[-rwxr-xr-x] | StoneIsland/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/StoneIsland/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js b/StoneIsland/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js index 6ccd567b..3fc9bb92 100755..100644 --- a/StoneIsland/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js +++ b/StoneIsland/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js @@ -1,6 +1,4 @@ -var cordova = require('cordova'); - -function SocialSharing() { +function SocialSharing() { } // Override this method (after deviceready) to set the location where you want the iPad popup arrow to appear. @@ -25,6 +23,11 @@ SocialSharing.prototype.available = function (callback) { }, null, "SocialSharing", "available", []); }; +// this is the recommended way to share as it is the most feature-rich with respect to what you pass in and get back +SocialSharing.prototype.shareWithOptions = function (options, successCallback, errorCallback) { + cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareWithOptions"), "SocialSharing", "shareWithOptions", [options]); +}; + SocialSharing.prototype.share = function (message, subject, fileOrFileArray, url, successCallback, errorCallback) { cordova.exec(successCallback, this._getErrorCallback(errorCallback, "share"), "SocialSharing", "share", [message, subject, this._asArray(fileOrFileArray), url]); }; @@ -49,7 +52,11 @@ SocialSharing.prototype.shareViaFacebookWithPasteMessageHint = function (message }; SocialSharing.prototype.shareViaWhatsApp = function (message, fileOrFileArray, url, successCallback, errorCallback) { - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsApp"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url]); + cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsApp"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, null]); +}; + +SocialSharing.prototype.shareViaWhatsAppToReceiver = function (receiver, message, fileOrFileArray, url, successCallback, errorCallback) { + cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsAppToReceiver"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, receiver]); }; SocialSharing.prototype.shareViaSMS = function (options, phonenumbers, successCallback, errorCallback) { @@ -112,4 +119,4 @@ SocialSharing.install = function () { return window.plugins.socialsharing; }; -cordova.addConstructor(SocialSharing.install); +cordova.addConstructor(SocialSharing.install);
\ No newline at end of file |
