Skip to content

ShareText

Parameters

PropertyTypeDefault ValueRequiredDescription
textstring-YesText to be shared
scenenumber-NoTarget scene for sharing, 0=share to chat, 1=share to Moments, 2=share to favorites

Example

javascript
window.Wechat.shareText({
      text: '分享文本',
      scene: 0, 
  }, function(res){
    console.log("share success");
  }, function(err) {
    console.error(err);
  }
);

Apache 2.0 License.