Skip to content
On this page

Share Text

shareText

Shares text to a specific scene.

Type

typescript
function shareText(request: {text: string; scene: number}): Promise<boolean>;

Parameters

NameTypeRequiredDefault ValueDescription
textStringYes/Text to be shared.
sceneNumberYes/Share to Chat:
NativeWechatConstants.WXSceneSession
Share on Moments:
NativeWechatConstants.WXSceneTimeline
Shared to Favorites:
NativeWechatConstants.WXSceneFavorite

Example

typescript
import {shareText, NativeWechatConstants} from 'native-wechat';

shareText({
      text:'Hello Hector!',
      scene:NativeWechatConstants.WXSceneFavorite
})

Released under the MIT License.