Reputation: 65
I have strange problem with WhatsApp sharing. When I am sharing it doesn't share full text. Text is arround 1000 lines but not share all lines!! What is the problem? Is there any limit to text? I am using this plugin : https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin
sharedata() {
let msgToShare = '*Data1*' + '\r\n' + this.maindata.d1+ '\r\n' + this.maindata.d2+ '\r\n\n' + '*Data2*' + this.maindata.d3+ '\r\n\n' + '*Data3*' + this.maindata.d4+ '\r\n\n' + '*Data4' + this.maindata.d5+ '\r\n\n' + '*Data5*' + this.maindata.d6;
console.log(msgToShare);
var options = {
message: msgToShare
}
var onSuccess = function (result) {
console.log("Share completed? " + result.completed); // On Android apps mostly return false even while it's true
console.log("Shared to app: " + result.app); // On Android result.app is currently empty. On iOS it's empty when sharing is cancelled (result.completed=false)
}
var onError = function (msg) {
console.log("Sharing failed with message: " + msg);
}
window['plugins'].socialsharing.shareWithOptions(options, onSuccess, onError);
}
Upvotes: 0
Views: 1853
Reputation: 77910
Whatsapp has limit of number of characters in a single message and it's 65536 that is 2^16. So make your mathematics to calculate text length.
Upvotes: 0