[英]How to share long text content in Whatsapp using Ionic
我對WhatsApp共享有一個奇怪的問題。 我共享時不共享全文。 文字大約1000行,但不能共享所有行! 問題是什么? 文字有限制嗎? 我正在使用這個插件: 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);
}
Whatsapp在單個消息中具有字符數限制,它的65536是2 ^ 16。 因此,使您的數學計算文本長度。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.